diff --git a/node_modules/@alloc/quick-lru/index.d.ts b/node_modules/@alloc/quick-lru/index.d.ts deleted file mode 100644 index eb819bad0c20b6267e461f4f9a7959e6be7de437..0000000000000000000000000000000000000000 --- a/node_modules/@alloc/quick-lru/index.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -declare namespace QuickLRU { - interface Options { - /** - The maximum number of milliseconds an item should remain in the cache. - - @default Infinity - - By default, `maxAge` will be `Infinity`, which means that items will never expire. - Lazy expiration upon the next write or read call. - - Individual expiration of an item can be specified by the `set(key, value, maxAge)` method. - */ - readonly maxAge?: number; - - /** - The maximum number of items before evicting the least recently used items. - */ - readonly maxSize: number; - - /** - Called right before an item is evicted from the cache. - - Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). - */ - onEviction?: (key: KeyType, value: ValueType) => void; - } -} - -declare class QuickLRU - implements Iterable<[KeyType, ValueType]> { - /** - The stored item count. - */ - readonly size: number; - - /** - Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29). - - The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. - - @example - ``` - import QuickLRU = require('quick-lru'); - - const lru = new QuickLRU({maxSize: 1000}); - - lru.set('🦄', '🌈'); - - lru.has('🦄'); - //=> true - - lru.get('🦄'); - //=> '🌈' - ``` - */ - constructor(options: QuickLRU.Options); - - [Symbol.iterator](): IterableIterator<[KeyType, ValueType]>; - - /** - Set an item. Returns the instance. - - Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire. - - @returns The list instance. - */ - set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this; - - /** - Get an item. - - @returns The stored item or `undefined`. - */ - get(key: KeyType): ValueType | undefined; - - /** - Check if an item exists. - */ - has(key: KeyType): boolean; - - /** - Get an item without marking it as recently used. - - @returns The stored item or `undefined`. - */ - peek(key: KeyType): ValueType | undefined; - - /** - Delete an item. - - @returns `true` if the item is removed or `false` if the item doesn't exist. - */ - delete(key: KeyType): boolean; - - /** - Delete all items. - */ - clear(): void; - - /** - Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee. - - Useful for on-the-fly tuning of cache sizes in live systems. - */ - resize(maxSize: number): void; - - /** - Iterable for all the keys. - */ - keys(): IterableIterator; - - /** - Iterable for all the values. - */ - values(): IterableIterator; - - /** - Iterable for all entries, starting with the oldest (ascending in recency). - */ - entriesAscending(): IterableIterator<[KeyType, ValueType]>; - - /** - Iterable for all entries, starting with the newest (descending in recency). - */ - entriesDescending(): IterableIterator<[KeyType, ValueType]>; -} - -export = QuickLRU; diff --git a/node_modules/@alloc/quick-lru/index.js b/node_modules/@alloc/quick-lru/index.js deleted file mode 100644 index 7eeced23ea955f3fc72a5f7f66587abd1acab012..0000000000000000000000000000000000000000 --- a/node_modules/@alloc/quick-lru/index.js +++ /dev/null @@ -1,263 +0,0 @@ -'use strict'; - -class QuickLRU { - constructor(options = {}) { - if (!(options.maxSize && options.maxSize > 0)) { - throw new TypeError('`maxSize` must be a number greater than 0'); - } - - if (typeof options.maxAge === 'number' && options.maxAge === 0) { - throw new TypeError('`maxAge` must be a number greater than 0'); - } - - this.maxSize = options.maxSize; - this.maxAge = options.maxAge || Infinity; - this.onEviction = options.onEviction; - this.cache = new Map(); - this.oldCache = new Map(); - this._size = 0; - } - - _emitEvictions(cache) { - if (typeof this.onEviction !== 'function') { - return; - } - - for (const [key, item] of cache) { - this.onEviction(key, item.value); - } - } - - _deleteIfExpired(key, item) { - if (typeof item.expiry === 'number' && item.expiry <= Date.now()) { - if (typeof this.onEviction === 'function') { - this.onEviction(key, item.value); - } - - return this.delete(key); - } - - return false; - } - - _getOrDeleteIfExpired(key, item) { - const deleted = this._deleteIfExpired(key, item); - if (deleted === false) { - return item.value; - } - } - - _getItemValue(key, item) { - return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value; - } - - _peek(key, cache) { - const item = cache.get(key); - - return this._getItemValue(key, item); - } - - _set(key, value) { - this.cache.set(key, value); - this._size++; - - if (this._size >= this.maxSize) { - this._size = 0; - this._emitEvictions(this.oldCache); - this.oldCache = this.cache; - this.cache = new Map(); - } - } - - _moveToRecent(key, item) { - this.oldCache.delete(key); - this._set(key, item); - } - - * _entriesAscending() { - for (const item of this.oldCache) { - const [key, value] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield item; - } - } - } - - for (const item of this.cache) { - const [key, value] = item; - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield item; - } - } - } - - get(key) { - if (this.cache.has(key)) { - const item = this.cache.get(key); - - return this._getItemValue(key, item); - } - - if (this.oldCache.has(key)) { - const item = this.oldCache.get(key); - if (this._deleteIfExpired(key, item) === false) { - this._moveToRecent(key, item); - return item.value; - } - } - } - - set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) { - if (this.cache.has(key)) { - this.cache.set(key, { - value, - maxAge - }); - } else { - this._set(key, {value, expiry: maxAge}); - } - } - - has(key) { - if (this.cache.has(key)) { - return !this._deleteIfExpired(key, this.cache.get(key)); - } - - if (this.oldCache.has(key)) { - return !this._deleteIfExpired(key, this.oldCache.get(key)); - } - - return false; - } - - peek(key) { - if (this.cache.has(key)) { - return this._peek(key, this.cache); - } - - if (this.oldCache.has(key)) { - return this._peek(key, this.oldCache); - } - } - - delete(key) { - const deleted = this.cache.delete(key); - if (deleted) { - this._size--; - } - - return this.oldCache.delete(key) || deleted; - } - - clear() { - this.cache.clear(); - this.oldCache.clear(); - this._size = 0; - } - - resize(newSize) { - if (!(newSize && newSize > 0)) { - throw new TypeError('`maxSize` must be a number greater than 0'); - } - - const items = [...this._entriesAscending()]; - const removeCount = items.length - newSize; - if (removeCount < 0) { - this.cache = new Map(items); - this.oldCache = new Map(); - this._size = items.length; - } else { - if (removeCount > 0) { - this._emitEvictions(items.slice(0, removeCount)); - } - - this.oldCache = new Map(items.slice(removeCount)); - this.cache = new Map(); - this._size = 0; - } - - this.maxSize = newSize; - } - - * keys() { - for (const [key] of this) { - yield key; - } - } - - * values() { - for (const [, value] of this) { - yield value; - } - } - - * [Symbol.iterator]() { - for (const item of this.cache) { - const [key, value] = item; - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - - for (const item of this.oldCache) { - const [key, value] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - } - } - - * entriesDescending() { - let items = [...this.cache]; - for (let i = items.length - 1; i >= 0; --i) { - const item = items[i]; - const [key, value] = item; - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - - items = [...this.oldCache]; - for (let i = items.length - 1; i >= 0; --i) { - const item = items[i]; - const [key, value] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - } - } - - * entriesAscending() { - for (const [key, value] of this._entriesAscending()) { - yield [key, value.value]; - } - } - - get size() { - if (!this._size) { - return this.oldCache.size; - } - - let oldCacheSize = 0; - for (const key of this.oldCache.keys()) { - if (!this.cache.has(key)) { - oldCacheSize++; - } - } - - return Math.min(this._size + oldCacheSize, this.maxSize); - } -} - -module.exports = QuickLRU; diff --git a/node_modules/@alloc/quick-lru/license b/node_modules/@alloc/quick-lru/license deleted file mode 100644 index e7af2f77107d73046421ef56c4684cbfdd3c1e89..0000000000000000000000000000000000000000 --- a/node_modules/@alloc/quick-lru/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@alloc/quick-lru/package.json b/node_modules/@alloc/quick-lru/package.json deleted file mode 100644 index 21f107267935529db880467fe224f9cbecc29be8..0000000000000000000000000000000000000000 --- a/node_modules/@alloc/quick-lru/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@alloc/quick-lru", - "version": "5.2.0", - "description": "Simple “Least Recently Used” (LRU) cache", - "license": "MIT", - "repository": "sindresorhus/quick-lru", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "lru", - "quick", - "cache", - "caching", - "least", - "recently", - "used", - "fast", - "map", - "hash", - "buffer" - ], - "devDependencies": { - "ava": "^2.0.0", - "coveralls": "^3.0.3", - "nyc": "^15.0.0", - "tsd": "^0.11.0", - "xo": "^0.26.0" - } -} diff --git a/node_modules/@alloc/quick-lru/readme.md b/node_modules/@alloc/quick-lru/readme.md deleted file mode 100644 index 7187ba598b353653e8adeba2ec003f79c2c302b8..0000000000000000000000000000000000000000 --- a/node_modules/@alloc/quick-lru/readme.md +++ /dev/null @@ -1,139 +0,0 @@ -# quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master) - -> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) - -Useful when you need to cache something and limit memory usage. - -Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`. - -## Install - -``` -$ npm install quick-lru -``` - -## Usage - -```js -const QuickLRU = require('quick-lru'); - -const lru = new QuickLRU({maxSize: 1000}); - -lru.set('🦄', '🌈'); - -lru.has('🦄'); -//=> true - -lru.get('🦄'); -//=> '🌈' -``` - -## API - -### new QuickLRU(options?) - -Returns a new instance. - -### options - -Type: `object` - -#### maxSize - -*Required*\ -Type: `number` - -The maximum number of items before evicting the least recently used items. - -#### maxAge - -Type: `number`\ -Default: `Infinity` - -The maximum number of milliseconds an item should remain in cache. -By default maxAge will be Infinity, which means that items will never expire. - -Lazy expiration happens upon the next `write` or `read` call. - -Individual expiration of an item can be specified by the `set(key, value, options)` method. - -#### onEviction - -*Optional*\ -Type: `(key, value) => void` - -Called right before an item is evicted from the cache. - -Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). - -### Instance - -The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. - -Both `key` and `value` can be of any type. - -#### .set(key, value, options?) - -Set an item. Returns the instance. - -Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire. - -#### .get(key) - -Get an item. - -#### .has(key) - -Check if an item exists. - -#### .peek(key) - -Get an item without marking it as recently used. - -#### .delete(key) - -Delete an item. - -Returns `true` if the item is removed or `false` if the item doesn't exist. - -#### .clear() - -Delete all items. - -#### .resize(maxSize) - -Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee. - -Useful for on-the-fly tuning of cache sizes in live systems. - -#### .keys() - -Iterable for all the keys. - -#### .values() - -Iterable for all the values. - -#### .entriesAscending() - -Iterable for all entries, starting with the oldest (ascending in recency). - -#### .entriesDescending() - -Iterable for all entries, starting with the newest (descending in recency). - -#### .size - -The stored item count. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/@hookform/resolvers/LICENSE b/node_modules/@hookform/resolvers/LICENSE deleted file mode 100644 index 139faf48e1b4926a8743bc7a5bd67287f43f0dd0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019-present Beier(Bill) Luo - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@hookform/resolvers/README.md b/node_modules/@hookform/resolvers/README.md deleted file mode 100644 index 07a0362f0b14577d910c329eee0da294990e6099..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/README.md +++ /dev/null @@ -1,794 +0,0 @@ -
-

- - React Hook Form Logo - React hook custom hook for form validation - -

-
- -

Performant, flexible and extensible forms with easy to use validation.

- -
- -[![npm downloads](https://img.shields.io/npm/dm/@hookform/resolvers.svg?style=for-the-badge)](https://www.npmjs.com/package/@hookform/resolvers) -[![npm](https://img.shields.io/npm/dt/@hookform/resolvers.svg?style=for-the-badge)](https://www.npmjs.com/package/@hookform/resolvers) -[![npm](https://img.shields.io/bundlephobia/minzip/@hookform/resolvers?style=for-the-badge)](https://bundlephobia.com/result?p=@hookform/resolvers) - -
- -## Install - - npm install @hookform/resolvers - -## Links - -- [React-hook-form validation resolver documentation ](https://react-hook-form.com/api/useform/#resolver) - -### Supported resolvers - -- [Install](#install) -- [Links](#links) - - [Supported resolvers](#supported-resolvers) -- [API](#api) -- [Quickstart](#quickstart) - - [Yup](#yup) - - [Zod](#zod) - - [Superstruct](#superstruct) - - [Joi](#joi) - - [Vest](#vest) - - [Class Validator](#class-validator) - - [io-ts](#io-ts) - - [Nope](#nope) - - [computed-types](#computed-types) - - [typanion](#typanion) - - [Ajv](#ajv) - - [TypeBox](#typebox) - - [With `ValueCheck`](#with-valuecheck) - - [With `TypeCompiler`](#with-typecompiler) - - [ArkType](#arktype) - - [Valibot](#valibot) - - [TypeSchema](#typeschema) - - [effect-ts](#effect-ts) - - [VineJS](#vinejs) - - [fluentvalidation-ts](#fluentvalidation-ts) -- [Backers](#backers) - - [Sponsors](#sponsors) -- [Contributors](#contributors) - -## API - -``` -type Options = { - mode: 'async' | 'sync', - raw?: boolean -} - -resolver(schema: object, schemaOptions?: object, resolverOptions: Options) -``` - -| | type | Required | Description | -| --------------- | -------- | -------- | --------------------------------------------- | -| schema | `object` | ✓ | validation schema | -| schemaOptions | `object` | | validation library schema options | -| resolverOptions | `object` | | resolver options, `async` is the default mode | - -## Quickstart - -### [Yup](https://github.com/jquense/yup) - -Dead simple Object schema validation. - -[![npm](https://img.shields.io/bundlephobia/minzip/yup?style=for-the-badge)](https://bundlephobia.com/result?p=yup) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { yupResolver } from '@hookform/resolvers/yup'; -import * as yup from 'yup'; - -const schema = yup - .object() - .shape({ - name: yup.string().required(), - age: yup.number().required(), - }) - .required(); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: yupResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [Zod](https://github.com/vriad/zod) - -TypeScript-first schema validation with static type inference - -[![npm](https://img.shields.io/bundlephobia/minzip/zod?style=for-the-badge)](https://bundlephobia.com/result?p=zod) - -> ⚠️ Example below uses the `valueAsNumber`, which requires `react-hook-form` v6.12.0 (released Nov 28, 2020) or later. - -```tsx -import { useForm } from 'react-hook-form'; -import { zodResolver } from '@hookform/resolvers/zod'; -import * as z from 'zod'; - -const schema = z.object({ - name: z.string().min(1, { message: 'Required' }), - age: z.number().min(10), -}); - -const App = () => { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: zodResolver(schema), - }); - - return ( -
console.log(d))}> - - {errors.name?.message &&

{errors.name?.message}

} - - {errors.age?.message &&

{errors.age?.message}

} - -
- ); -}; -``` - -### [Superstruct](https://github.com/ianstormtaylor/superstruct) - -A simple and composable way to validate data in JavaScript (or TypeScript). - -[![npm](https://img.shields.io/bundlephobia/minzip/superstruct?style=for-the-badge)](https://bundlephobia.com/result?p=superstruct) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { superstructResolver } from '@hookform/resolvers/superstruct'; -import { object, string, number } from 'superstruct'; - -const schema = object({ - name: string(), - age: number(), -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: superstructResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [Joi](https://github.com/sideway/joi) - -The most powerful data validation library for JS. - -[![npm](https://img.shields.io/bundlephobia/minzip/joi?style=for-the-badge)](https://bundlephobia.com/result?p=joi) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { joiResolver } from '@hookform/resolvers/joi'; -import Joi from 'joi'; - -const schema = Joi.object({ - name: Joi.string().required(), - age: Joi.number().required(), -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: joiResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [Vest](https://github.com/ealush/vest) - -Vest 🦺 Declarative Validation Testing. - -[![npm](https://img.shields.io/bundlephobia/minzip/vest?style=for-the-badge)](https://bundlephobia.com/result?p=vest) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { vestResolver } from '@hookform/resolvers/vest'; -import { create, test, enforce } from 'vest'; - -const validationSuite = create((data = {}) => { - test('username', 'Username is required', () => { - enforce(data.username).isNotEmpty(); - }); - - test('password', 'Password is required', () => { - enforce(data.password).isNotEmpty(); - }); -}); - -const App = () => { - const { register, handleSubmit, errors } = useForm({ - resolver: vestResolver(validationSuite), - }); - - return ( -
console.log(data))}> - - - -
- ); -}; -``` - -### [Class Validator](https://github.com/typestack/class-validator) - -Decorator-based property validation for classes. - -[![npm](https://img.shields.io/bundlephobia/minzip/class-validator?style=for-the-badge)](https://bundlephobia.com/result?p=class-validator) - -> ⚠️ Remember to add these options to your `tsconfig.json`! - -``` -"strictPropertyInitialization": false, -"experimentalDecorators": true -``` - -```tsx -import { useForm } from 'react-hook-form'; -import { classValidatorResolver } from '@hookform/resolvers/class-validator'; -import { Length, Min, IsEmail } from 'class-validator'; - -class User { - @Length(2, 30) - username: string; - - @IsEmail() - email: string; -} - -const resolver = classValidatorResolver(User); - -const App = () => { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ resolver }); - - return ( -
console.log(data))}> - - {errors.username && {errors.username.message}} - - {errors.email && {errors.email.message}} - -
- ); -}; -``` - -### [io-ts](https://github.com/gcanti/io-ts) - -Validate your data with powerful decoders. - -[![npm](https://img.shields.io/bundlephobia/minzip/io-ts?style=for-the-badge)](https://bundlephobia.com/result?p=io-ts) - -```typescript jsx -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { ioTsResolver } from '@hookform/resolvers/io-ts'; -import t from 'io-ts'; -// you don't have to use io-ts-types, but it's very useful -import tt from 'io-ts-types'; - -const schema = t.type({ - username: t.string, - age: tt.NumberFromString, -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: ioTsResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; - -export default App; -``` - -### [Nope](https://github.com/bvego/nope-validator) - -A small, simple, and fast JS validator - -[![npm](https://img.shields.io/bundlephobia/minzip/nope-validator?style=for-the-badge)](https://bundlephobia.com/result?p=nope-validator) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { nopeResolver } from '@hookform/resolvers/nope'; -import Nope from 'nope-validator'; - -const schema = Nope.object().shape({ - name: Nope.string().required(), - age: Nope.number().required(), -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: nopeResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [computed-types](https://github.com/neuledge/computed-types) - -TypeScript-first schema validation with static type inference - -[![npm](https://img.shields.io/bundlephobia/minzip/computed-types?style=for-the-badge)](https://bundlephobia.com/result?p=computed-types) - -```tsx -import { useForm } from 'react-hook-form'; -import { computedTypesResolver } from '@hookform/resolvers/computed-types'; -import Schema, { number, string } from 'computed-types'; - -const schema = Schema({ - username: string.min(1).error('username field is required'), - age: number, -}); - -const App = () => { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: computedTypesResolver(schema), - }); - - return ( -
console.log(d))}> - - {errors.name?.message &&

{errors.name?.message}

} - - {errors.age?.message &&

{errors.age?.message}

} - -
- ); -}; -``` - -### [typanion](https://github.com/arcanis/typanion) - -Static and runtime type assertion library with no dependencies - -[![npm](https://img.shields.io/bundlephobia/minzip/typanion?style=for-the-badge)](https://bundlephobia.com/result?p=typanion) - -```tsx -import { useForm } from 'react-hook-form'; -import { typanionResolver } from '@hookform/resolvers/typanion'; -import * as t from 'typanion'; - -const isUser = t.isObject({ - username: t.applyCascade(t.isString(), [t.hasMinLength(1)]), - age: t.applyCascade(t.isNumber(), [ - t.isInteger(), - t.isInInclusiveRange(1, 100), - ]), -}); - -const App = () => { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: typanionResolver(isUser), - }); - - return ( -
console.log(d))}> - - {errors.name?.message &&

{errors.name?.message}

} - - {errors.age?.message &&

{errors.age?.message}

} - -
- ); -}; -``` - -### [Ajv](https://github.com/ajv-validator/ajv) - -The fastest JSON validator for Node.js and browser - -[![npm](https://img.shields.io/bundlephobia/minzip/ajv?style=for-the-badge)](https://bundlephobia.com/result?p=ajv) - -```tsx -import { useForm } from 'react-hook-form'; -import { ajvResolver } from '@hookform/resolvers/ajv'; - -// must use `minLength: 1` to implement required field -const schema = { - type: 'object', - properties: { - username: { - type: 'string', - minLength: 1, - errorMessage: { minLength: 'username field is required' }, - }, - password: { - type: 'string', - minLength: 1, - errorMessage: { minLength: 'password field is required' }, - }, - }, - required: ['username', 'password'], - additionalProperties: false, -}; - -const App = () => { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: ajvResolver(schema), - }); - - return ( -
console.log(data))}> - - {errors.username && {errors.username.message}} - - {errors.password && {errors.password.message}} - -
- ); -}; -``` - -### [TypeBox](https://github.com/sinclairzx81/typebox) - -JSON Schema Type Builder with Static Type Resolution for TypeScript - -[![npm](https://img.shields.io/bundlephobia/minzip/@sinclair/typebox?style=for-the-badge)](https://bundlephobia.com/result?p=@sinclair/typebox) - -#### With `ValueCheck` - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { typeboxResolver } from '@hookform/resolvers/typebox'; -import { Type } from '@sinclair/typebox'; - -const schema = Type.Object({ - username: Type.String({ minLength: 1 }), - password: Type.String({ minLength: 1 }), -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: typeboxResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -#### With `TypeCompiler` - -A high-performance JIT of `TypeBox`, [read more](https://github.com/sinclairzx81/typebox#typecompiler) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { typeboxResolver } from '@hookform/resolvers/typebox'; -import { Type } from '@sinclair/typebox'; -import { TypeCompiler } from '@sinclair/typebox/compiler'; - -const schema = Type.Object({ - username: Type.String({ minLength: 1 }), - password: Type.String({ minLength: 1 }), -}); - -const typecheck = TypeCompiler.Compile(schema); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: typeboxResolver(typecheck), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [ArkType](https://github.com/arktypeio/arktype) - -TypeScript's 1:1 validator, optimized from editor to runtime - -[![npm](https://img.shields.io/bundlephobia/minzip/arktype?style=for-the-badge)](https://bundlephobia.com/result?p=arktype) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { arktypeResolver } from '@hookform/resolvers/arktype'; -import { type } from 'arktype'; - -const schema = type({ - username: 'string>1', - password: 'string>1', -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: arktypeResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [Valibot](https://github.com/fabian-hiller/valibot) - -The modular and type safe schema library for validating structural data - -[![npm](https://img.shields.io/bundlephobia/minzip/valibot?style=for-the-badge)](https://bundlephobia.com/result?p=valibot) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { valibotResolver } from '@hookform/resolvers/valibot'; -import * as v from 'valibot'; - -const schema = v.object({ - username: v.pipe( - v.string('username is required'), - v.minLength(3, 'Needs to be at least 3 characters'), - v.endsWith('cool', 'Needs to end with `cool`'), - ), - password: v.string('password is required'), -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: valibotResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [TypeSchema](https://typeschema.com) - -Universal adapter for schema validation, compatible with [any validation library](https://typeschema.com/#coverage) - -[![npm](https://img.shields.io/bundlephobia/minzip/@typeschema/main?style=for-the-badge)](https://bundlephobia.com/result?p=@typeschema/main) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { typeschemaResolver } from '@hookform/resolvers/typeschema'; -import * as z from 'zod'; - -// Use your favorite validation library -const schema = z.object({ - username: z.string().min(1, { message: 'Required' }), - password: z.number().min(1, { message: 'Required' }), -}); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: typeschemaResolver(schema), - }); - - return ( -
console.log(d))}> - - - -
- ); -}; -``` - -### [effect-ts](https://github.com/Effect-TS/effect) - -A powerful TypeScript framework that provides a fully-fledged functional effect system with a rich standard library. - -[![npm](https://img.shields.io/bundlephobia/minzip/@effect/schema?style=for-the-badge)](https://bundlephobia.com/result?p=effect) - -```typescript jsx -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { effectTsResolver } from '@hookform/resolvers/effect-ts'; -import { Schema } from '@effect/schema'; - -const schema = Schema.Struct({ - username: Schema.String.pipe( - Schema.nonEmpty({ message: () => 'username required' }), - ), - password: Schema.String.pipe( - Schema.nonEmpty({ message: () => 'password required' }), - ), -}); - -type FormData = Schema.Schema.Type; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - // provide generic if TS has issues inferring types - } = useForm({ - resolver: effectTsResolver(schema), - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} -``` - -### [VineJS](https://github.com/vinejs/vine) - -VineJS is a form data validation library for Node.js - -[![npm](https://img.shields.io/bundlephobia/minzip/@vinejs/vine?style=for-the-badge)](https://bundlephobia.com/result?p=@vinejs/vine) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { vineResolver } from '@hookform/resolvers/vine'; -import vine from '@vinejs/vine'; - -const schema = vine.compile( - vine.object({ - username: vine.string().minLength(1), - password: vine.string().minLength(1), - }), -); - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: vineResolver(schema), - }); - - return ( -
console.log(d))}> - - {errors.username && {errors.username.message}} - - {errors.password && {errors.password.message}} - -
- ); -}; -``` - - -### [fluentvalidation-ts](https://github.com/AlexJPotter/fluentvalidation-ts) - -A TypeScript-first library for building strongly-typed validation rules - -[![npm](https://img.shields.io/bundlephobia/minzip/@vinejs/vine?style=for-the-badge)](https://bundlephobia.com/result?p=@vinejs/vine) - -```typescript jsx -import { useForm } from 'react-hook-form'; -import { fluentValidationResolver } from '@hookform/resolvers/fluentvalidation-ts'; -import { Validator } from 'fluentvalidation-ts'; - -class FormDataValidator extends Validator { - constructor() { - super(); - - this.ruleFor('username') - .notEmpty() - .withMessage('username is a required field'); - this.ruleFor('password') - .notEmpty() - .withMessage('password is a required field'); - } -} - -const App = () => { - const { register, handleSubmit } = useForm({ - resolver: fluentValidationResolver(new FormDataValidator()), - }); - - return ( -
console.log(d))}> - - {errors.username && {errors.username.message}} - - {errors.password && {errors.password.message}} - -
- ); -}; -``` - -## Backers - -Thanks go to all our backers! [[Become a backer](https://opencollective.com/react-hook-form#backer)]. - - - - - -## Contributors - -Thanks go to these wonderful people! [[Become a contributor](CONTRIBUTING.md)]. - - - - diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.d.ts b/node_modules/@hookform/resolvers/ajv/dist/ajv.d.ts deleted file mode 100644 index d3087734bd75860f2de6cf6ae7e33dca7dd5febb..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Resolver } from './types'; -export declare const ajvResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.js b/node_modules/@hookform/resolvers/ajv/dist/ajv.js deleted file mode 100644 index 963c2e0dd8ce2e924ac9501b8d4699c28e1a534c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("ajv"),a=require("ajv-errors"),s=require("react-hook-form");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/t(r),i=/*#__PURE__*/t(a),n=function(e,r){return e.forEach(function(e){"required"===e.keyword&&(e.instancePath+="/"+e.params.missingProperty)}),e.reduce(function(e,a){var t=a.instancePath.substring(1).replace(/\//g,".");if(e[t]||(e[t]={message:a.message,type:a.keyword}),r){var o=e[t].types,i=o&&o[a.keyword];e[t]=s.appendErrors(t,r,e,a.keyword,i?[].concat(i,a.message||""):a.message)}return e},{})};exports.ajvResolver=function(r,a,s){return void 0===s&&(s={}),function(t,u,c){try{var l=new o.default(Object.assign({},{allErrors:!0,validateSchema:!0},a));i.default(l);var d=l.compile(Object.assign({$async:s&&"async"===s.mode},r)),v=d(t);return c.shouldUseNativeValidation&&e.validateFieldsNatively({},c),Promise.resolve(v?{values:t,errors:{}}:{values:{},errors:e.toNestErrors(n(d.errors,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)})}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=ajv.js.map diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.js.map b/node_modules/@hookform/resolvers/ajv/dist/ajv.js.map deleted file mode 100644 index 7a221200afe31993e0b21058ddb7572738e0b7af..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv.js","sources":["../src/ajv.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport Ajv, { DefinedError } from 'ajv';\nimport ajvErrors from 'ajv-errors';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n ajvErrors: DefinedError[],\n validateAllFieldCriteria: boolean,\n) => {\n // Ajv will return empty instancePath when require error\n ajvErrors.forEach((error) => {\n if (error.keyword === 'required') {\n error.instancePath += '/' + error.params.missingProperty;\n }\n });\n\n return ajvErrors.reduce>((previous, error) => {\n // `/deepObject/data` -> `deepObject.data`\n const path = error.instancePath.substring(1).replace(/\\//g, '.');\n\n if (!previous[path]) {\n previous[path] = {\n message: error.message,\n type: error.keyword,\n };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[path].types;\n const messages = types && types[error.keyword];\n\n previous[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n previous,\n error.keyword,\n messages\n ? ([] as string[]).concat(messages as string[], error.message || '')\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {});\n};\n\nexport const ajvResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n const ajv = new Ajv(\n Object.assign(\n {},\n {\n allErrors: true,\n validateSchema: true,\n },\n schemaOptions,\n ),\n );\n\n ajvErrors(ajv);\n\n const validate = ajv.compile(\n Object.assign(\n { $async: resolverOptions && resolverOptions.mode === 'async' },\n schema,\n ),\n );\n\n const valid = validate(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return valid\n ? { values, errors: {} }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validate.errors as DefinedError[],\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","ajvErrors","validateAllFieldCriteria","forEach","error","keyword","instancePath","params","missingProperty","reduce","previous","path","substring","replace","message","type","types","messages","appendErrors","concat","schema","schemaOptions","resolverOptions","values","_","options","ajv","Ajv","Object","assign","allErrors","validateSchema","validate","compile","$async","mode","valid","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","errors","toNestErrors","criteriaMode","e","reject"],"mappings":"+NAMMA,EAAmB,SACvBC,EACAC,GASA,OANAD,EAAUE,QAAQ,SAACC,GACK,aAAlBA,EAAMC,UACRD,EAAME,cAAgB,IAAMF,EAAMG,OAAOC,gBAE7C,GAEOP,EAAUQ,OAAmC,SAACC,EAAUN,GAE7D,IAAMO,EAAOP,EAAME,aAAaM,UAAU,GAAGC,QAAQ,MAAO,KAS5D,GAPKH,EAASC,KACZD,EAASC,GAAQ,CACfG,QAASV,EAAMU,QACfC,KAAMX,EAAMC,UAIZH,EAA0B,CAC5B,IAAMc,EAAQN,EAASC,GAAMK,MACvBC,EAAWD,GAASA,EAAMZ,EAAMC,SAEtCK,EAASC,GAAQO,eACfP,EACAT,EACAQ,EACAN,EAAMC,QACNY,EACK,GAAgBE,OAAOF,EAAsBb,EAAMU,SAAW,IAC/DV,EAAMU,QAEd,CAEA,OAAOJ,CACT,EAAG,GACL,sBAGE,SAACU,EAAQC,EAAeC,GAAoB,gBAApBA,IAAAA,EAAkB,CAAA,GAAE,SACrCC,EAAQC,EAAGC,GAAO,IACvB,IAAMC,EAAM,IAAIC,UACdC,OAAOC,OACL,CAAE,EACF,CACEC,WAAW,EACXC,gBAAgB,GAElBV,IAIJpB,EAAS,QAACyB,GAEV,IAAMM,EAAWN,EAAIO,QACnBL,OAAOC,OACL,CAAEK,OAAQZ,GAA4C,UAAzBA,EAAgBa,MAC7Cf,IAIEgB,EAAQJ,EAAST,GAIvB,OAFAE,EAAQY,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEb,GAEhEc,QAAAC,QAAOJ,EACH,CAAEb,OAAAA,EAAQkB,OAAQ,CAAI,GACtB,CACElB,OAAQ,CAAA,EACRkB,OAAQC,eACN1C,EACEgC,EAASS,QACRhB,EAAQY,2BACkB,QAAzBZ,EAAQkB,cAEZlB,IAGV,CAAC,MAAAmB,GAAA,OAAAL,QAAAM,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.mjs b/node_modules/@hookform/resolvers/ajv/dist/ajv.mjs deleted file mode 100644 index ebfda31bc9c17d8836bd962f9c4a3c41714a2068..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import o from"ajv";import a from"ajv-errors";import{appendErrors as s}from"react-hook-form";var t=function(r,e){return r.forEach(function(r){"required"===r.keyword&&(r.instancePath+="/"+r.params.missingProperty)}),r.reduce(function(r,o){var a=o.instancePath.substring(1).replace(/\//g,".");if(r[a]||(r[a]={message:o.message,type:o.keyword}),e){var t=r[a].types,i=t&&t[o.keyword];r[a]=s(a,e,r,o.keyword,i?[].concat(i,o.message||""):o.message)}return r},{})},i=function(s,i,n){return void 0===n&&(n={}),function(c,m,u){try{var l=new o(Object.assign({},{allErrors:!0,validateSchema:!0},i));a(l);var v=l.compile(Object.assign({$async:n&&"async"===n.mode},s)),d=v(c);return u.shouldUseNativeValidation&&r({},u),Promise.resolve(d?{values:c,errors:{}}:{values:{},errors:e(t(v.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)})}catch(r){return Promise.reject(r)}}};export{i as ajvResolver}; -//# sourceMappingURL=ajv.module.js.map diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.modern.mjs b/node_modules/@hookform/resolvers/ajv/dist/ajv.modern.mjs deleted file mode 100644 index 9fca54509b33a1df2965e25cd66db6e25f19779e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as r}from"@hookform/resolvers";import s from"ajv";import o from"ajv-errors";import{appendErrors as a}from"react-hook-form";const t=(e,r)=>(e.forEach(e=>{"required"===e.keyword&&(e.instancePath+="/"+e.params.missingProperty)}),e.reduce((e,s)=>{const o=s.instancePath.substring(1).replace(/\//g,".");if(e[o]||(e[o]={message:s.message,type:s.keyword}),r){const t=e[o].types,i=t&&t[s.keyword];e[o]=a(o,r,e,s.keyword,i?[].concat(i,s.message||""):s.message)}return e},{})),i=(a,i,n={})=>async(c,m,l)=>{const d=new s(Object.assign({},{allErrors:!0,validateSchema:!0},i));o(d);const p=d.compile(Object.assign({$async:n&&"async"===n.mode},a)),y=p(c);return l.shouldUseNativeValidation&&e({},l),y?{values:c,errors:{}}:{values:{},errors:r(t(p.errors,!l.shouldUseNativeValidation&&"all"===l.criteriaMode),l)}};export{i as ajvResolver}; -//# sourceMappingURL=ajv.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.modern.mjs.map b/node_modules/@hookform/resolvers/ajv/dist/ajv.modern.mjs.map deleted file mode 100644 index f85a5c1d21a0c853c57b21c709e1972e26ed9783..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv.modern.mjs","sources":["../src/ajv.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport Ajv, { DefinedError } from 'ajv';\nimport ajvErrors from 'ajv-errors';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n ajvErrors: DefinedError[],\n validateAllFieldCriteria: boolean,\n) => {\n // Ajv will return empty instancePath when require error\n ajvErrors.forEach((error) => {\n if (error.keyword === 'required') {\n error.instancePath += '/' + error.params.missingProperty;\n }\n });\n\n return ajvErrors.reduce>((previous, error) => {\n // `/deepObject/data` -> `deepObject.data`\n const path = error.instancePath.substring(1).replace(/\\//g, '.');\n\n if (!previous[path]) {\n previous[path] = {\n message: error.message,\n type: error.keyword,\n };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[path].types;\n const messages = types && types[error.keyword];\n\n previous[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n previous,\n error.keyword,\n messages\n ? ([] as string[]).concat(messages as string[], error.message || '')\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {});\n};\n\nexport const ajvResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n const ajv = new Ajv(\n Object.assign(\n {},\n {\n allErrors: true,\n validateSchema: true,\n },\n schemaOptions,\n ),\n );\n\n ajvErrors(ajv);\n\n const validate = ajv.compile(\n Object.assign(\n { $async: resolverOptions && resolverOptions.mode === 'async' },\n schema,\n ),\n );\n\n const valid = validate(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return valid\n ? { values, errors: {} }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validate.errors as DefinedError[],\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","ajvErrors","validateAllFieldCriteria","forEach","error","keyword","instancePath","params","missingProperty","reduce","previous","path","substring","replace","message","type","types","messages","appendErrors","concat","ajvResolver","schema","schemaOptions","resolverOptions","async","values","_","options","ajv","Ajv","Object","assign","allErrors","validateSchema","validate","compile","$async","mode","valid","shouldUseNativeValidation","validateFieldsNatively","errors","toNestErrors","criteriaMode"],"mappings":"2KAMA,MAAMA,EAAmBA,CACvBC,EACAC,KAGAD,EAAUE,QAASC,IACK,aAAlBA,EAAMC,UACRD,EAAME,cAAgB,IAAMF,EAAMG,OAAOC,gBAC3C,GAGKP,EAAUQ,OAAmC,CAACC,EAAUN,KAE7D,MAAMO,EAAOP,EAAME,aAAaM,UAAU,GAAGC,QAAQ,MAAO,KAS5D,GAPKH,EAASC,KACZD,EAASC,GAAQ,CACfG,QAASV,EAAMU,QACfC,KAAMX,EAAMC,UAIZH,EAA0B,CAC5B,MAAMc,EAAQN,EAASC,GAAMK,MACvBC,EAAWD,GAASA,EAAMZ,EAAMC,SAEtCK,EAASC,GAAQO,EACfP,EACAT,EACAQ,EACAN,EAAMC,QACNY,EACK,GAAgBE,OAAOF,EAAsBb,EAAMU,SAAW,IAC/DV,EAAMU,QAEd,CAEA,OAAOJ,GACN,KAGQU,EACXA,CAACC,EAAQC,EAAeC,EAAkB,KAC1CC,MAAOC,EAAQC,EAAGC,KAChB,MAAMC,EAAM,IAAIC,EACdC,OAAOC,OACL,CAAE,EACF,CACEC,WAAW,EACXC,gBAAgB,GAElBX,IAIJrB,EAAU2B,GAEV,MAAMM,EAAWN,EAAIO,QACnBL,OAAOC,OACL,CAAEK,OAAQb,GAA4C,UAAzBA,EAAgBc,MAC7ChB,IAIEiB,EAAQJ,EAAST,GAIvB,OAFAE,EAAQY,2BAA6BC,EAAuB,GAAIb,GAEzDW,EACH,CAAEb,SAAQgB,OAAQ,CAAA,GAClB,CACEhB,OAAQ,GACRgB,OAAQC,EACN1C,EACEkC,EAASO,QACRd,EAAQY,2BACkB,QAAzBZ,EAAQgB,cAEZhB"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.module.js b/node_modules/@hookform/resolvers/ajv/dist/ajv.module.js deleted file mode 100644 index ebfda31bc9c17d8836bd962f9c4a3c41714a2068..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import o from"ajv";import a from"ajv-errors";import{appendErrors as s}from"react-hook-form";var t=function(r,e){return r.forEach(function(r){"required"===r.keyword&&(r.instancePath+="/"+r.params.missingProperty)}),r.reduce(function(r,o){var a=o.instancePath.substring(1).replace(/\//g,".");if(r[a]||(r[a]={message:o.message,type:o.keyword}),e){var t=r[a].types,i=t&&t[o.keyword];r[a]=s(a,e,r,o.keyword,i?[].concat(i,o.message||""):o.message)}return r},{})},i=function(s,i,n){return void 0===n&&(n={}),function(c,m,u){try{var l=new o(Object.assign({},{allErrors:!0,validateSchema:!0},i));a(l);var v=l.compile(Object.assign({$async:n&&"async"===n.mode},s)),d=v(c);return u.shouldUseNativeValidation&&r({},u),Promise.resolve(d?{values:c,errors:{}}:{values:{},errors:e(t(v.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)})}catch(r){return Promise.reject(r)}}};export{i as ajvResolver}; -//# sourceMappingURL=ajv.module.js.map diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.module.js.map b/node_modules/@hookform/resolvers/ajv/dist/ajv.module.js.map deleted file mode 100644 index 39af7afe2bf4cc4b7386be5b08198cd449708cc3..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv.module.js","sources":["../src/ajv.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport Ajv, { DefinedError } from 'ajv';\nimport ajvErrors from 'ajv-errors';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n ajvErrors: DefinedError[],\n validateAllFieldCriteria: boolean,\n) => {\n // Ajv will return empty instancePath when require error\n ajvErrors.forEach((error) => {\n if (error.keyword === 'required') {\n error.instancePath += '/' + error.params.missingProperty;\n }\n });\n\n return ajvErrors.reduce>((previous, error) => {\n // `/deepObject/data` -> `deepObject.data`\n const path = error.instancePath.substring(1).replace(/\\//g, '.');\n\n if (!previous[path]) {\n previous[path] = {\n message: error.message,\n type: error.keyword,\n };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[path].types;\n const messages = types && types[error.keyword];\n\n previous[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n previous,\n error.keyword,\n messages\n ? ([] as string[]).concat(messages as string[], error.message || '')\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {});\n};\n\nexport const ajvResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n const ajv = new Ajv(\n Object.assign(\n {},\n {\n allErrors: true,\n validateSchema: true,\n },\n schemaOptions,\n ),\n );\n\n ajvErrors(ajv);\n\n const validate = ajv.compile(\n Object.assign(\n { $async: resolverOptions && resolverOptions.mode === 'async' },\n schema,\n ),\n );\n\n const valid = validate(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return valid\n ? { values, errors: {} }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validate.errors as DefinedError[],\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","ajvErrors","validateAllFieldCriteria","forEach","error","keyword","instancePath","params","missingProperty","reduce","previous","path","substring","replace","message","type","types","messages","appendErrors","concat","ajvResolver","schema","schemaOptions","resolverOptions","values","_","options","ajv","Ajv","Object","assign","allErrors","validateSchema","validate","compile","$async","mode","valid","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","errors","toNestErrors","criteriaMode","e","reject"],"mappings":"2KAMA,IAAMA,EAAmB,SACvBC,EACAC,GASA,OANAD,EAAUE,QAAQ,SAACC,GACK,aAAlBA,EAAMC,UACRD,EAAME,cAAgB,IAAMF,EAAMG,OAAOC,gBAE7C,GAEOP,EAAUQ,OAAmC,SAACC,EAAUN,GAE7D,IAAMO,EAAOP,EAAME,aAAaM,UAAU,GAAGC,QAAQ,MAAO,KAS5D,GAPKH,EAASC,KACZD,EAASC,GAAQ,CACfG,QAASV,EAAMU,QACfC,KAAMX,EAAMC,UAIZH,EAA0B,CAC5B,IAAMc,EAAQN,EAASC,GAAMK,MACvBC,EAAWD,GAASA,EAAMZ,EAAMC,SAEtCK,EAASC,GAAQO,EACfP,EACAT,EACAQ,EACAN,EAAMC,QACNY,EACK,GAAgBE,OAAOF,EAAsBb,EAAMU,SAAW,IAC/DV,EAAMU,QAEd,CAEA,OAAOJ,CACT,EAAG,GACL,EAEaU,EACX,SAACC,EAAQC,EAAeC,GAAoB,gBAApBA,IAAAA,EAAkB,CAAA,GAAE,SACrCC,EAAQC,EAAGC,GAAO,IACvB,IAAMC,EAAM,IAAIC,EACdC,OAAOC,OACL,CAAE,EACF,CACEC,WAAW,EACXC,gBAAgB,GAElBV,IAIJrB,EAAU0B,GAEV,IAAMM,EAAWN,EAAIO,QACnBL,OAAOC,OACL,CAAEK,OAAQZ,GAA4C,UAAzBA,EAAgBa,MAC7Cf,IAIEgB,EAAQJ,EAAST,GAIvB,OAFAE,EAAQY,2BAA6BC,EAAuB,CAAE,EAAEb,GAEhEc,QAAAC,QAAOJ,EACH,CAAEb,OAAAA,EAAQkB,OAAQ,CAAI,GACtB,CACElB,OAAQ,CAAA,EACRkB,OAAQC,EACN3C,EACEiC,EAASS,QACRhB,EAAQY,2BACkB,QAAzBZ,EAAQkB,cAEZlB,IAGV,CAAC,MAAAmB,GAAA,OAAAL,QAAAM,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.umd.js b/node_modules/@hookform/resolvers/ajv/dist/ajv.umd.js deleted file mode 100644 index c91eef6a94301425296a0599bc8da83fd736421f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("ajv"),require("ajv-errors"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","ajv","ajv-errors","react-hook-form"],r):r((e||self).hookformResolversAjv={},e.hookformResolvers,e.ajv,e.ajvErrors,e.ReactHookForm)}(this,function(e,r,o,a,s){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/t(o),n=/*#__PURE__*/t(a),u=function(e,r){return e.forEach(function(e){"required"===e.keyword&&(e.instancePath+="/"+e.params.missingProperty)}),e.reduce(function(e,o){var a=o.instancePath.substring(1).replace(/\//g,".");if(e[a]||(e[a]={message:o.message,type:o.keyword}),r){var t=e[a].types,i=t&&t[o.keyword];e[a]=s.appendErrors(a,r,e,o.keyword,i?[].concat(i,o.message||""):o.message)}return e},{})};e.ajvResolver=function(e,o,a){return void 0===a&&(a={}),function(s,t,f){try{var l=new i.default(Object.assign({},{allErrors:!0,validateSchema:!0},o));n.default(l);var c=l.compile(Object.assign({$async:a&&"async"===a.mode},e)),d=c(s);return f.shouldUseNativeValidation&&r.validateFieldsNatively({},f),Promise.resolve(d?{values:s,errors:{}}:{values:{},errors:r.toNestErrors(u(c.errors,!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)})}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=ajv.umd.js.map diff --git a/node_modules/@hookform/resolvers/ajv/dist/ajv.umd.js.map b/node_modules/@hookform/resolvers/ajv/dist/ajv.umd.js.map deleted file mode 100644 index 0b3d88416d705535ca0b8c91c03f3785027e1f06..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/ajv.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv.umd.js","sources":["../src/ajv.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport Ajv, { DefinedError } from 'ajv';\nimport ajvErrors from 'ajv-errors';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n ajvErrors: DefinedError[],\n validateAllFieldCriteria: boolean,\n) => {\n // Ajv will return empty instancePath when require error\n ajvErrors.forEach((error) => {\n if (error.keyword === 'required') {\n error.instancePath += '/' + error.params.missingProperty;\n }\n });\n\n return ajvErrors.reduce>((previous, error) => {\n // `/deepObject/data` -> `deepObject.data`\n const path = error.instancePath.substring(1).replace(/\\//g, '.');\n\n if (!previous[path]) {\n previous[path] = {\n message: error.message,\n type: error.keyword,\n };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[path].types;\n const messages = types && types[error.keyword];\n\n previous[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n previous,\n error.keyword,\n messages\n ? ([] as string[]).concat(messages as string[], error.message || '')\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {});\n};\n\nexport const ajvResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n const ajv = new Ajv(\n Object.assign(\n {},\n {\n allErrors: true,\n validateSchema: true,\n },\n schemaOptions,\n ),\n );\n\n ajvErrors(ajv);\n\n const validate = ajv.compile(\n Object.assign(\n { $async: resolverOptions && resolverOptions.mode === 'async' },\n schema,\n ),\n );\n\n const valid = validate(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return valid\n ? { values, errors: {} }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validate.errors as DefinedError[],\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","ajvErrors","validateAllFieldCriteria","forEach","error","keyword","instancePath","params","missingProperty","reduce","previous","path","substring","replace","message","type","types","messages","appendErrors","concat","schema","schemaOptions","resolverOptions","values","_","options","ajv","Ajv","Object","assign","allErrors","validateSchema","validate","compile","$async","mode","valid","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","errors","toNestErrors","criteriaMode","e","reject"],"mappings":"0jBAMMA,EAAmB,SACvBC,EACAC,GASA,OANAD,EAAUE,QAAQ,SAACC,GACK,aAAlBA,EAAMC,UACRD,EAAME,cAAgB,IAAMF,EAAMG,OAAOC,gBAE7C,GAEOP,EAAUQ,OAAmC,SAACC,EAAUN,GAE7D,IAAMO,EAAOP,EAAME,aAAaM,UAAU,GAAGC,QAAQ,MAAO,KAS5D,GAPKH,EAASC,KACZD,EAASC,GAAQ,CACfG,QAASV,EAAMU,QACfC,KAAMX,EAAMC,UAIZH,EAA0B,CAC5B,IAAMc,EAAQN,EAASC,GAAMK,MACvBC,EAAWD,GAASA,EAAMZ,EAAMC,SAEtCK,EAASC,GAAQO,eACfP,EACAT,EACAQ,EACAN,EAAMC,QACNY,EACK,GAAgBE,OAAOF,EAAsBb,EAAMU,SAAW,IAC/DV,EAAMU,QAEd,CAEA,OAAOJ,CACT,EAAG,GACL,gBAGE,SAACU,EAAQC,EAAeC,GAAoB,gBAApBA,IAAAA,EAAkB,CAAA,GAAE,SACrCC,EAAQC,EAAGC,GAAO,IACvB,IAAMC,EAAM,IAAIC,UACdC,OAAOC,OACL,CAAE,EACF,CACEC,WAAW,EACXC,gBAAgB,GAElBV,IAIJpB,EAAS,QAACyB,GAEV,IAAMM,EAAWN,EAAIO,QACnBL,OAAOC,OACL,CAAEK,OAAQZ,GAA4C,UAAzBA,EAAgBa,MAC7Cf,IAIEgB,EAAQJ,EAAST,GAIvB,OAFAE,EAAQY,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEb,GAEhEc,QAAAC,QAAOJ,EACH,CAAEb,OAAAA,EAAQkB,OAAQ,CAAI,GACtB,CACElB,OAAQ,CAAA,EACRkB,OAAQC,eACN1C,EACEgC,EAASS,QACRhB,EAAQY,2BACkB,QAAzBZ,EAAQkB,cAEZlB,IAGV,CAAC,MAAAmB,GAAA,OAAAL,QAAAM,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/ajv/dist/index.d.ts b/node_modules/@hookform/resolvers/ajv/dist/index.d.ts deleted file mode 100644 index 5844f91ee3d7a5dfb05ed84e3bdc6356993bb060..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './ajv'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/ajv/dist/types.d.ts b/node_modules/@hookform/resolvers/ajv/dist/types.d.ts deleted file mode 100644 index 04d6af44991007b21ebc86ce44149760e5b01079..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/dist/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as Ajv from 'ajv'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (schema: Ajv.JSONSchemaType, schemaOptions?: Ajv.Options, factoryOptions?: { - mode?: 'async' | 'sync'; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/ajv/package.json b/node_modules/@hookform/resolvers/ajv/package.json deleted file mode 100644 index b6cb5aac74053164d0984a872659927664e5a277..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@hookform/resolvers/ajv", - "amdName": "hookformResolversAjv", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: ajv", - "main": "dist/ajv.js", - "module": "dist/ajv.module.js", - "umd:main": "dist/ajv.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "ajv": "^8.12.0", - "ajv-errors": "^3.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/ajv/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/ajv/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 0de3716d0c82a2ec0ea52bbef73b71a746baffd1..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { JSONSchemaType } from 'ajv'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { ajvResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -type FormData = { username: string; password: string }; - -const schema: JSONSchemaType = { - type: 'object', - properties: { - username: { - type: 'string', - minLength: 1, - errorMessage: { minLength: USERNAME_REQUIRED_MESSAGE }, - }, - password: { - type: 'string', - minLength: 1, - errorMessage: { minLength: PASSWORD_REQUIRED_MESSAGE }, - }, - }, - required: ['username', 'password'], - additionalProperties: false, -}; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: ajvResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Ajv", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/ajv/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/ajv/src/__tests__/Form.tsx deleted file mode 100644 index 5504f6029c8ed0a9329309dc42523e688a7515fd..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/__tests__/Form.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { JSONSchemaType } from 'ajv'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { ajvResolver } from '..'; - -type FormData = { username: string; password: string }; - -const schema: JSONSchemaType = { - type: 'object', - properties: { - username: { - type: 'string', - minLength: 1, - errorMessage: { minLength: 'username field is required' }, - }, - password: { - type: 'string', - minLength: 1, - errorMessage: { minLength: 'password field is required' }, - }, - }, - required: ['username', 'password'], - additionalProperties: false, -}; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: ajvResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Ajv and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/password field is required/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/ajv/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/ajv/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index edcdf77736bbb6138d81b491eed7d97af6bbd062..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { JSONSchemaType } from 'ajv'; -import { Field, InternalFieldName } from 'react-hook-form'; - -interface Data { - username: string; - password: string; - deepObject: { data: string; twoLayersDeep: { name: string } }; -} - -export const schema: JSONSchemaType = { - type: 'object', - properties: { - username: { - type: 'string', - minLength: 3, - }, - password: { - type: 'string', - pattern: '.*[A-Z].*', - errorMessage: { - pattern: 'One uppercase character', - }, - }, - deepObject: { - type: 'object', - properties: { - data: { type: 'string' }, - twoLayersDeep: { - type: 'object', - properties: { name: { type: 'string' } }, - additionalProperties: false, - required: ['name'], - }, - }, - required: ['data', 'twoLayersDeep'], - }, - }, - required: ['username', 'password', 'deepObject'], - additionalProperties: false, -}; - -export const validData: Data = { - username: 'jsun969', - password: 'validPassword', - deepObject: { - twoLayersDeep: { - name: 'deeper', - }, - data: 'data', - }, -}; - -export const invalidData = { - username: '__', - password: 'invalid-password', - deepObject: { - data: 233, - twoLayersDeep: { name: 123 }, - }, -}; - -export const invalidDataWithUndefined = { - username: 'jsun969', - password: undefined, - deepObject: { - twoLayersDeep: { - name: 'deeper', - }, - data: undefined, - }, -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/ajv/src/__tests__/__snapshots__/ajv.ts.snap b/node_modules/@hookform/resolvers/ajv/src/__tests__/__snapshots__/ajv.ts.snap deleted file mode 100644 index d96b1b52999606c88bf9f174ae1548e02be91dc8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/__tests__/__snapshots__/ajv.ts.snap +++ /dev/null @@ -1,245 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`ajvResolver > should return all the error messages from ajvResolver when requirement fails and validateAllFieldCriteria set to true 1`] = ` -{ - "errors": { - "deepObject": { - "message": "must have required property 'deepObject'", - "ref": undefined, - "type": "required", - }, - "password": { - "message": "must have required property 'password'", - "ref": { - "name": "password", - }, - "type": "required", - }, - "username": { - "message": "must have required property 'username'", - "ref": { - "name": "username", - }, - "type": "required", - }, - }, - "values": {}, -} -`; - -exports[`ajvResolver > should return all the error messages from ajvResolver when requirement fails and validateAllFieldCriteria set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "deepObject": { - "message": "must have required property 'deepObject'", - "ref": undefined, - "type": "required", - }, - "password": { - "message": "must have required property 'password'", - "ref": { - "name": "password", - }, - "type": "required", - }, - "username": { - "message": "must have required property 'username'", - "ref": { - "name": "username", - }, - "type": "required", - }, - }, - "values": {}, -} -`; - -exports[`ajvResolver > should return all the error messages from ajvResolver when some property is undefined and result will keep the input data structure 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "must have required property 'data'", - "ref": undefined, - "type": "required", - }, - }, - "password": { - "message": "must have required property 'password'", - "ref": { - "name": "password", - }, - "type": "required", - }, - }, - "values": {}, -} -`; - -exports[`ajvResolver > should return all the error messages from ajvResolver when validation fails and validateAllFieldCriteria set to true 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "must be string", - "ref": undefined, - "type": "type", - "types": { - "type": "must be string", - }, - }, - "twoLayersDeep": { - "name": { - "message": "must be string", - "ref": undefined, - "type": "type", - "types": { - "type": "must be string", - }, - }, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "errorMessage", - "types": { - "errorMessage": "One uppercase character", - }, - }, - "username": { - "message": "must NOT have fewer than 3 characters", - "ref": { - "name": "username", - }, - "type": "minLength", - "types": { - "minLength": "must NOT have fewer than 3 characters", - }, - }, - }, - "values": {}, -} -`; - -exports[`ajvResolver > should return all the error messages from ajvResolver when validation fails and validateAllFieldCriteria set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "must be string", - "ref": undefined, - "type": "type", - "types": { - "type": "must be string", - }, - }, - "twoLayersDeep": { - "name": { - "message": "must be string", - "ref": undefined, - "type": "type", - "types": { - "type": "must be string", - }, - }, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "errorMessage", - "types": { - "errorMessage": "One uppercase character", - }, - }, - "username": { - "message": "must NOT have fewer than 3 characters", - "ref": { - "name": "username", - }, - "type": "minLength", - "types": { - "minLength": "must NOT have fewer than 3 characters", - }, - }, - }, - "values": {}, -} -`; - -exports[`ajvResolver > should return single error message from ajvResolver when validation fails and validateAllFieldCriteria set to false 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "must be string", - "ref": undefined, - "type": "type", - }, - "twoLayersDeep": { - "name": { - "message": "must be string", - "ref": undefined, - "type": "type", - }, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "errorMessage", - }, - "username": { - "message": "must NOT have fewer than 3 characters", - "ref": { - "name": "username", - }, - "type": "minLength", - }, - }, - "values": {}, -} -`; - -exports[`ajvResolver > should return single error message from ajvResolver when validation fails and validateAllFieldCriteria set to false and \`mode: sync\` 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "must be string", - "ref": undefined, - "type": "type", - }, - "twoLayersDeep": { - "name": { - "message": "must be string", - "ref": undefined, - "type": "type", - }, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "errorMessage", - }, - "username": { - "message": "must NOT have fewer than 3 characters", - "ref": { - "name": "username", - }, - "type": "minLength", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/ajv/src/__tests__/ajv.ts b/node_modules/@hookform/resolvers/ajv/src/__tests__/ajv.ts deleted file mode 100644 index 738de9aad667bd301f0908481c24ebf621b17777..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/__tests__/ajv.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { ajvResolver } from '..'; -import { - fields, - invalidData, - invalidDataWithUndefined, - schema, - validData, -} from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('ajvResolver', () => { - it('should return values from ajvResolver when validation pass', async () => { - expect( - await ajvResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }), - ).toEqual({ - values: validData, - errors: {}, - }); - }); - - it('should return values from ajvResolver with `mode: sync` when validation pass', async () => { - expect( - await ajvResolver(schema, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }), - ).toEqual({ - values: validData, - errors: {}, - }); - }); - - it('should return single error message from ajvResolver when validation fails and validateAllFieldCriteria set to false', async () => { - expect( - await ajvResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }), - ).toMatchSnapshot(); - }); - - it('should return single error message from ajvResolver when validation fails and validateAllFieldCriteria set to false and `mode: sync`', async () => { - expect( - await ajvResolver(schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from ajvResolver when validation fails and validateAllFieldCriteria set to true', async () => { - expect( - await ajvResolver(schema)( - invalidData, - {}, - { fields, criteriaMode: 'all', shouldUseNativeValidation }, - ), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from ajvResolver when validation fails and validateAllFieldCriteria set to true and `mode: sync`', async () => { - expect( - await ajvResolver(schema, undefined, { mode: 'sync' })( - invalidData, - {}, - { fields, criteriaMode: 'all', shouldUseNativeValidation }, - ), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from ajvResolver when requirement fails and validateAllFieldCriteria set to true', async () => { - expect( - await ajvResolver(schema)({}, undefined, { - fields, - shouldUseNativeValidation, - }), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from ajvResolver when requirement fails and validateAllFieldCriteria set to true and `mode: sync`', async () => { - expect( - await ajvResolver(schema, undefined, { mode: 'sync' })({}, undefined, { - fields, - shouldUseNativeValidation, - }), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from ajvResolver when some property is undefined and result will keep the input data structure', async () => { - expect( - await ajvResolver(schema, undefined, { mode: 'sync' })( - invalidDataWithUndefined, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ), - ).toMatchSnapshot(); - }); -}); diff --git a/node_modules/@hookform/resolvers/ajv/src/ajv.ts b/node_modules/@hookform/resolvers/ajv/src/ajv.ts deleted file mode 100644 index 19146a13d53ad52fc8b1e4bbe920f062a20d0e37..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/ajv.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import Ajv, { DefinedError } from 'ajv'; -import ajvErrors from 'ajv-errors'; -import { FieldError, appendErrors } from 'react-hook-form'; -import { Resolver } from './types'; - -const parseErrorSchema = ( - ajvErrors: DefinedError[], - validateAllFieldCriteria: boolean, -) => { - // Ajv will return empty instancePath when require error - ajvErrors.forEach((error) => { - if (error.keyword === 'required') { - error.instancePath += '/' + error.params.missingProperty; - } - }); - - return ajvErrors.reduce>((previous, error) => { - // `/deepObject/data` -> `deepObject.data` - const path = error.instancePath.substring(1).replace(/\//g, '.'); - - if (!previous[path]) { - previous[path] = { - message: error.message, - type: error.keyword, - }; - } - - if (validateAllFieldCriteria) { - const types = previous[path].types; - const messages = types && types[error.keyword]; - - previous[path] = appendErrors( - path, - validateAllFieldCriteria, - previous, - error.keyword, - messages - ? ([] as string[]).concat(messages as string[], error.message || '') - : error.message, - ) as FieldError; - } - - return previous; - }, {}); -}; - -export const ajvResolver: Resolver = - (schema, schemaOptions, resolverOptions = {}) => - async (values, _, options) => { - const ajv = new Ajv( - Object.assign( - {}, - { - allErrors: true, - validateSchema: true, - }, - schemaOptions, - ), - ); - - ajvErrors(ajv); - - const validate = ajv.compile( - Object.assign( - { $async: resolverOptions && resolverOptions.mode === 'async' }, - schema, - ), - ); - - const valid = validate(values); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return valid - ? { values, errors: {} } - : { - values: {}, - errors: toNestErrors( - parseErrorSchema( - validate.errors as DefinedError[], - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - }; diff --git a/node_modules/@hookform/resolvers/ajv/src/index.ts b/node_modules/@hookform/resolvers/ajv/src/index.ts deleted file mode 100644 index 5844f91ee3d7a5dfb05ed84e3bdc6356993bb060..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './ajv'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/ajv/src/types.ts b/node_modules/@hookform/resolvers/ajv/src/types.ts deleted file mode 100644 index 2defc4d992f80748db2aa3aac1ed24c21ea66908..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/ajv/src/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as Ajv from 'ajv'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = ( - schema: Ajv.JSONSchemaType, - schemaOptions?: Ajv.Options, - factoryOptions?: { mode?: 'async' | 'sync' }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.d.ts b/node_modules/@hookform/resolvers/arktype/dist/arktype.d.ts deleted file mode 100644 index e44c9e8c19b200b707a8b60066413763e5dcf6f5..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const arktypeResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.js b/node_modules/@hookform/resolvers/arktype/dist/arktype.js deleted file mode 100644 index 0a642199c932d9be37c2aec8d5c93484ce1d4805..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers"),e=require("arktype");exports.arktypeResolver=function(o,t,a){return void 0===a&&(a={}),function(t,s,i){var n,u=o(t);return u instanceof e.ArkErrors?{values:{},errors:r.toNestErrors((n=u,n.forEach(function(r){return Object.assign(r,{type:r.code})}),n.byPath),i)}:(i.shouldUseNativeValidation&&r.validateFieldsNatively({},i),{errors:{},values:a.raw?t:u})}}; -//# sourceMappingURL=arktype.js.map diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.js.map b/node_modules/@hookform/resolvers/arktype/dist/arktype.js.map deleted file mode 100644 index ac9dcfc4ed90732c892015e7e2f582618d53d30a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arktype.js","sources":["../src/arktype.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { ArkErrors } from 'arktype';\nimport { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (e: ArkErrors): Record => {\n // copy code to type to match FieldError shape\n e.forEach((e) => Object.assign(e, { type: e.code }));\n // need to cast here because TS doesn't understand we added the type field\n return e.byPath as never;\n};\n\nexport const arktypeResolver: Resolver =\n (schema, _schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const out = schema(values);\n\n if (out instanceof ArkErrors) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(out), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : out,\n };\n };\n"],"names":["schema","_schemaOptions","resolverOptions","values","_","options","e","out","ArkErrors","errors","toNestErrors","forEach","Object","assign","type","code","byPath","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"kFAaE,SAACA,EAAQC,EAAgBC,GACzB,YADyBA,IAAAA,IAAAA,EAAkB,CAAA,GAC3C,SAACC,EAAQC,EAAGC,GACV,IAVsBC,EAUhBC,EAAMP,EAAOG,GAEnB,OAAII,aAAeC,EAAAA,UACV,CACLL,OAAQ,CAAE,EACVM,OAAQC,EAAYA,cAfFJ,EAeoBC,EAb5CD,EAAEK,QAAQ,SAACL,UAAMM,OAAOC,OAAOP,EAAG,CAAEQ,KAAMR,EAAES,MAAO,GAE5CT,EAAEU,QAWyCX,KAIhDA,EAAQY,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEb,GAEzD,CACLI,OAAQ,CAAiB,EACzBN,OAAQD,EAAgBiB,IAAMhB,EAASI,GAE3C,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.mjs b/node_modules/@hookform/resolvers/arktype/dist/arktype.mjs deleted file mode 100644 index 4eed1954f74e62c0d5d870a6a043643aba777505..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as o}from"@hookform/resolvers";import{ArkErrors as e}from"arktype";var t=function(t,a,n){return void 0===n&&(n={}),function(a,i,s){var u,f=t(a);return f instanceof e?{values:{},errors:r((u=f,u.forEach(function(r){return Object.assign(r,{type:r.code})}),u.byPath),s)}:(s.shouldUseNativeValidation&&o({},s),{errors:{},values:n.raw?a:f})}};export{t as arktypeResolver}; -//# sourceMappingURL=arktype.module.js.map diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.modern.mjs b/node_modules/@hookform/resolvers/arktype/dist/arktype.modern.mjs deleted file mode 100644 index 21af577a51081f1f733914f359eaf5a5363c1c81..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as o}from"@hookform/resolvers";import{ArkErrors as e}from"arktype";const s=(s,t,a={})=>(t,i,n)=>{const c=s(t);return c instanceof e?{values:{},errors:r((f=c,f.forEach(r=>Object.assign(r,{type:r.code})),f.byPath),n)}:(n.shouldUseNativeValidation&&o({},n),{errors:{},values:a.raw?t:c});var f};export{s as arktypeResolver}; -//# sourceMappingURL=arktype.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.modern.mjs.map b/node_modules/@hookform/resolvers/arktype/dist/arktype.modern.mjs.map deleted file mode 100644 index d139d175d6af62b5ff3863a1b28e68b51c6ac889..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arktype.modern.mjs","sources":["../src/arktype.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { ArkErrors } from 'arktype';\nimport { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (e: ArkErrors): Record => {\n // copy code to type to match FieldError shape\n e.forEach((e) => Object.assign(e, { type: e.code }));\n // need to cast here because TS doesn't understand we added the type field\n return e.byPath as never;\n};\n\nexport const arktypeResolver: Resolver =\n (schema, _schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const out = schema(values);\n\n if (out instanceof ArkErrors) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(out), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : out,\n };\n };\n"],"names":["arktypeResolver","schema","_schemaOptions","resolverOptions","values","_","options","out","ArkErrors","errors","toNestErrors","e","forEach","Object","assign","type","code","byPath","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"mHAKA,MAOaA,EACXA,CAACC,EAAQC,EAAgBC,EAAkB,CAAA,IAC3C,CAACC,EAAQC,EAAGC,KACV,MAAMC,EAAMN,EAAOG,GAEnB,OAAIG,aAAeC,EACV,CACLJ,OAAQ,CAAE,EACVK,OAAQC,GAfUC,EAeoBJ,EAb5CI,EAAEC,QAASD,GAAME,OAAOC,OAAOH,EAAG,CAAEI,KAAMJ,EAAEK,QAErCL,EAAEM,QAWyCX,KAIhDA,EAAQY,2BAA6BC,EAAuB,GAAIb,GAEzD,CACLG,OAAQ,CAAA,EACRL,OAAQD,EAAgBiB,IAAMhB,EAASG,IAvBnBI"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.module.js b/node_modules/@hookform/resolvers/arktype/dist/arktype.module.js deleted file mode 100644 index 4eed1954f74e62c0d5d870a6a043643aba777505..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as o}from"@hookform/resolvers";import{ArkErrors as e}from"arktype";var t=function(t,a,n){return void 0===n&&(n={}),function(a,i,s){var u,f=t(a);return f instanceof e?{values:{},errors:r((u=f,u.forEach(function(r){return Object.assign(r,{type:r.code})}),u.byPath),s)}:(s.shouldUseNativeValidation&&o({},s),{errors:{},values:n.raw?a:f})}};export{t as arktypeResolver}; -//# sourceMappingURL=arktype.module.js.map diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.module.js.map b/node_modules/@hookform/resolvers/arktype/dist/arktype.module.js.map deleted file mode 100644 index 2ca1080b2f4aabd102dc552ecb8843fd59816116..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arktype.module.js","sources":["../src/arktype.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { ArkErrors } from 'arktype';\nimport { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (e: ArkErrors): Record => {\n // copy code to type to match FieldError shape\n e.forEach((e) => Object.assign(e, { type: e.code }));\n // need to cast here because TS doesn't understand we added the type field\n return e.byPath as never;\n};\n\nexport const arktypeResolver: Resolver =\n (schema, _schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const out = schema(values);\n\n if (out instanceof ArkErrors) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(out), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : out,\n };\n };\n"],"names":["arktypeResolver","schema","_schemaOptions","resolverOptions","values","_","options","e","out","ArkErrors","errors","toNestErrors","forEach","Object","assign","type","code","byPath","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"mHAKA,IAOaA,EACX,SAACC,EAAQC,EAAgBC,GACzB,YADyBA,IAAAA,IAAAA,EAAkB,CAAA,GAC3C,SAACC,EAAQC,EAAGC,GACV,IAVsBC,EAUhBC,EAAMP,EAAOG,GAEnB,OAAII,aAAeC,EACV,CACLL,OAAQ,CAAE,EACVM,OAAQC,GAfUJ,EAeoBC,EAb5CD,EAAEK,QAAQ,SAACL,UAAMM,OAAOC,OAAOP,EAAG,CAAEQ,KAAMR,EAAES,MAAO,GAE5CT,EAAEU,QAWyCX,KAIhDA,EAAQY,2BAA6BC,EAAuB,CAAE,EAAEb,GAEzD,CACLI,OAAQ,CAAiB,EACzBN,OAAQD,EAAgBiB,IAAMhB,EAASI,GAE3C,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.umd.js b/node_modules/@hookform/resolvers/arktype/dist/arktype.umd.js deleted file mode 100644 index 4732bceffe50b3fcf8aaffc79ef4cafee4911f4d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers"),require("arktype")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","arktype"],o):o((e||self).hookformResolversArktype={},e.hookformResolvers,e.arktype)}(this,function(e,o,r){e.arktypeResolver=function(e,t,s){return void 0===s&&(s={}),function(t,n,i){var f,a=e(t);return a instanceof r.ArkErrors?{values:{},errors:o.toNestErrors((f=a,f.forEach(function(e){return Object.assign(e,{type:e.code})}),f.byPath),i)}:(i.shouldUseNativeValidation&&o.validateFieldsNatively({},i),{errors:{},values:s.raw?t:a})}}}); -//# sourceMappingURL=arktype.umd.js.map diff --git a/node_modules/@hookform/resolvers/arktype/dist/arktype.umd.js.map b/node_modules/@hookform/resolvers/arktype/dist/arktype.umd.js.map deleted file mode 100644 index de60ff741919f5c4aa22d64a51033b706dca4278..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/arktype.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arktype.umd.js","sources":["../src/arktype.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { ArkErrors } from 'arktype';\nimport { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (e: ArkErrors): Record => {\n // copy code to type to match FieldError shape\n e.forEach((e) => Object.assign(e, { type: e.code }));\n // need to cast here because TS doesn't understand we added the type field\n return e.byPath as never;\n};\n\nexport const arktypeResolver: Resolver =\n (schema, _schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const out = schema(values);\n\n if (out instanceof ArkErrors) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(out), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : out,\n };\n };\n"],"names":["schema","_schemaOptions","resolverOptions","values","_","options","e","out","ArkErrors","errors","toNestErrors","forEach","Object","assign","type","code","byPath","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"wXAaE,SAACA,EAAQC,EAAgBC,GACzB,YADyBA,IAAAA,IAAAA,EAAkB,CAAA,GAC3C,SAACC,EAAQC,EAAGC,GACV,IAVsBC,EAUhBC,EAAMP,EAAOG,GAEnB,OAAII,aAAeC,EAAAA,UACV,CACLL,OAAQ,CAAE,EACVM,OAAQC,EAAYA,cAfFJ,EAeoBC,EAb5CD,EAAEK,QAAQ,SAACL,UAAMM,OAAOC,OAAOP,EAAG,CAAEQ,KAAMR,EAAES,MAAO,GAE5CT,EAAEU,QAWyCX,KAIhDA,EAAQY,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEb,GAEzD,CACLI,OAAQ,CAAiB,EACzBN,OAAQD,EAAgBiB,IAAMhB,EAASI,GAE3C,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/arktype/dist/index.d.ts b/node_modules/@hookform/resolvers/arktype/dist/index.d.ts deleted file mode 100644 index e2a73f266376464328ac05ddd64952a96041444d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './arktype'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/arktype/dist/types.d.ts b/node_modules/@hookform/resolvers/arktype/dist/types.d.ts deleted file mode 100644 index efdc54c3b3578dddf4d4f04cc22c960c762b4c4d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/dist/types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Type } from 'arktype'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = >(schema: T, schemaOptions?: undefined, factoryOptions?: { - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => ResolverResult; diff --git a/node_modules/@hookform/resolvers/arktype/package.json b/node_modules/@hookform/resolvers/arktype/package.json deleted file mode 100644 index e7413e06a39a07e3b4ea12a481ffdcef18a2e066..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/arktype", - "amdName": "hookformResolversArktype", - "version": "2.0.0", - "private": true, - "description": "React Hook Form validation resolver: arktype", - "main": "dist/arktype.js", - "module": "dist/arktype.module.js", - "umd:main": "dist/arktype.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "arktype": "2.0.0-dev.14" - } -} diff --git a/node_modules/@hookform/resolvers/arktype/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/arktype/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index c271055a5cb3da5ad7e17878908d37896073ff6f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { type } from 'arktype'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { arktypeResolver } from '..'; - -const schema = type({ - username: 'string>1', - password: 'string>1', -}); - -type FormData = typeof schema.infer; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: arktypeResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Zod", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe( - 'username must be more than length 1', - ); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe( - 'password must be more than length 1', - ); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/arktype/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/arktype/src/__tests__/Form.tsx deleted file mode 100644 index dedc9e1423288ce8db8b2d7dc1af775837c6b308..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/__tests__/Form.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { type } from 'arktype'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { arktypeResolver } from '..'; - -const schema = type({ - username: 'string>1', - password: 'string>1', -}); - -type FormData = typeof schema.infer & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: arktypeResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with arkType and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getByText('username must be more than length 1 (was 0)'), - ).toBeInTheDocument(); - expect( - screen.getByText('password must be more than length 1 (was 0)'), - ).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/arktype/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/arktype/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index a3915787cdec2e5c8aeffc88cf135487634ff601..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { type } from 'arktype'; -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = type({ - username: 'string>2', - password: '/.*[A-Za-z].*/>8|/.*\\d.*/', - repeatPassword: 'string>1', - accessToken: 'string|number', - birthYear: '19001', - 'like?': type({ - id: 'number', - name: 'string>3', - }).array(), - dateStr: 'Date', -}); - -export const validData: typeof schema.infer = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - url: 'https://react-hook-form.com/', - like: [ - { - id: 1, - name: 'name', - }, - ], - dateStr: new Date('2020-01-01'), -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - url: 'abc', -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/arktype/src/__tests__/__snapshots__/arktype.ts.snap b/node_modules/@hookform/resolvers/arktype/src/__tests__/__snapshots__/arktype.ts.snap deleted file mode 100644 index 2ed29acd11c78a17fc6027574775b5b57656bf89..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/__tests__/__snapshots__/arktype.ts.snap +++ /dev/null @@ -1,467 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`arktypeResolver > should return a single error from arktypeResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": ArkError { - "code": "required", - "data": { - "birthYear": "birthYear", - "email": "", - "like": [ - { - "id": "z", - }, - ], - "password": "___", - "url": "abc", - }, - "input": { - "code": "required", - "missingValueDescription": "a number or a string", - "relativePath": [ - "accessToken", - ], - }, - "missingValueDescription": "a number or a string", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "accessToken", - ], - "ref": undefined, - "relativePath": [ - "accessToken", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - "birthYear": ArkError { - "code": "domain", - "data": "birthYear", - "description": "a number", - "domain": "number", - "input": { - "code": "domain", - "description": "a number", - "domain": "number", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "birthYear", - ], - "ref": undefined, - "type": "domain", - Symbol(ArkTypeInternalKind): "error", - }, - "dateStr": ArkError { - "code": "required", - "data": { - "birthYear": "birthYear", - "email": "", - "like": [ - { - "id": "z", - }, - ], - "password": "___", - "url": "abc", - }, - "input": { - "code": "required", - "missingValueDescription": "a Date", - "relativePath": [ - "dateStr", - ], - }, - "missingValueDescription": "a Date", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "dateStr", - ], - "ref": undefined, - "relativePath": [ - "dateStr", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - "email": ArkError { - "code": "pattern", - "data": "", - "description": "a valid email", - "flags": "", - "input": { - "code": "pattern", - "description": "a valid email", - "flags": "", - "rule": "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "email", - ], - "ref": { - "name": "email", - }, - "rule": "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$", - "type": "pattern", - Symbol(ArkTypeInternalKind): "error", - }, - "enabled": ArkError { - "code": "required", - "data": { - "birthYear": "birthYear", - "email": "", - "like": [ - { - "id": "z", - }, - ], - "password": "___", - "url": "abc", - }, - "input": { - "code": "required", - "missingValueDescription": "boolean", - "relativePath": [ - "enabled", - ], - }, - "missingValueDescription": "boolean", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "enabled", - ], - "ref": undefined, - "relativePath": [ - "enabled", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - "like": [ - { - "id": ArkError { - "code": "domain", - "data": "z", - "description": "a number", - "domain": "number", - "input": { - "code": "domain", - "description": "a number", - "domain": "number", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "like", - 0, - "id", - ], - "ref": undefined, - "type": "domain", - Symbol(ArkTypeInternalKind): "error", - }, - "name": ArkError { - "code": "required", - "data": { - "id": "z", - }, - "input": { - "code": "required", - "missingValueDescription": "a string", - "relativePath": [ - "name", - ], - }, - "missingValueDescription": "a string", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "like", - 0, - "name", - ], - "ref": undefined, - "relativePath": [ - "name", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - }, - ], - "password": ArkError { - "code": "union", - "data": "___", - "errors": [ - ArkError { - "code": "pattern", - "data": "___", - "description": "matched by .*[A-Za-z].*", - "input": { - "code": "pattern", - "description": "matched by .*[A-Za-z].*", - "rule": ".*[A-Za-z].*", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "password", - ], - "rule": ".*[A-Za-z].*", - Symbol(ArkTypeInternalKind): "error", - }, - ArkError { - "code": "pattern", - "data": "___", - "description": "matched by .*\\d.*", - "input": { - "code": "pattern", - "description": "matched by .*\\d.*", - "rule": ".*\\d.*", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "password", - ], - "rule": ".*\\d.*", - Symbol(ArkTypeInternalKind): "error", - }, - ], - "input": { - "code": "union", - "errors": [ - ArkError { - "code": "pattern", - "data": "___", - "description": "matched by .*[A-Za-z].*", - "input": { - "code": "pattern", - "description": "matched by .*[A-Za-z].*", - "rule": ".*[A-Za-z].*", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "password", - ], - "rule": ".*[A-Za-z].*", - Symbol(ArkTypeInternalKind): "error", - }, - ArkError { - "code": "pattern", - "data": "___", - "description": "matched by .*\\d.*", - "input": { - "code": "pattern", - "description": "matched by .*\\d.*", - "rule": ".*\\d.*", - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "password", - ], - "rule": ".*\\d.*", - Symbol(ArkTypeInternalKind): "error", - }, - ], - }, - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "password", - ], - "ref": { - "name": "password", - }, - "type": "union", - Symbol(ArkTypeInternalKind): "error", - }, - "repeatPassword": ArkError { - "code": "required", - "data": { - "birthYear": "birthYear", - "email": "", - "like": [ - { - "id": "z", - }, - ], - "password": "___", - "url": "abc", - }, - "input": { - "code": "required", - "missingValueDescription": "a string", - "relativePath": [ - "repeatPassword", - ], - }, - "missingValueDescription": "a string", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "repeatPassword", - ], - "ref": undefined, - "relativePath": [ - "repeatPassword", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - "tags": ArkError { - "code": "required", - "data": { - "birthYear": "birthYear", - "email": "", - "like": [ - { - "id": "z", - }, - ], - "password": "___", - "url": "abc", - }, - "input": { - "code": "required", - "missingValueDescription": "an array", - "relativePath": [ - "tags", - ], - }, - "missingValueDescription": "an array", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "tags", - ], - "ref": undefined, - "relativePath": [ - "tags", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - "username": ArkError { - "code": "required", - "data": { - "birthYear": "birthYear", - "email": "", - "like": [ - { - "id": "z", - }, - ], - "password": "___", - "url": "abc", - }, - "input": { - "code": "required", - "missingValueDescription": "a string", - "relativePath": [ - "username", - ], - }, - "missingValueDescription": "a string", - "nodeConfig": { - "actual": [Function], - "description": [Function], - "expected": [Function], - "message": [Function], - "problem": [Function], - }, - "path": [ - "username", - ], - "ref": { - "name": "username", - }, - "relativePath": [ - "username", - ], - "type": "required", - Symbol(ArkTypeInternalKind): "error", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/arktype/src/__tests__/arktype.ts b/node_modules/@hookform/resolvers/arktype/src/__tests__/arktype.ts deleted file mode 100644 index cb55795120f6bbdc943332d0ee59ccbf615da066..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/__tests__/arktype.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { arktypeResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('arktypeResolver', () => { - it('should return values from arktypeResolver when validation pass & raw=true', async () => { - const result = await arktypeResolver(schema, undefined, { - raw: true, - })(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from arktypeResolver when validation fails', async () => { - const result = await arktypeResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); -}); diff --git a/node_modules/@hookform/resolvers/arktype/src/arktype.ts b/node_modules/@hookform/resolvers/arktype/src/arktype.ts deleted file mode 100644 index 3c5c695248b93199cab8f4dda72e863091e96169..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/arktype.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { ArkErrors } from 'arktype'; -import { FieldError, FieldErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrorSchema = (e: ArkErrors): Record => { - // copy code to type to match FieldError shape - e.forEach((e) => Object.assign(e, { type: e.code })); - // need to cast here because TS doesn't understand we added the type field - return e.byPath as never; -}; - -export const arktypeResolver: Resolver = - (schema, _schemaOptions, resolverOptions = {}) => - (values, _, options) => { - const out = schema(values); - - if (out instanceof ArkErrors) { - return { - values: {}, - errors: toNestErrors(parseErrorSchema(out), options), - }; - } - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - errors: {} as FieldErrors, - values: resolverOptions.raw ? values : out, - }; - }; diff --git a/node_modules/@hookform/resolvers/arktype/src/index.ts b/node_modules/@hookform/resolvers/arktype/src/index.ts deleted file mode 100644 index e2a73f266376464328ac05ddd64952a96041444d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './arktype'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/arktype/src/types.ts b/node_modules/@hookform/resolvers/arktype/src/types.ts deleted file mode 100644 index 97c9d482cff4f0456bf5661ed3e66bf9efbfd364..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/arktype/src/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Type } from 'arktype'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = >( - schema: T, - schemaOptions?: undefined, - factoryOptions?: { - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; - }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => ResolverResult; diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.d.ts b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.d.ts deleted file mode 100644 index 0cd7c5d66cd5f9b373483455731b6e36c93b99fe..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const classValidatorResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.js b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.js deleted file mode 100644 index ac6a7d9c9ca69df6d9f13ce775e74ab8ffb441c1..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers"),e=require("class-transformer"),t=require("class-validator"),a=function r(e,t,a,s){return void 0===a&&(a={}),void 0===s&&(s=""),e.reduce(function(e,a){var i=s?s+"."+a.property:a.property;if(a.constraints){var o=Object.keys(a.constraints)[0];e[i]={type:o,message:a.constraints[o]};var n=e[i];t&&n&&Object.assign(n,{types:a.constraints})}return a.children&&a.children.length&&r(a.children,t,e,i),e},a)};exports.classValidatorResolver=function(s,i,o){return void 0===i&&(i={}),void 0===o&&(o={}),function(n,l,c){try{var v=i.validator,d=e.plainToClass(s,n,i.transformer);return Promise.resolve(("sync"===o.mode?t.validateSync:t.validate)(d,v)).then(function(e){return e.length?{values:{},errors:r.toNestErrors(a(e,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)}:(c.shouldUseNativeValidation&&r.validateFieldsNatively({},c),{values:o.rawValues?n:d,errors:{}})})}catch(r){return Promise.reject(r)}}}; -//# sourceMappingURL=class-validator.js.map diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.js.map b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.js.map deleted file mode 100644 index 2df084e6b8ea6b03531ecd952d8d8980760069ac..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"class-validator.js","sources":["../src/class-validator.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { plainToClass } from 'class-transformer';\nimport { ValidationError, validate, validateSync } from 'class-validator';\nimport { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ValidationError[],\n validateAllFieldCriteria: boolean,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return errors.reduce((acc, error) => {\n const _path = path ? `${path}.${error.property}` : error.property;\n\n if (error.constraints) {\n const key = Object.keys(error.constraints)[0];\n acc[_path] = {\n type: key,\n message: error.constraints[key],\n };\n\n const _e = acc[_path];\n if (validateAllFieldCriteria && _e) {\n Object.assign(_e, { types: error.constraints });\n }\n }\n\n if (error.children && error.children.length) {\n parseErrors(error.children, validateAllFieldCriteria, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const classValidatorResolver: Resolver =\n (schema, schemaOptions = {}, resolverOptions = {}) =>\n async (values, _, options) => {\n const { transformer, validator } = schemaOptions;\n const data = plainToClass(schema, values, transformer);\n\n const rawErrors = await (resolverOptions.mode === 'sync'\n ? validateSync\n : validate)(data, validator);\n\n if (rawErrors.length) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrors(\n rawErrors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.rawValues ? values : data,\n errors: {},\n };\n };\n"],"names":["parseErrors","errors","validateAllFieldCriteria","parsedErrors","path","reduce","acc","error","_path","property","constraints","key","Object","keys","type","message","_e","assign","types","children","length","schema","schemaOptions","resolverOptions","values","_","options","validator","data","plainToClass","transformer","Promise","resolve","mode","validateSync","validate","then","rawErrors","toNestErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","rawValues","e","reject"],"mappings":"iGAMMA,EAAc,SAAdA,EACJC,EACAC,EACAC,EACAC,GAEA,gBAHAD,IAAAA,EAA4B,CAAE,QAC1B,IAAJC,IAAAA,EAAO,IAEAH,EAAOI,OAAO,SAACC,EAAKC,GACzB,IAAMC,EAAQJ,EAAUA,EAAQG,IAAAA,EAAME,SAAaF,EAAME,SAEzD,GAAIF,EAAMG,YAAa,CACrB,IAAMC,EAAMC,OAAOC,KAAKN,EAAMG,aAAa,GAC3CJ,EAAIE,GAAS,CACXM,KAAMH,EACNI,QAASR,EAAMG,YAAYC,IAG7B,IAAMK,EAAKV,EAAIE,GACXN,GAA4Bc,GAC9BJ,OAAOK,OAAOD,EAAI,CAAEE,MAAOX,EAAMG,aAErC,CAMA,OAJIH,EAAMY,UAAYZ,EAAMY,SAASC,QACnCpB,EAAYO,EAAMY,SAAUjB,EAA0BI,EAAKE,GAGtDF,CACT,EAAGH,EACL,iCAGE,SAACkB,EAAQC,EAAoBC,GAAoB,YAAxCD,IAAAA,IAAAA,EAAgB,SAAmB,IAAfC,IAAAA,EAAkB,IAAE,SAC1CC,EAAQC,EAAGC,GAAO,IACvB,IAAqBC,EAAcL,EAAdK,UACfC,EAAOC,eAAaR,EAAQG,EADCF,EAA3BQ,aAC+C,OAAAC,QAAAC,SAEL,SAAzBT,EAAgBU,KACrCC,EAAAA,aACAC,EAAQA,UAAEP,EAAMD,IAAUS,KAFxBC,SAAAA,GAIN,OAAIA,EAAUjB,OACL,CACLI,OAAQ,GACRvB,OAAQqC,EAAAA,aACNtC,EACEqC,GACCX,EAAQa,2BACkB,QAAzBb,EAAQc,cAEZd,KAKNA,EAAQa,2BAA6BE,yBAAuB,CAAA,EAAIf,GAEzD,CACLF,OAAQD,EAAgBmB,UAAYlB,EAASI,EAC7C3B,OAAQ,CAAA,GACR,EACJ,CAAC,MAAA0C,GAAA,OAAAZ,QAAAa,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.mjs b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.mjs deleted file mode 100644 index 5f31f3d7c8af2d633966a5ff6e48de24737e5777..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import{plainToClass as t}from"class-transformer";import{validateSync as o,validate as n}from"class-validator";var s=function r(e,t,o,n){return void 0===o&&(o={}),void 0===n&&(n=""),e.reduce(function(e,o){var s=n?n+"."+o.property:o.property;if(o.constraints){var i=Object.keys(o.constraints)[0];e[s]={type:i,message:o.constraints[i]};var a=e[s];t&&a&&Object.assign(a,{types:o.constraints})}return o.children&&o.children.length&&r(o.children,t,e,s),e},o)},i=function(i,a,c){return void 0===a&&(a={}),void 0===c&&(c={}),function(l,u,v){try{var d=a.validator,m=t(i,l,a.transformer);return Promise.resolve(("sync"===c.mode?o:n)(m,d)).then(function(t){return t.length?{values:{},errors:r(s(t,!v.shouldUseNativeValidation&&"all"===v.criteriaMode),v)}:(v.shouldUseNativeValidation&&e({},v),{values:c.rawValues?l:m,errors:{}})})}catch(r){return Promise.reject(r)}}};export{i as classValidatorResolver}; -//# sourceMappingURL=class-validator.module.js.map diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.modern.mjs b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.modern.mjs deleted file mode 100644 index c0ae73dd52ac433da69187480fa82744956f2640..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as s}from"@hookform/resolvers";import{plainToClass as t}from"class-transformer";import{validateSync as e,validate as o}from"class-validator";const a=(r,s,t={},e="")=>r.reduce((r,t)=>{const o=e?`${e}.${t.property}`:t.property;if(t.constraints){const e=Object.keys(t.constraints)[0];r[o]={type:e,message:t.constraints[e]};const a=r[o];s&&a&&Object.assign(a,{types:t.constraints})}return t.children&&t.children.length&&a(t.children,s,r,o),r},t),n=(n,i={},c={})=>async(l,d,m)=>{const{transformer:p,validator:h}=i,u=t(n,l,p),f=await("sync"===c.mode?e:o)(u,h);return f.length?{values:{},errors:r(a(f,!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)}:(m.shouldUseNativeValidation&&s({},m),{values:c.rawValues?l:u,errors:{}})};export{n as classValidatorResolver}; -//# sourceMappingURL=class-validator.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.modern.mjs.map b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.modern.mjs.map deleted file mode 100644 index 23daaf66c17dbcb05f2161ec17748d9689996fc7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"class-validator.modern.mjs","sources":["../src/class-validator.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { plainToClass } from 'class-transformer';\nimport { ValidationError, validate, validateSync } from 'class-validator';\nimport { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ValidationError[],\n validateAllFieldCriteria: boolean,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return errors.reduce((acc, error) => {\n const _path = path ? `${path}.${error.property}` : error.property;\n\n if (error.constraints) {\n const key = Object.keys(error.constraints)[0];\n acc[_path] = {\n type: key,\n message: error.constraints[key],\n };\n\n const _e = acc[_path];\n if (validateAllFieldCriteria && _e) {\n Object.assign(_e, { types: error.constraints });\n }\n }\n\n if (error.children && error.children.length) {\n parseErrors(error.children, validateAllFieldCriteria, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const classValidatorResolver: Resolver =\n (schema, schemaOptions = {}, resolverOptions = {}) =>\n async (values, _, options) => {\n const { transformer, validator } = schemaOptions;\n const data = plainToClass(schema, values, transformer);\n\n const rawErrors = await (resolverOptions.mode === 'sync'\n ? validateSync\n : validate)(data, validator);\n\n if (rawErrors.length) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrors(\n rawErrors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.rawValues ? values : data,\n errors: {},\n };\n };\n"],"names":["parseErrors","errors","validateAllFieldCriteria","parsedErrors","path","reduce","acc","error","_path","property","constraints","key","Object","keys","type","message","_e","assign","types","children","length","classValidatorResolver","schema","schemaOptions","resolverOptions","async","values","_","options","transformer","validator","data","plainToClass","rawErrors","mode","validateSync","validate","toNestErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","rawValues"],"mappings":"6LAMA,MAAMA,EAAcA,CAClBC,EACAC,EACAC,EAA4B,CAAA,EAC5BC,EAAO,KAEAH,EAAOI,OAAO,CAACC,EAAKC,KACzB,MAAMC,EAAQJ,EAAO,GAAGA,KAAQG,EAAME,WAAaF,EAAME,SAEzD,GAAIF,EAAMG,YAAa,CACrB,MAAMC,EAAMC,OAAOC,KAAKN,EAAMG,aAAa,GAC3CJ,EAAIE,GAAS,CACXM,KAAMH,EACNI,QAASR,EAAMG,YAAYC,IAG7B,MAAMK,EAAKV,EAAIE,GACXN,GAA4Bc,GAC9BJ,OAAOK,OAAOD,EAAI,CAAEE,MAAOX,EAAMG,aAErC,CAMA,OAJIH,EAAMY,UAAYZ,EAAMY,SAASC,QACnCpB,EAAYO,EAAMY,SAAUjB,EAA0BI,EAAKE,GAGtDF,GACNH,GAGQkB,EACXA,CAACC,EAAQC,EAAgB,CAAA,EAAIC,EAAkB,CAAE,IACjDC,MAAOC,EAAQC,EAAGC,KAChB,MAAMC,YAAEA,EAAWC,UAAEA,GAAcP,EAC7BQ,EAAOC,EAAaV,EAAQI,EAAQG,GAEpCI,QAA4C,SAAzBT,EAAgBU,KACrCC,EACAC,GAAUL,EAAMD,GAEpB,OAAIG,EAAUb,OACL,CACLM,OAAQ,CAAE,EACVzB,OAAQoC,EACNrC,EACEiC,GACCL,EAAQU,2BACkB,QAAzBV,EAAQW,cAEZX,KAKNA,EAAQU,2BAA6BE,EAAuB,CAAA,EAAIZ,GAEzD,CACLF,OAAQF,EAAgBiB,UAAYf,EAASK,EAC7C9B,OAAQ"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.module.js b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.module.js deleted file mode 100644 index 5f31f3d7c8af2d633966a5ff6e48de24737e5777..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import{plainToClass as t}from"class-transformer";import{validateSync as o,validate as n}from"class-validator";var s=function r(e,t,o,n){return void 0===o&&(o={}),void 0===n&&(n=""),e.reduce(function(e,o){var s=n?n+"."+o.property:o.property;if(o.constraints){var i=Object.keys(o.constraints)[0];e[s]={type:i,message:o.constraints[i]};var a=e[s];t&&a&&Object.assign(a,{types:o.constraints})}return o.children&&o.children.length&&r(o.children,t,e,s),e},o)},i=function(i,a,c){return void 0===a&&(a={}),void 0===c&&(c={}),function(l,u,v){try{var d=a.validator,m=t(i,l,a.transformer);return Promise.resolve(("sync"===c.mode?o:n)(m,d)).then(function(t){return t.length?{values:{},errors:r(s(t,!v.shouldUseNativeValidation&&"all"===v.criteriaMode),v)}:(v.shouldUseNativeValidation&&e({},v),{values:c.rawValues?l:m,errors:{}})})}catch(r){return Promise.reject(r)}}};export{i as classValidatorResolver}; -//# sourceMappingURL=class-validator.module.js.map diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.module.js.map b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.module.js.map deleted file mode 100644 index 7ff8c0821d6026df62a249f34b8363f1fe57fd2a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"class-validator.module.js","sources":["../src/class-validator.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { plainToClass } from 'class-transformer';\nimport { ValidationError, validate, validateSync } from 'class-validator';\nimport { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ValidationError[],\n validateAllFieldCriteria: boolean,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return errors.reduce((acc, error) => {\n const _path = path ? `${path}.${error.property}` : error.property;\n\n if (error.constraints) {\n const key = Object.keys(error.constraints)[0];\n acc[_path] = {\n type: key,\n message: error.constraints[key],\n };\n\n const _e = acc[_path];\n if (validateAllFieldCriteria && _e) {\n Object.assign(_e, { types: error.constraints });\n }\n }\n\n if (error.children && error.children.length) {\n parseErrors(error.children, validateAllFieldCriteria, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const classValidatorResolver: Resolver =\n (schema, schemaOptions = {}, resolverOptions = {}) =>\n async (values, _, options) => {\n const { transformer, validator } = schemaOptions;\n const data = plainToClass(schema, values, transformer);\n\n const rawErrors = await (resolverOptions.mode === 'sync'\n ? validateSync\n : validate)(data, validator);\n\n if (rawErrors.length) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrors(\n rawErrors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.rawValues ? values : data,\n errors: {},\n };\n };\n"],"names":["parseErrors","errors","validateAllFieldCriteria","parsedErrors","path","reduce","acc","error","_path","property","constraints","key","Object","keys","type","message","_e","assign","types","children","length","classValidatorResolver","schema","schemaOptions","resolverOptions","values","_","options","validator","data","plainToClass","transformer","Promise","resolve","mode","validateSync","validate","then","rawErrors","toNestErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","rawValues","e","reject"],"mappings":"6LAMA,IAAMA,EAAc,SAAdA,EACJC,EACAC,EACAC,EACAC,GAEA,gBAHAD,IAAAA,EAA4B,CAAE,QAC1B,IAAJC,IAAAA,EAAO,IAEAH,EAAOI,OAAO,SAACC,EAAKC,GACzB,IAAMC,EAAQJ,EAAUA,EAAQG,IAAAA,EAAME,SAAaF,EAAME,SAEzD,GAAIF,EAAMG,YAAa,CACrB,IAAMC,EAAMC,OAAOC,KAAKN,EAAMG,aAAa,GAC3CJ,EAAIE,GAAS,CACXM,KAAMH,EACNI,QAASR,EAAMG,YAAYC,IAG7B,IAAMK,EAAKV,EAAIE,GACXN,GAA4Bc,GAC9BJ,OAAOK,OAAOD,EAAI,CAAEE,MAAOX,EAAMG,aAErC,CAMA,OAJIH,EAAMY,UAAYZ,EAAMY,SAASC,QACnCpB,EAAYO,EAAMY,SAAUjB,EAA0BI,EAAKE,GAGtDF,CACT,EAAGH,EACL,EAEakB,EACX,SAACC,EAAQC,EAAoBC,GAAoB,YAAxCD,IAAAA,IAAAA,EAAgB,SAAmB,IAAfC,IAAAA,EAAkB,IAAE,SAC1CC,EAAQC,EAAGC,GAAO,IACvB,IAAqBC,EAAcL,EAAdK,UACfC,EAAOC,EAAaR,EAAQG,EADCF,EAA3BQ,aAC+C,OAAAC,QAAAC,SAEL,SAAzBT,EAAgBU,KACrCC,EACAC,GAAUP,EAAMD,IAAUS,KAFxBC,SAAAA,GAIN,OAAIA,EAAUlB,OACL,CACLK,OAAQ,GACRxB,OAAQsC,EACNvC,EACEsC,GACCX,EAAQa,2BACkB,QAAzBb,EAAQc,cAEZd,KAKNA,EAAQa,2BAA6BE,EAAuB,CAAA,EAAIf,GAEzD,CACLF,OAAQD,EAAgBmB,UAAYlB,EAASI,EAC7C5B,OAAQ,CAAA,GACR,EACJ,CAAC,MAAA2C,GAAA,OAAAZ,QAAAa,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.umd.js b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.umd.js deleted file mode 100644 index 4079bdf0cc8fee73501d43c9581c1929f9d0b8e7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("class-transformer"),require("class-validator")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","class-transformer","class-validator"],r):r((e||self).hookformResolversClassValidator={},e.hookformResolvers,e.classTransformer,e.classValidator)}(this,function(e,r,o,s){var t=function e(r,o,s,t){return void 0===s&&(s={}),void 0===t&&(t=""),r.reduce(function(r,s){var a=t?t+"."+s.property:s.property;if(s.constraints){var i=Object.keys(s.constraints)[0];r[a]={type:i,message:s.constraints[i]};var n=r[a];o&&n&&Object.assign(n,{types:s.constraints})}return s.children&&s.children.length&&e(s.children,o,r,a),r},s)};e.classValidatorResolver=function(e,a,i){return void 0===a&&(a={}),void 0===i&&(i={}),function(n,l,d){try{var c=a.validator,f=o.plainToClass(e,n,a.transformer);return Promise.resolve(("sync"===i.mode?s.validateSync:s.validate)(f,c)).then(function(e){return e.length?{values:{},errors:r.toNestErrors(t(e,!d.shouldUseNativeValidation&&"all"===d.criteriaMode),d)}:(d.shouldUseNativeValidation&&r.validateFieldsNatively({},d),{values:i.rawValues?n:f,errors:{}})})}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=class-validator.umd.js.map diff --git a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.umd.js.map b/node_modules/@hookform/resolvers/class-validator/dist/class-validator.umd.js.map deleted file mode 100644 index c1fb33523c50fcfd24a154f1213ca94d62427766..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/class-validator.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"class-validator.umd.js","sources":["../src/class-validator.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { plainToClass } from 'class-transformer';\nimport { ValidationError, validate, validateSync } from 'class-validator';\nimport { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ValidationError[],\n validateAllFieldCriteria: boolean,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return errors.reduce((acc, error) => {\n const _path = path ? `${path}.${error.property}` : error.property;\n\n if (error.constraints) {\n const key = Object.keys(error.constraints)[0];\n acc[_path] = {\n type: key,\n message: error.constraints[key],\n };\n\n const _e = acc[_path];\n if (validateAllFieldCriteria && _e) {\n Object.assign(_e, { types: error.constraints });\n }\n }\n\n if (error.children && error.children.length) {\n parseErrors(error.children, validateAllFieldCriteria, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const classValidatorResolver: Resolver =\n (schema, schemaOptions = {}, resolverOptions = {}) =>\n async (values, _, options) => {\n const { transformer, validator } = schemaOptions;\n const data = plainToClass(schema, values, transformer);\n\n const rawErrors = await (resolverOptions.mode === 'sync'\n ? validateSync\n : validate)(data, validator);\n\n if (rawErrors.length) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrors(\n rawErrors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.rawValues ? values : data,\n errors: {},\n };\n };\n"],"names":["parseErrors","errors","validateAllFieldCriteria","parsedErrors","path","reduce","acc","error","_path","property","constraints","key","Object","keys","type","message","_e","assign","types","children","length","schema","schemaOptions","resolverOptions","values","_","options","validator","data","plainToClass","transformer","Promise","resolve","mode","validateSync","validate","then","rawErrors","toNestErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","rawValues","e","reject"],"mappings":"0cAMA,IAAMA,EAAc,SAAdA,EACJC,EACAC,EACAC,EACAC,GAEA,gBAHAD,IAAAA,EAA4B,CAAE,QAC1B,IAAJC,IAAAA,EAAO,IAEAH,EAAOI,OAAO,SAACC,EAAKC,GACzB,IAAMC,EAAQJ,EAAUA,EAAQG,IAAAA,EAAME,SAAaF,EAAME,SAEzD,GAAIF,EAAMG,YAAa,CACrB,IAAMC,EAAMC,OAAOC,KAAKN,EAAMG,aAAa,GAC3CJ,EAAIE,GAAS,CACXM,KAAMH,EACNI,QAASR,EAAMG,YAAYC,IAG7B,IAAMK,EAAKV,EAAIE,GACXN,GAA4Bc,GAC9BJ,OAAOK,OAAOD,EAAI,CAAEE,MAAOX,EAAMG,aAErC,CAMA,OAJIH,EAAMY,UAAYZ,EAAMY,SAASC,QACnCpB,EAAYO,EAAMY,SAAUjB,EAA0BI,EAAKE,GAGtDF,CACT,EAAGH,EACL,2BAGE,SAACkB,EAAQC,EAAoBC,GAAoB,YAAxCD,IAAAA,IAAAA,EAAgB,SAAmB,IAAfC,IAAAA,EAAkB,IAAE,SAC1CC,EAAQC,EAAGC,GAAO,IACvB,IAAqBC,EAAcL,EAAdK,UACfC,EAAOC,eAAaR,EAAQG,EADCF,EAA3BQ,aAC+C,OAAAC,QAAAC,SAEL,SAAzBT,EAAgBU,KACrCC,EAAAA,aACAC,EAAQA,UAAEP,EAAMD,IAAUS,KAFxBC,SAAAA,GAIN,OAAIA,EAAUjB,OACL,CACLI,OAAQ,GACRvB,OAAQqC,EAAAA,aACNtC,EACEqC,GACCX,EAAQa,2BACkB,QAAzBb,EAAQc,cAEZd,KAKNA,EAAQa,2BAA6BE,yBAAuB,CAAA,EAAIf,GAEzD,CACLF,OAAQD,EAAgBmB,UAAYlB,EAASI,EAC7C3B,OAAQ,CAAA,GACR,EACJ,CAAC,MAAA0C,GAAA,OAAAZ,QAAAa,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/class-validator/dist/index.d.ts b/node_modules/@hookform/resolvers/class-validator/dist/index.d.ts deleted file mode 100644 index 53803f5276df1ac8f1e52a63f2b3357f3b3cc92b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './class-validator'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/class-validator/dist/types.d.ts b/node_modules/@hookform/resolvers/class-validator/dist/types.d.ts deleted file mode 100644 index 8dd29203933e58cb427b1b0d7b370cbcf86b0d3d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/dist/types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ClassConstructor, ClassTransformOptions } from 'class-transformer'; -import { ValidatorOptions } from 'class-validator'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (schema: ClassConstructor, schemaOptions?: { - validator?: ValidatorOptions; - transformer?: ClassTransformOptions; -}, resolverOptions?: { - mode?: 'async' | 'sync'; - rawValues?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/class-validator/package.json b/node_modules/@hookform/resolvers/class-validator/package.json deleted file mode 100644 index 1b6aef34f425d017b7092989c35f9a792ce5090f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@hookform/resolvers/class-validator", - "amdName": "hookformResolversClassValidator", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: class-validator", - "main": "dist/class-validator.js", - "module": "dist/class-validator.module.js", - "umd:main": "dist/class-validator.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": ">=6.6.0", - "@hookform/resolvers": ">=2.0.0", - "class-transformer": "^0.4.0", - "class-validator": "^0.12.0" - } -} diff --git a/node_modules/@hookform/resolvers/class-validator/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/class-validator/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index ba2945a1ae0b298cd8a5238178428732bc68fd45..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { IsNotEmpty } from 'class-validator'; -import React from 'react'; -import { SubmitHandler, useForm } from 'react-hook-form'; -import { classValidatorResolver } from '..'; - -class Schema { - @IsNotEmpty() - username: string; - - @IsNotEmpty() - password: string; -} - -interface Props { - onSubmit: SubmitHandler; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: classValidatorResolver(Schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Class Validator", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe('username should not be empty'); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe('password should not be empty'); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/class-validator/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/class-validator/src/__tests__/Form.tsx deleted file mode 100644 index 52984f67a4cd5ef3f590ea699a12dfe438c8b82e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/__tests__/Form.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { IsNotEmpty } from 'class-validator'; -import React from 'react'; -import { SubmitHandler, useForm } from 'react-hook-form'; -import { classValidatorResolver } from '..'; - -class Schema { - @IsNotEmpty() - username: string; - - @IsNotEmpty() - password: string; -} - -interface Props { - onSubmit: SubmitHandler; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: classValidatorResolver(Schema), - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Class Validator and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username should not be empty/i)).toBeInTheDocument(); - expect(screen.getByText(/password should not be empty/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/class-validator/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/class-validator/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 90d1dbbed5481753cd11a762965c28b632f1b021..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,88 +0,0 @@ -import 'reflect-metadata'; -import { Type } from 'class-transformer'; -import { - IsEmail, - IsNotEmpty, - Length, - Matches, - Max, - Min, - ValidateNested, -} from 'class-validator'; -import { Field, InternalFieldName } from 'react-hook-form'; - -class Like { - @IsNotEmpty() - id: number; - - @Length(4) - name: string; -} - -export class Schema { - @Matches(/^\w+$/) - @Length(3, 30) - username: string; - - @Matches(/^[a-zA-Z0-9]{3,30}/) - password: string; - - @Min(1900) - @Max(2013) - birthYear: number; - - @IsEmail() - email: string; - - accessToken: string; - - tags: string[]; - - enabled: boolean; - - @ValidateNested({ each: true }) - @Type(() => Like) - like: Like[]; -} - -export const validData: Schema = { - username: 'Doe', - password: 'Password123', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: [ - { - id: 1, - name: 'name', - }, - ], -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/class-validator/src/__tests__/__snapshots__/class-validator.ts.snap b/node_modules/@hookform/resolvers/class-validator/src/__tests__/__snapshots__/class-validator.ts.snap deleted file mode 100644 index 0a61fa9664ee0944924c78a2ffeda0445ead5129..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/__tests__/__snapshots__/class-validator.ts.snap +++ /dev/null @@ -1,242 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`classValidatorResolver > should return a single error from classValidatorResolver when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must not be greater than 2013", - "ref": undefined, - "type": "max", - }, - "email": { - "message": "email must be an email", - "ref": { - "name": "email", - }, - "type": "isEmail", - }, - "like": [ - { - "name": { - "message": "name must be longer than or equal to 4 characters", - "ref": undefined, - "type": "isLength", - }, - }, - ], - "password": { - "message": "password must match /^[a-zA-Z0-9]{3,30}/ regular expression", - "ref": { - "name": "password", - }, - "type": "matches", - }, - "username": { - "message": "username must be longer than or equal to 3 characters", - "ref": { - "name": "username", - }, - "type": "isLength", - }, - }, - "values": {}, -} -`; - -exports[`classValidatorResolver > should return a single error from classValidatorResolver with \`mode: sync\` when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must not be greater than 2013", - "ref": undefined, - "type": "max", - }, - "email": { - "message": "email must be an email", - "ref": { - "name": "email", - }, - "type": "isEmail", - }, - "like": [ - { - "name": { - "message": "name must be longer than or equal to 4 characters", - "ref": undefined, - "type": "isLength", - }, - }, - ], - "password": { - "message": "password must match /^[a-zA-Z0-9]{3,30}/ regular expression", - "ref": { - "name": "password", - }, - "type": "matches", - }, - "username": { - "message": "username must be longer than or equal to 3 characters", - "ref": { - "name": "username", - }, - "type": "isLength", - }, - }, - "values": {}, -} -`; - -exports[`classValidatorResolver > should return all the errors from classValidatorResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must not be greater than 2013", - "ref": undefined, - "type": "max", - "types": { - "max": "birthYear must not be greater than 2013", - "min": "birthYear must not be less than 1900", - }, - }, - "email": { - "message": "email must be an email", - "ref": { - "name": "email", - }, - "type": "isEmail", - "types": { - "isEmail": "email must be an email", - }, - }, - "like": [ - { - "name": { - "message": "name must be longer than or equal to 4 characters", - "ref": undefined, - "type": "isLength", - "types": { - "isLength": "name must be longer than or equal to 4 characters", - }, - }, - }, - ], - "password": { - "message": "password must match /^[a-zA-Z0-9]{3,30}/ regular expression", - "ref": { - "name": "password", - }, - "type": "matches", - "types": { - "matches": "password must match /^[a-zA-Z0-9]{3,30}/ regular expression", - }, - }, - "username": { - "message": "username must be longer than or equal to 3 characters", - "ref": { - "name": "username", - }, - "type": "isLength", - "types": { - "isLength": "username must be longer than or equal to 3 characters", - "matches": "username must match /^\\w+$/ regular expression", - }, - }, - }, - "values": {}, -} -`; - -exports[`classValidatorResolver > should return all the errors from classValidatorResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must not be greater than 2013", - "ref": undefined, - "type": "max", - "types": { - "max": "birthYear must not be greater than 2013", - "min": "birthYear must not be less than 1900", - }, - }, - "email": { - "message": "email must be an email", - "ref": { - "name": "email", - }, - "type": "isEmail", - "types": { - "isEmail": "email must be an email", - }, - }, - "like": [ - { - "name": { - "message": "name must be longer than or equal to 4 characters", - "ref": undefined, - "type": "isLength", - "types": { - "isLength": "name must be longer than or equal to 4 characters", - }, - }, - }, - ], - "password": { - "message": "password must match /^[a-zA-Z0-9]{3,30}/ regular expression", - "ref": { - "name": "password", - }, - "type": "matches", - "types": { - "matches": "password must match /^[a-zA-Z0-9]{3,30}/ regular expression", - }, - }, - "username": { - "message": "username must be longer than or equal to 3 characters", - "ref": { - "name": "username", - }, - "type": "isLength", - "types": { - "isLength": "username must be longer than or equal to 3 characters", - "matches": "username must match /^\\w+$/ regular expression", - }, - }, - }, - "values": {}, -} -`; - -exports[`validate data with transformer option 1`] = ` -{ - "errors": { - "random": { - "message": "All fields must be defined.", - "ref": undefined, - "type": "isDefined", - "types": { - "isDefined": "All fields must be defined.", - "isNumber": "Must be a number", - "max": "Cannot be greater than 255", - "min": "Cannot be lower than 0", - }, - }, - }, - "values": {}, -} -`; - -exports[`validate data with validator option 1`] = ` -{ - "errors": { - "random": { - "message": "All fields must be defined.", - "ref": undefined, - "type": "isDefined", - "types": { - "isDefined": "All fields must be defined.", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/class-validator/src/__tests__/class-validator.ts b/node_modules/@hookform/resolvers/class-validator/src/__tests__/class-validator.ts deleted file mode 100644 index efbde492794db02838d047360bbc055abeac4d54..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/__tests__/class-validator.ts +++ /dev/null @@ -1,188 +0,0 @@ -import { Expose, Type } from 'class-transformer'; -import * as classValidator from 'class-validator'; -import { IsDefined, IsNumber, Max, Min } from 'class-validator'; -/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */ -import { classValidatorResolver } from '..'; -import { Schema, fields, invalidData, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('classValidatorResolver', () => { - it('should return values from classValidatorResolver when validation pass', async () => { - const schemaSpy = vi.spyOn(classValidator, 'validate'); - const schemaSyncSpy = vi.spyOn(classValidator, 'validateSync'); - - const result = await classValidatorResolver(Schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(schemaSyncSpy).not.toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: validData }); - expect(result.values).toBeInstanceOf(Schema); - }); - - it('should return values as a raw object from classValidatorResolver when `rawValues` set to true', async () => { - const result = await classValidatorResolver(Schema, undefined, { - rawValues: true, - })(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - expect(result.values).not.toBeInstanceOf(Schema); - }); - - it('should return values from classValidatorResolver with `mode: sync` when validation pass', async () => { - const validateSyncSpy = vi.spyOn(classValidator, 'validateSync'); - const validateSpy = vi.spyOn(classValidator, 'validate'); - - const result = await classValidatorResolver(Schema, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }); - - expect(validateSyncSpy).toHaveBeenCalledTimes(1); - expect(validateSpy).not.toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: validData }); - expect(result.values).toBeInstanceOf(Schema); - }); - - it('should return a single error from classValidatorResolver when validation fails', async () => { - const result = await classValidatorResolver(Schema)( - invalidData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from classValidatorResolver with `mode: sync` when validation fails', async () => { - const validateSyncSpy = vi.spyOn(classValidator, 'validateSync'); - const validateSpy = vi.spyOn(classValidator, 'validate'); - - const result = await classValidatorResolver(Schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }); - - expect(validateSyncSpy).toHaveBeenCalledTimes(1); - expect(validateSpy).not.toHaveBeenCalled(); - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from classValidatorResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await classValidatorResolver(Schema)( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from classValidatorResolver when validation fails with `validateAllFieldCriteria` set to true and `mode: sync`', async () => { - const result = await classValidatorResolver(Schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); -}); - -it('validate data with transformer option', async () => { - class SchemaTest { - @Expose({ groups: ['find', 'create', 'update'] }) - @Type(() => Number) - @IsDefined({ - message: `All fields must be defined.`, - groups: ['publish'], - }) - @IsNumber({}, { message: `Must be a number`, always: true }) - @Min(0, { message: `Cannot be lower than 0`, always: true }) - @Max(255, { message: `Cannot be greater than 255`, always: true }) - random: number; - } - - const result = await classValidatorResolver( - SchemaTest, - { transformer: { groups: ['update'] } }, - { - mode: 'sync', - }, - )(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); -}); - -it('validate data with validator option', async () => { - class SchemaTest { - @Expose({ groups: ['find', 'create', 'update'] }) - @Type(() => Number) - @IsDefined({ - message: `All fields must be defined.`, - groups: ['publish'], - }) - @IsNumber({}, { message: `Must be a number`, always: true }) - @Min(0, { message: `Cannot be lower than 0`, always: true }) - @Max(255, { message: `Cannot be greater than 255`, always: true }) - random: number; - } - - const result = await classValidatorResolver( - SchemaTest, - { validator: { stopAtFirstError: true } }, - { - mode: 'sync', - }, - )(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); -}); - -it('should return from classValidatorResolver with `excludeExtraneousValues` set to true', async () => { - class SchemaTest { - @Expose() - @IsNumber({}, { message: `Must be a number`, always: true }) - random: number; - } - - const result = await classValidatorResolver(SchemaTest, { - transformer: { - excludeExtraneousValues: true, - }, - })( - { - random: 10, - extraneousField: true, - }, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(result).toEqual({ errors: {}, values: { random: 10 } }); - expect(result.values).toBeInstanceOf(SchemaTest); -}); diff --git a/node_modules/@hookform/resolvers/class-validator/src/class-validator.ts b/node_modules/@hookform/resolvers/class-validator/src/class-validator.ts deleted file mode 100644 index 742eaf6562ebc16d7e6963c434078fb6d9e45d09..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/class-validator.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { plainToClass } from 'class-transformer'; -import { ValidationError, validate, validateSync } from 'class-validator'; -import { FieldErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrors = ( - errors: ValidationError[], - validateAllFieldCriteria: boolean, - parsedErrors: FieldErrors = {}, - path = '', -) => { - return errors.reduce((acc, error) => { - const _path = path ? `${path}.${error.property}` : error.property; - - if (error.constraints) { - const key = Object.keys(error.constraints)[0]; - acc[_path] = { - type: key, - message: error.constraints[key], - }; - - const _e = acc[_path]; - if (validateAllFieldCriteria && _e) { - Object.assign(_e, { types: error.constraints }); - } - } - - if (error.children && error.children.length) { - parseErrors(error.children, validateAllFieldCriteria, acc, _path); - } - - return acc; - }, parsedErrors); -}; - -export const classValidatorResolver: Resolver = - (schema, schemaOptions = {}, resolverOptions = {}) => - async (values, _, options) => { - const { transformer, validator } = schemaOptions; - const data = plainToClass(schema, values, transformer); - - const rawErrors = await (resolverOptions.mode === 'sync' - ? validateSync - : validate)(data, validator); - - if (rawErrors.length) { - return { - values: {}, - errors: toNestErrors( - parseErrors( - rawErrors, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - } - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - values: resolverOptions.rawValues ? values : data, - errors: {}, - }; - }; diff --git a/node_modules/@hookform/resolvers/class-validator/src/index.ts b/node_modules/@hookform/resolvers/class-validator/src/index.ts deleted file mode 100644 index 53803f5276df1ac8f1e52a63f2b3357f3b3cc92b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './class-validator'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/class-validator/src/types.ts b/node_modules/@hookform/resolvers/class-validator/src/types.ts deleted file mode 100644 index dd43d759fee3704e78567000b2e9d425a1eb1087..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/class-validator/src/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ClassConstructor, ClassTransformOptions } from 'class-transformer'; -import { ValidatorOptions } from 'class-validator'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = ( - schema: ClassConstructor, - schemaOptions?: { - validator?: ValidatorOptions; - transformer?: ClassTransformOptions; - }, - resolverOptions?: { mode?: 'async' | 'sync'; rawValues?: boolean }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.d.ts b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.d.ts deleted file mode 100644 index 7c1c18c3021b4ecf5bd8c6a6da93b9817fc8580a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const computedTypesResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.js b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.js deleted file mode 100644 index be274669393663da4538963f07e87ec182c1f761..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers");exports.computedTypesResolver=function(e){return function(t,o,n){try{return Promise.resolve(function(o,s){try{var u=Promise.resolve(e(t)).then(function(e){return n.shouldUseNativeValidation&&r.validateFieldsNatively({},n),{errors:{},values:e}})}catch(r){return s(r)}return u&&u.then?u.then(void 0,s):u}(0,function(e){if(function(r){return null!=r.errors}(e))return{values:{},errors:r.toNestErrors((t=e,(t.errors||[]).reduce(function(r,e){return r[e.path.join(".")]={type:e.error.name,message:e.error.message},r},{})),n)};var t;throw e}))}catch(r){return Promise.reject(r)}}}; -//# sourceMappingURL=computed-types.js.map diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.js.map b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.js.map deleted file mode 100644 index 67f3345500adbea7e9e3bbe9d891b90532e5e03b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"computed-types.js","sources":["../src/computed-types.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'computed-types';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst isValidationError = (error: any): error is ValidationError =>\n error.errors != null;\n\nconst parseErrorSchema = (computedTypesError: ValidationError) => {\n const parsedErrors: FieldErrors = {};\n return (computedTypesError.errors || []).reduce((acc, error) => {\n acc[error.path.join('.')] = {\n type: error.error.name,\n message: error.error.message,\n };\n\n return acc;\n }, parsedErrors);\n};\n\nexport const computedTypesResolver: Resolver =\n (schema) => async (values, _, options) => {\n try {\n const data = await schema(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: data,\n };\n } catch (error: any) {\n if (isValidationError(error)) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(error), options),\n };\n }\n\n throw error;\n }\n };\n"],"names":["schema","values","_","options","Promise","resolve","then","data","shouldUseNativeValidation","validateFieldsNatively","errors","_catch","error","isValidationError","toNestErrors","computedTypesError","reduce","acc","path","join","type","name","message","e","reject"],"mappings":"mEAqBE,SAACA,GAAkBC,OAAAA,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACnCD,QAAAC,QACiBL,EAAOC,IAAOK,KAAA,SAA3BC,GAIN,OAFAJ,EAAQK,2BAA6BC,EAAAA,uBAAuB,CAAA,EAAIN,GAEzD,CACLO,OAAQ,CAAE,EACVT,OAAQM,EACR,4DATmCI,CAAA,EAU9BC,SAAAA,GACP,GA3BoB,SAACA,GACzB,OAAgB,MAAhBA,EAAMF,MAAc,CA0BZG,CAAkBD,GACpB,MAAO,CACLX,OAAQ,CAAA,EACRS,OAAQI,EAAAA,cA3BQC,EA2BsBH,GAzBtCG,EAAmBL,QAAU,IAAIM,OAAO,SAACC,EAAKL,GAMpD,OALAK,EAAIL,EAAMM,KAAKC,KAAK,MAAQ,CAC1BC,KAAMR,EAAMA,MAAMS,KAClBC,QAASV,EAAMA,MAAMU,SAGhBL,CACT,EARkC,CAAA,IA0BoBd,IA3B/B,IAACY,EA+BpB,MAAMH,CACR,GACF,CAAC,MAAAW,GAAAnB,OAAAA,QAAAoB,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.mjs b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.mjs deleted file mode 100644 index a9d2c45d930208220a4797e2420b47f32d66407e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";var t=function(t){return function(n,o,u){try{return Promise.resolve(function(e,o){try{var s=Promise.resolve(t(n)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:e}})}catch(r){return o(r)}return s&&s.then?s.then(void 0,o):s}(0,function(r){if(function(r){return null!=r.errors}(r))return{values:{},errors:e((t=r,(t.errors||[]).reduce(function(r,e){return r[e.path.join(".")]={type:e.error.name,message:e.error.message},r},{})),u)};var t;throw r}))}catch(r){return Promise.reject(r)}}};export{t as computedTypesResolver}; -//# sourceMappingURL=computed-types.module.js.map diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.modern.mjs b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.modern.mjs deleted file mode 100644 index 636987a8825ad3e39498f13e038f4d189411f8f6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";const o=o=>async(s,a,t)=>{try{const e=await o(s);return t.shouldUseNativeValidation&&r({},t),{errors:{},values:e}}catch(r){if((r=>null!=r.errors)(r))return{values:{},errors:e((n=r,(n.errors||[]).reduce((r,e)=>(r[e.path.join(".")]={type:e.error.name,message:e.error.message},r),{})),t)};throw r}var n};export{o as computedTypesResolver}; -//# sourceMappingURL=computed-types.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.modern.mjs.map b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.modern.mjs.map deleted file mode 100644 index 5b0f5e3df5474b143cb661e75fb9126382adc23f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"computed-types.modern.mjs","sources":["../src/computed-types.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'computed-types';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst isValidationError = (error: any): error is ValidationError =>\n error.errors != null;\n\nconst parseErrorSchema = (computedTypesError: ValidationError) => {\n const parsedErrors: FieldErrors = {};\n return (computedTypesError.errors || []).reduce((acc, error) => {\n acc[error.path.join('.')] = {\n type: error.error.name,\n message: error.error.message,\n };\n\n return acc;\n }, parsedErrors);\n};\n\nexport const computedTypesResolver: Resolver =\n (schema) => async (values, _, options) => {\n try {\n const data = await schema(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: data,\n };\n } catch (error: any) {\n if (isValidationError(error)) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(error), options),\n };\n }\n\n throw error;\n }\n };\n"],"names":["computedTypesResolver","schema","async","values","_","options","data","shouldUseNativeValidation","validateFieldsNatively","errors","error","isValidationError","toNestErrors","computedTypesError","reduce","acc","path","join","type","name","message"],"mappings":"+EAKA,MAeaA,EACVC,GAAWC,MAAOC,EAAQC,EAAGC,KAC5B,IACE,MAAMC,QAAaL,EAAOE,GAI1B,OAFAE,EAAQE,2BAA6BC,EAAuB,CAAE,EAAEH,GAEzD,CACLI,OAAQ,CAAA,EACRN,OAAQG,EAEZ,CAAE,MAAOI,GACP,GA3BqBA,IACT,MAAhBA,EAAMD,OA0BEE,CAAkBD,GACpB,MAAO,CACLP,OAAQ,CAAA,EACRM,OAAQG,GA3BQC,EA2BsBH,GAzBtCG,EAAmBJ,QAAU,IAAIK,OAAO,CAACC,EAAKL,KACpDK,EAAIL,EAAMM,KAAKC,KAAK,MAAQ,CAC1BC,KAAMR,EAAMA,MAAMS,KAClBC,QAASV,EAAMA,MAAMU,SAGhBL,GAPyB,KA0BoBV,IAIlD,MAAMK,CACR,CAhCsBG,KAgCtB"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.module.js b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.module.js deleted file mode 100644 index a9d2c45d930208220a4797e2420b47f32d66407e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";var t=function(t){return function(n,o,u){try{return Promise.resolve(function(e,o){try{var s=Promise.resolve(t(n)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:e}})}catch(r){return o(r)}return s&&s.then?s.then(void 0,o):s}(0,function(r){if(function(r){return null!=r.errors}(r))return{values:{},errors:e((t=r,(t.errors||[]).reduce(function(r,e){return r[e.path.join(".")]={type:e.error.name,message:e.error.message},r},{})),u)};var t;throw r}))}catch(r){return Promise.reject(r)}}};export{t as computedTypesResolver}; -//# sourceMappingURL=computed-types.module.js.map diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.module.js.map b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.module.js.map deleted file mode 100644 index a8ee8bb11800e455792eb878560781464606bc8d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"computed-types.module.js","sources":["../src/computed-types.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'computed-types';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst isValidationError = (error: any): error is ValidationError =>\n error.errors != null;\n\nconst parseErrorSchema = (computedTypesError: ValidationError) => {\n const parsedErrors: FieldErrors = {};\n return (computedTypesError.errors || []).reduce((acc, error) => {\n acc[error.path.join('.')] = {\n type: error.error.name,\n message: error.error.message,\n };\n\n return acc;\n }, parsedErrors);\n};\n\nexport const computedTypesResolver: Resolver =\n (schema) => async (values, _, options) => {\n try {\n const data = await schema(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: data,\n };\n } catch (error: any) {\n if (isValidationError(error)) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(error), options),\n };\n }\n\n throw error;\n }\n };\n"],"names":["computedTypesResolver","schema","values","_","options","Promise","resolve","then","data","shouldUseNativeValidation","validateFieldsNatively","errors","_catch","error","isValidationError","toNestErrors","computedTypesError","reduce","acc","path","join","type","name","message","e","reject"],"mappings":"+EAKA,IAeaA,EACX,SAACC,GAAkBC,OAAAA,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACnCD,QAAAC,QACiBL,EAAOC,IAAOK,KAAA,SAA3BC,GAIN,OAFAJ,EAAQK,2BAA6BC,EAAuB,CAAA,EAAIN,GAEzD,CACLO,OAAQ,CAAE,EACVT,OAAQM,EACR,4DATmCI,CAAA,EAU9BC,SAAAA,GACP,GA3BoB,SAACA,GACzB,OAAgB,MAAhBA,EAAMF,MAAc,CA0BZG,CAAkBD,GACpB,MAAO,CACLX,OAAQ,CAAA,EACRS,OAAQI,GA3BQC,EA2BsBH,GAzBtCG,EAAmBL,QAAU,IAAIM,OAAO,SAACC,EAAKL,GAMpD,OALAK,EAAIL,EAAMM,KAAKC,KAAK,MAAQ,CAC1BC,KAAMR,EAAMA,MAAMS,KAClBC,QAASV,EAAMA,MAAMU,SAGhBL,CACT,EARkC,CAAA,IA0BoBd,IA3B/B,IAACY,EA+BpB,MAAMH,CACR,GACF,CAAC,MAAAW,GAAAnB,OAAAA,QAAAoB,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.umd.js b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.umd.js deleted file mode 100644 index deb91db2274f8f231b1d128412be173aa15939d7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers"],r):r((e||self).hookformResolversComputedTypes={},e.hookformResolvers)}(this,function(e,r){e.computedTypesResolver=function(e){return function(o,t,n){try{return Promise.resolve(function(t,s){try{var i=Promise.resolve(e(o)).then(function(e){return n.shouldUseNativeValidation&&r.validateFieldsNatively({},n),{errors:{},values:e}})}catch(e){return s(e)}return i&&i.then?i.then(void 0,s):i}(0,function(e){if(function(e){return null!=e.errors}(e))return{values:{},errors:r.toNestErrors((o=e,(o.errors||[]).reduce(function(e,r){return e[r.path.join(".")]={type:r.error.name,message:r.error.message},e},{})),n)};var o;throw e}))}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=computed-types.umd.js.map diff --git a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.umd.js.map b/node_modules/@hookform/resolvers/computed-types/dist/computed-types.umd.js.map deleted file mode 100644 index 696fa3eea35eaf164ee13b2e1116e028db2d8562..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/computed-types.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"computed-types.umd.js","sources":["../src/computed-types.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'computed-types';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst isValidationError = (error: any): error is ValidationError =>\n error.errors != null;\n\nconst parseErrorSchema = (computedTypesError: ValidationError) => {\n const parsedErrors: FieldErrors = {};\n return (computedTypesError.errors || []).reduce((acc, error) => {\n acc[error.path.join('.')] = {\n type: error.error.name,\n message: error.error.message,\n };\n\n return acc;\n }, parsedErrors);\n};\n\nexport const computedTypesResolver: Resolver =\n (schema) => async (values, _, options) => {\n try {\n const data = await schema(values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: data,\n };\n } catch (error: any) {\n if (isValidationError(error)) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(error), options),\n };\n }\n\n throw error;\n }\n };\n"],"names":["schema","values","_","options","Promise","resolve","then","data","shouldUseNativeValidation","validateFieldsNatively","errors","_catch","error","isValidationError","toNestErrors","computedTypesError","reduce","acc","path","join","type","name","message","e","reject"],"mappings":"2VAqBE,SAACA,GAAkBC,OAAAA,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACnCD,QAAAC,QACiBL,EAAOC,IAAOK,KAAA,SAA3BC,GAIN,OAFAJ,EAAQK,2BAA6BC,EAAAA,uBAAuB,CAAA,EAAIN,GAEzD,CACLO,OAAQ,CAAE,EACVT,OAAQM,EACR,4DATmCI,CAAA,EAU9BC,SAAAA,GACP,GA3BoB,SAACA,GACzB,OAAgB,MAAhBA,EAAMF,MAAc,CA0BZG,CAAkBD,GACpB,MAAO,CACLX,OAAQ,CAAA,EACRS,OAAQI,EAAAA,cA3BQC,EA2BsBH,GAzBtCG,EAAmBL,QAAU,IAAIM,OAAO,SAACC,EAAKL,GAMpD,OALAK,EAAIL,EAAMM,KAAKC,KAAK,MAAQ,CAC1BC,KAAMR,EAAMA,MAAMS,KAClBC,QAASV,EAAMA,MAAMU,SAGhBL,CACT,EARkC,CAAA,IA0BoBd,IA3B/B,IAACY,EA+BpB,MAAMH,CACR,GACF,CAAC,MAAAW,GAAAnB,OAAAA,QAAAoB,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/computed-types/dist/index.d.ts b/node_modules/@hookform/resolvers/computed-types/dist/index.d.ts deleted file mode 100644 index 86d15a831185fa48b5b952a60d440c6667739d91..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './computed-types'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/computed-types/dist/types.d.ts b/node_modules/@hookform/resolvers/computed-types/dist/types.d.ts deleted file mode 100644 index 32270ebd836c74439ebb5efed4cdf35f51cd096f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/dist/types.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (schema: any) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/computed-types/package.json b/node_modules/@hookform/resolvers/computed-types/package.json deleted file mode 100644 index d36a4a815d0eaebbffd06c79549325b03da92056..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@hookform/resolvers/computed-types", - "amdName": "hookformResolversComputedTypes", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: computed-types", - "main": "dist/computed-types.js", - "module": "dist/computed-types.module.js", - "umd:main": "dist/computed-types.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/computed-types/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/computed-types/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 75e53ecc39861bb33e2b954868ef152a4e22bca5..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import Schema, { Type, string } from 'computed-types'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { computedTypesResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = Schema({ - username: string.min(2).error(USERNAME_REQUIRED_MESSAGE), - password: string.min(2).error(PASSWORD_REQUIRED_MESSAGE), -}); - -type FormData = Type & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: computedTypesResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with computed-types", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/computed-types/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/computed-types/src/__tests__/Form.tsx deleted file mode 100644 index 7989e2db7f0e5180d9b060ed3f5b5d3e2f4876ee..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/__tests__/Form.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import Schema, { Type, string } from 'computed-types'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { computedTypesResolver } from '..'; - -const schema = Schema({ - username: string.min(2).error('username field is required'), - password: string.min(2).error('password field is required'), - address: Schema({ - zipCode: string.min(5).max(5).error('zipCode field is required'), - }), -}); - -type FormData = Type & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: computedTypesResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - - {errors.address?.zipCode && ( - {errors.address.zipCode.message} - )} - - -
- ); -} - -test("form's validation with computed-types and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/password field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/zipCode field is required/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/computed-types/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/computed-types/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 8c0b9f02239d7762b92060fd15fe3b824ae4df08..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,86 +0,0 @@ -import Schema, { Type, string, number, array, boolean } from 'computed-types'; -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = Schema({ - username: string.regexp(/^\w+$/).min(3).max(30), - password: string - .regexp(new RegExp('.*[A-Z].*'), 'One uppercase character') - .regexp(new RegExp('.*[a-z].*'), 'One lowercase character') - .regexp(new RegExp('.*\\d.*'), 'One number') - .regexp( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ) - .min(8, 'Must be at least 8 characters in length'), - repeatPassword: string, - accessToken: Schema.either(string, number).optional(), - birthYear: number.min(1900).max(2013).optional(), - email: string - .regexp(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/) - .error('Incorrect email'), - tags: array.of(string), - enabled: boolean, - like: array - .of({ - id: number, - name: string.min(4).max(4), - }) - .optional(), - address: Schema({ - city: string.min(3, 'Is required'), - zipCode: string - .min(5, 'Must be 5 characters long') - .max(5, 'Must be 5 characters long'), - }), -}); - -export const validData: Type = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - accessToken: 'accessToken', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - like: [ - { - id: 1, - name: 'name', - }, - ], - address: { - city: 'Awesome city', - zipCode: '12345', - }, -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - address: { - city: '', - zipCode: '123', - }, -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/computed-types/src/__tests__/__snapshots__/computed-types.ts.snap b/node_modules/@hookform/resolvers/computed-types/src/__tests__/__snapshots__/computed-types.ts.snap deleted file mode 100644 index d4ccb3a6c2a950bb4dd59e57ae192f0d2d85371c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/__tests__/__snapshots__/computed-types.ts.snap +++ /dev/null @@ -1,74 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`computedTypesResolver > should return a single error from computedTypesResolver when validation fails 1`] = ` -{ - "errors": { - "address": { - "city": { - "message": "Is required", - "ref": undefined, - "type": "ValidationError", - }, - "zipCode": { - "message": "Must be 5 characters long", - "ref": undefined, - "type": "ValidationError", - }, - }, - "birthYear": { - "message": "Expect value to be "number"", - "ref": undefined, - "type": "ValidationError", - }, - "email": { - "message": "Incorrect email", - "ref": { - "name": "email", - }, - "type": "ValidationError", - }, - "enabled": { - "message": "Expect value to be "boolean"", - "ref": undefined, - "type": "ValidationError", - }, - "like": { - "id": { - "message": "Expect value to be "number"", - "ref": undefined, - "type": "ValidationError", - }, - "name": { - "message": "Expect value to be "string"", - "ref": undefined, - "type": "ValidationError", - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "ValidationError", - }, - "repeatPassword": { - "message": "Expect value to be "string"", - "ref": undefined, - "type": "ValidationError", - }, - "tags": { - "message": "Expecting value to be an array", - "ref": undefined, - "type": "ValidationError", - }, - "username": { - "message": "Expect value to be "string"", - "ref": { - "name": "username", - }, - "type": "ValidationError", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/computed-types/src/__tests__/computed-types.ts b/node_modules/@hookform/resolvers/computed-types/src/__tests__/computed-types.ts deleted file mode 100644 index 262061e1e09894db81e83d97b9770f9397f45c2c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/__tests__/computed-types.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { computedTypesResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('computedTypesResolver', () => { - it('should return values from computedTypesResolver when validation pass', async () => { - const result = await computedTypesResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from computedTypesResolver when validation fails', async () => { - const result = await computedTypesResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should throw any error unrelated to computed-types', async () => { - const schemaWithCustomError = schema.transform(() => { - throw Error('custom error'); - }); - const promise = computedTypesResolver(schemaWithCustomError)( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - await expect(promise).rejects.toThrow('custom error'); - }); -}); diff --git a/node_modules/@hookform/resolvers/computed-types/src/computed-types.ts b/node_modules/@hookform/resolvers/computed-types/src/computed-types.ts deleted file mode 100644 index d0efa48ebb12a78ca934588e94ac637fb716a53c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/computed-types.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import type { ValidationError } from 'computed-types'; -import type { FieldErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const isValidationError = (error: any): error is ValidationError => - error.errors != null; - -const parseErrorSchema = (computedTypesError: ValidationError) => { - const parsedErrors: FieldErrors = {}; - return (computedTypesError.errors || []).reduce((acc, error) => { - acc[error.path.join('.')] = { - type: error.error.name, - message: error.error.message, - }; - - return acc; - }, parsedErrors); -}; - -export const computedTypesResolver: Resolver = - (schema) => async (values, _, options) => { - try { - const data = await schema(values); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - errors: {}, - values: data, - }; - } catch (error: any) { - if (isValidationError(error)) { - return { - values: {}, - errors: toNestErrors(parseErrorSchema(error), options), - }; - } - - throw error; - } - }; diff --git a/node_modules/@hookform/resolvers/computed-types/src/index.ts b/node_modules/@hookform/resolvers/computed-types/src/index.ts deleted file mode 100644 index 86d15a831185fa48b5b952a60d440c6667739d91..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './computed-types'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/computed-types/src/types.ts b/node_modules/@hookform/resolvers/computed-types/src/types.ts deleted file mode 100644 index 2c3ff74f408c8bc12bc2242334162a0567f4b563..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/computed-types/src/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { - FieldValues, - ResolverOptions, - ResolverResult, -} from 'react-hook-form'; - -export type Resolver = ( - schema: any, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/dist/index.d.ts b/node_modules/@hookform/resolvers/dist/index.d.ts deleted file mode 100644 index cd22ab17a6aebaed3d8c190a27d3738ca8128d0a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './toNestErrors'; -export * from './validateFieldsNatively'; diff --git a/node_modules/@hookform/resolvers/dist/resolvers.js b/node_modules/@hookform/resolvers/dist/resolvers.js deleted file mode 100644 index 2f12ed8cbb36bbe2050b53530f44d4c8020372f0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("react-hook-form"),r=function(r,t,i){if(r&&"reportValidity"in r){var s=e.get(i,t);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},t=function(e,t){var i=function(i){var s=t.fields[i];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,i,e):s.refs&&s.refs.forEach(function(t){return r(t,i,e)})};for(var s in t.fields)i(s)},i=function(e,r){return e.some(function(e){return e.startsWith(r+".")})};exports.toNestErrors=function(r,s){s.shouldUseNativeValidation&&t(r,s);var a={};for(var n in r){var o=e.get(s.fields,n),f=Object.assign(r[n]||{},{ref:o&&o.ref});if(i(s.names||Object.keys(r),n)){var u=Object.assign({},e.get(a,n));e.set(u,"root",f),e.set(a,n,u)}else e.set(a,n,f)}return a},exports.validateFieldsNatively=t; -//# sourceMappingURL=resolvers.js.map diff --git a/node_modules/@hookform/resolvers/dist/resolvers.js.map b/node_modules/@hookform/resolvers/dist/resolvers.js.map deleted file mode 100644 index fa8536d31a2c6edd66f815870e28c4101de21ec2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolvers.js","sources":["../src/validateFieldsNatively.ts","../src/toNestErrors.ts"],"sourcesContent":["import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = (\n errors: FieldErrors,\n options: ResolverOptions,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = (\n errors: FieldErrors,\n options: ResolverOptions,\n): FieldErrors => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => names.some((n) => n.startsWith(name + '.'));\n"],"names":["setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","_loop","field","fields","refs","forEach","isNameInFieldArray","names","name","some","n","startsWith","shouldUseNativeValidation","fieldErrors","path","Object","assign","keys","fieldArrayErrors","set"],"mappings":"iCASMA,EAAoB,SACxBC,EACAC,EACAC,GAEA,GAAIF,GAAO,mBAAoBA,EAAK,CAClC,IAAMG,EAAQC,MAAIF,EAAQD,GAC1BD,EAAID,kBAAmBI,GAASA,EAAME,SAAY,IAElDL,EAAIM,gBACN,CACF,EAGaC,EAAyB,SACpCL,EACAM,GACQ,IAAAC,EAAAA,SAAAR,GAEN,IAAMS,EAAQF,EAAQG,OAAOV,GACzBS,GAASA,EAAMV,KAAO,mBAAoBU,EAAMV,IAClDD,EAAkBW,EAAMV,IAAKC,EAAWC,GAC/BQ,EAAME,MACfF,EAAME,KAAKC,QAAQ,SAACb,GAAqB,OACvCD,EAAkBC,EAAKC,EAAWC,EAAO,EAG/C,EATA,IAAK,IAAMD,KAAaO,EAAQG,OAAMF,EAAAR,EAUxC,ECAMa,EAAqB,SACzBC,EACAC,GAAuB,OACpBD,EAAME,KAAK,SAACC,GAAM,OAAAA,EAAEC,WAAWH,EAAO,IAAI,EAAC,uBA7BpB,SAC1Bd,EACAM,GAEAA,EAAQY,2BAA6Bb,EAAuBL,EAAQM,GAEpE,IAAMa,EAAc,GACpB,IAAK,IAAMC,KAAQpB,EAAQ,CACzB,IAAMQ,EAAQN,EAAGA,IAACI,EAAQG,OAAQW,GAC5BnB,EAAQoB,OAAOC,OAAOtB,EAAOoB,IAAS,CAAE,EAAE,CAC9CtB,IAAKU,GAASA,EAAMV,MAGtB,GAAIc,EAAmBN,EAAQO,OAASQ,OAAOE,KAAKvB,GAASoB,GAAO,CAClE,IAAMI,EAAmBH,OAAOC,OAAO,CAAA,EAAIpB,EAAGA,IAACiB,EAAaC,IAE5DK,EAAGA,IAACD,EAAkB,OAAQvB,GAC9BwB,EAAGA,IAACN,EAAaC,EAAMI,EACzB,MACEC,EAAGA,IAACN,EAAaC,EAAMnB,EAE3B,CAEA,OAAOkB,CACT"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/dist/resolvers.mjs b/node_modules/@hookform/resolvers/dist/resolvers.mjs deleted file mode 100644 index 92f58980c30a26ba25ec2ae2163e4f61acd326e3..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{get as t,set as e}from"react-hook-form";const s=(e,s,o)=>{if(e&&"reportValidity"in e){const r=t(o,s);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},o=(t,e)=>{for(const o in e.fields){const r=e.fields[o];r&&r.ref&&"reportValidity"in r.ref?s(r.ref,o,t):r.refs&&r.refs.forEach(e=>s(e,o,t))}},r=(s,r)=>{r.shouldUseNativeValidation&&o(s,r);const f={};for(const o in s){const n=t(r.fields,o),a=Object.assign(s[o]||{},{ref:n&&n.ref});if(i(r.names||Object.keys(s),o)){const s=Object.assign({},t(f,o));e(s,"root",a),e(f,o,s)}else e(f,o,a)}return f},i=(t,e)=>t.some(t=>t.startsWith(e+"."));export{r as toNestErrors,o as validateFieldsNatively}; -//# sourceMappingURL=resolvers.mjs.map diff --git a/node_modules/@hookform/resolvers/dist/resolvers.mjs.map b/node_modules/@hookform/resolvers/dist/resolvers.mjs.map deleted file mode 100644 index 9132e517b7524b361c3e480cde304d1134a131ec..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolvers.mjs","sources":["../src/validateFieldsNatively.ts","../src/toNestErrors.ts"],"sourcesContent":["import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = (\n errors: FieldErrors,\n options: ResolverOptions,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = (\n errors: FieldErrors,\n options: ResolverOptions,\n): FieldErrors => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => names.some((n) => n.startsWith(name + '.'));\n"],"names":["setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","fields","field","refs","forEach","toNestErrors","shouldUseNativeValidation","fieldErrors","path","Object","assign","isNameInFieldArray","names","keys","fieldArrayErrors","set","name","some","n","startsWith"],"mappings":"+CASA,MAAMA,EAAoBA,CACxBC,EACAC,EACAC,KAEA,GAAIF,GAAO,mBAAoBA,EAAK,CAClC,MAAMG,EAAQC,EAAIF,EAAQD,GAC1BD,EAAID,kBAAmBI,GAASA,EAAME,SAAY,IAElDL,EAAIM,gBACN,GAIWC,EAAyBA,CACpCL,EACAM,KAEA,IAAK,MAAMP,KAAaO,EAAQC,OAAQ,CACtC,MAAMC,EAAQF,EAAQC,OAAOR,GACzBS,GAASA,EAAMV,KAAO,mBAAoBU,EAAMV,IAClDD,EAAkBW,EAAMV,IAAKC,EAAWC,GAC/BQ,EAAMC,MACfD,EAAMC,KAAKC,QAASZ,GAClBD,EAAkBC,EAAKC,EAAWC,GAGxC,GCzBWW,EAAeA,CAC1BX,EACAM,KAEAA,EAAQM,2BAA6BP,EAAuBL,EAAQM,GAEpE,MAAMO,EAAc,CAAA,EACpB,IAAK,MAAMC,KAAQd,EAAQ,CACzB,MAAMQ,EAAQN,EAAII,EAAQC,OAAQO,GAC5Bb,EAAQc,OAAOC,OAAOhB,EAAOc,IAAS,GAAI,CAC9ChB,IAAKU,GAASA,EAAMV,MAGtB,GAAImB,EAAmBX,EAAQY,OAASH,OAAOI,KAAKnB,GAASc,GAAO,CAClE,MAAMM,EAAmBL,OAAOC,OAAO,CAAA,EAAId,EAAIW,EAAaC,IAE5DO,EAAID,EAAkB,OAAQnB,GAC9BoB,EAAIR,EAAaC,EAAMM,EACzB,MACEC,EAAIR,EAAaC,EAAMb,EAE3B,CAEA,OAAOY,GAGHI,EAAqBA,CACzBC,EACAI,IACGJ,EAAMK,KAAMC,GAAMA,EAAEC,WAAWH,EAAO"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/dist/resolvers.module.js b/node_modules/@hookform/resolvers/dist/resolvers.module.js deleted file mode 100644 index d2c36515a28617df2acea313e62ee3c82459160e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{get as r,set as e}from"react-hook-form";var t=function(e,t,i){if(e&&"reportValidity"in e){var n=r(i,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},i=function(r,e){var i=function(i){var n=e.fields[i];n&&n.ref&&"reportValidity"in n.ref?t(n.ref,i,r):n.refs&&n.refs.forEach(function(e){return t(e,i,r)})};for(var n in e.fields)i(n)},n=function(t,n){n.shouldUseNativeValidation&&i(t,n);var f={};for(var a in t){var s=r(n.fields,a),u=Object.assign(t[a]||{},{ref:s&&s.ref});if(o(n.names||Object.keys(t),a)){var c=Object.assign({},r(f,a));e(c,"root",u),e(f,a,c)}else e(f,a,u)}return f},o=function(r,e){return r.some(function(r){return r.startsWith(e+".")})};export{n as toNestErrors,i as validateFieldsNatively}; -//# sourceMappingURL=resolvers.module.js.map diff --git a/node_modules/@hookform/resolvers/dist/resolvers.module.js.map b/node_modules/@hookform/resolvers/dist/resolvers.module.js.map deleted file mode 100644 index 5211f108b949f6f37fff943dbdfbd16f06500773..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolvers.module.js","sources":["../src/validateFieldsNatively.ts","../src/toNestErrors.ts"],"sourcesContent":["import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = (\n errors: FieldErrors,\n options: ResolverOptions,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = (\n errors: FieldErrors,\n options: ResolverOptions,\n): FieldErrors => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => names.some((n) => n.startsWith(name + '.'));\n"],"names":["setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","_loop","field","fields","refs","forEach","toNestErrors","shouldUseNativeValidation","fieldErrors","path","Object","assign","isNameInFieldArray","names","keys","fieldArrayErrors","set","name","some","n","startsWith"],"mappings":"+CASA,IAAMA,EAAoB,SACxBC,EACAC,EACAC,GAEA,GAAIF,GAAO,mBAAoBA,EAAK,CAClC,IAAMG,EAAQC,EAAIF,EAAQD,GAC1BD,EAAID,kBAAmBI,GAASA,EAAME,SAAY,IAElDL,EAAIM,gBACN,CACF,EAGaC,EAAyB,SACpCL,EACAM,GACQ,IAAAC,EAAAA,SAAAR,GAEN,IAAMS,EAAQF,EAAQG,OAAOV,GACzBS,GAASA,EAAMV,KAAO,mBAAoBU,EAAMV,IAClDD,EAAkBW,EAAMV,IAAKC,EAAWC,GAC/BQ,EAAME,MACfF,EAAME,KAAKC,QAAQ,SAACb,GAAqB,OACvCD,EAAkBC,EAAKC,EAAWC,EAAO,EAG/C,EATA,IAAK,IAAMD,KAAaO,EAAQG,OAAMF,EAAAR,EAUxC,EC1Baa,EAAe,SAC1BZ,EACAM,GAEAA,EAAQO,2BAA6BR,EAAuBL,EAAQM,GAEpE,IAAMQ,EAAc,GACpB,IAAK,IAAMC,KAAQf,EAAQ,CACzB,IAAMQ,EAAQN,EAAII,EAAQG,OAAQM,GAC5Bd,EAAQe,OAAOC,OAAOjB,EAAOe,IAAS,CAAE,EAAE,CAC9CjB,IAAKU,GAASA,EAAMV,MAGtB,GAAIoB,EAAmBZ,EAAQa,OAASH,OAAOI,KAAKpB,GAASe,GAAO,CAClE,IAAMM,EAAmBL,OAAOC,OAAO,CAAA,EAAIf,EAAIY,EAAaC,IAE5DO,EAAID,EAAkB,OAAQpB,GAC9BqB,EAAIR,EAAaC,EAAMM,EACzB,MACEC,EAAIR,EAAaC,EAAMd,EAE3B,CAEA,OAAOa,CACT,EAEMI,EAAqB,SACzBC,EACAI,GAAuB,OACpBJ,EAAMK,KAAK,SAACC,GAAM,OAAAA,EAAEC,WAAWH,EAAO,IAAI,EAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/dist/resolvers.umd.js b/node_modules/@hookform/resolvers/dist/resolvers.umd.js deleted file mode 100644 index 8210fd9cc9f9119baeaf1a35d7d90fad553acb5d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","react-hook-form"],t):t((e||self).hookformResolvers={},e.ReactHookForm)}(this,function(e,t){var r=function(e,r,o){if(e&&"reportValidity"in e){var i=t.get(o,r);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},o=function(e,t){var o=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?r(i.ref,o,e):i.refs&&i.refs.forEach(function(t){return r(t,o,e)})};for(var i in t.fields)o(i)},i=function(e,t){return e.some(function(e){return e.startsWith(t+".")})};e.toNestErrors=function(e,r){r.shouldUseNativeValidation&&o(e,r);var n={};for(var f in e){var s=t.get(r.fields,f),a=Object.assign(e[f]||{},{ref:s&&s.ref});if(i(r.names||Object.keys(e),f)){var d=Object.assign({},t.get(n,f));t.set(d,"root",a),t.set(n,f,d)}else t.set(n,f,a)}return n},e.validateFieldsNatively=o}); -//# sourceMappingURL=resolvers.umd.js.map diff --git a/node_modules/@hookform/resolvers/dist/resolvers.umd.js.map b/node_modules/@hookform/resolvers/dist/resolvers.umd.js.map deleted file mode 100644 index b30dd58e83e0ea9ca3f58eca8ac3a996b8613493..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/resolvers.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolvers.umd.js","sources":["../src/validateFieldsNatively.ts","../src/toNestErrors.ts"],"sourcesContent":["import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = (\n errors: FieldErrors,\n options: ResolverOptions,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = (\n errors: FieldErrors,\n options: ResolverOptions,\n): FieldErrors => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => names.some((n) => n.startsWith(name + '.'));\n"],"names":["setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","_loop","field","fields","refs","forEach","isNameInFieldArray","names","name","some","n","startsWith","shouldUseNativeValidation","fieldErrors","path","Object","assign","keys","fieldArrayErrors","set"],"mappings":"0SASA,IAAMA,EAAoB,SACxBC,EACAC,EACAC,GAEA,GAAIF,GAAO,mBAAoBA,EAAK,CAClC,IAAMG,EAAQC,MAAIF,EAAQD,GAC1BD,EAAID,kBAAmBI,GAASA,EAAME,SAAY,IAElDL,EAAIM,gBACN,CACF,EAGaC,EAAyB,SACpCL,EACAM,GACQ,IAAAC,EAAAA,SAAAR,GAEN,IAAMS,EAAQF,EAAQG,OAAOV,GACzBS,GAASA,EAAMV,KAAO,mBAAoBU,EAAMV,IAClDD,EAAkBW,EAAMV,IAAKC,EAAWC,GAC/BQ,EAAME,MACfF,EAAME,KAAKC,QAAQ,SAACb,GAAqB,OACvCD,EAAkBC,EAAKC,EAAWC,EAAO,EAG/C,EATA,IAAK,IAAMD,KAAaO,EAAQG,OAAMF,EAAAR,EAUxC,ECAMa,EAAqB,SACzBC,EACAC,GAAuB,OACpBD,EAAME,KAAK,SAACC,GAAM,OAAAA,EAAEC,WAAWH,EAAO,IAAI,EAAC,iBA7BpB,SAC1Bd,EACAM,GAEAA,EAAQY,2BAA6Bb,EAAuBL,EAAQM,GAEpE,IAAMa,EAAc,GACpB,IAAK,IAAMC,KAAQpB,EAAQ,CACzB,IAAMQ,EAAQN,EAAGA,IAACI,EAAQG,OAAQW,GAC5BnB,EAAQoB,OAAOC,OAAOtB,EAAOoB,IAAS,CAAE,EAAE,CAC9CtB,IAAKU,GAASA,EAAMV,MAGtB,GAAIc,EAAmBN,EAAQO,OAASQ,OAAOE,KAAKvB,GAASoB,GAAO,CAClE,IAAMI,EAAmBH,OAAOC,OAAO,CAAA,EAAIpB,EAAGA,IAACiB,EAAaC,IAE5DK,EAAGA,IAACD,EAAkB,OAAQvB,GAC9BwB,EAAGA,IAACN,EAAaC,EAAMI,EACzB,MACEC,EAAGA,IAACN,EAAaC,EAAMnB,EAE3B,CAEA,OAAOkB,CACT"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/dist/toNestErrors.d.ts b/node_modules/@hookform/resolvers/dist/toNestErrors.d.ts deleted file mode 100644 index b2b22c744d12bf2a1a5509026093799329372337..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/toNestErrors.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { FieldErrors, FieldValues, ResolverOptions } from 'react-hook-form'; -export declare const toNestErrors: (errors: FieldErrors, options: ResolverOptions) => FieldErrors; diff --git a/node_modules/@hookform/resolvers/dist/validateFieldsNatively.d.ts b/node_modules/@hookform/resolvers/dist/validateFieldsNatively.d.ts deleted file mode 100644 index 905e44c5aa96d22b9098921573925fc8568b7bfd..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/dist/validateFieldsNatively.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { FieldErrors, FieldValues, ResolverOptions } from 'react-hook-form'; -export declare const validateFieldsNatively: (errors: FieldErrors, options: ResolverOptions) => void; diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.d.ts b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.d.ts deleted file mode 100644 index 265c380d6797d76c20b685991c89594a5c41c17e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const effectTsResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.js b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.js deleted file mode 100644 index 6d1ce628fb277dcdf4e3efa436024c2fdc326b79..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@effect/schema/ArrayFormatter"),r=require("@effect/schema/ParseResult"),t=require("@hookform/resolvers");function n(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var o=/*#__PURE__*/n(require("effect/Effect"));exports.effectTsResolver=function(n,u){return void 0===u&&(u={errors:"all",onExcessProperty:"ignore"}),function(c,a,s){return r.decodeUnknown(n,u)(c).pipe(o.catchAll(function(r){return o.flip(e.formatIssue(r))}),o.mapError(function(e){var r=e.reduce(function(e,r){return e[r.path.join(".")]={message:r.message,type:r._tag},e},{});return t.toNestErrors(r,s)}),o.tap(function(){return o.sync(function(){return s.shouldUseNativeValidation&&t.validateFieldsNatively({},s)})}),o.match({onFailure:function(e){return{errors:e,values:{}}},onSuccess:function(e){return{errors:{},values:e}}}),o.runPromise)}}; -//# sourceMappingURL=effect-ts.js.map diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.js.map b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.js.map deleted file mode 100644 index fa269972e83d942919925f8bf2e20fa670d5694c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"effect-ts.js","sources":["../src/effect-ts.ts"],"sourcesContent":["import { formatIssue } from '@effect/schema/ArrayFormatter';\nimport { decodeUnknown } from '@effect/schema/ParseResult';\nimport { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Effect from 'effect/Effect';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nexport const effectTsResolver: Resolver =\n (schema, config = { errors: 'all', onExcessProperty: 'ignore' }) =>\n (values, _, options) => {\n return decodeUnknown(\n schema,\n config,\n )(values).pipe(\n Effect.catchAll((parseIssue) => Effect.flip(formatIssue(parseIssue))),\n Effect.mapError((issues) => {\n const errors = issues.reduce((acc, current) => {\n const key = current.path.join('.');\n acc[key] = { message: current.message, type: current._tag };\n return acc;\n }, {} as FieldErrors);\n\n return toNestErrors(errors, options);\n }),\n Effect.tap(() =>\n Effect.sync(\n () =>\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options),\n ),\n ),\n Effect.match({\n onFailure: (errors) => ({ errors, values: {} }),\n onSuccess: (result) => ({ errors: {}, values: result }),\n }),\n Effect.runPromise,\n );\n };\n"],"names":["schema","config","errors","onExcessProperty","values","_","options","decodeUnknown","pipe","Effect","catchAll","parseIssue","flip","formatIssue","mapError","issues","reduce","acc","current","path","join","message","type","_tag","toNestErrors","tap","sync","shouldUseNativeValidation","validateFieldsNatively","match","onFailure","onSuccess","result","runPromise"],"mappings":"8cAQE,SAACA,EAAQC,GAAsD,YAAtDA,IAAAA,IAAAA,EAAS,CAAEC,OAAQ,MAAOC,iBAAkB,WACpDC,SAAAA,EAAQC,EAAGC,GACV,OAAOC,EAAAA,cACLP,EACAC,EAFKM,CAGLH,GAAQI,KACRC,EAAOC,SAAS,SAACC,GAAe,OAAAF,EAAOG,KAAKC,EAAWA,YAACF,GAAY,GACpEF,EAAOK,SAAS,SAACC,GACf,IAAMb,EAASa,EAAOC,OAAO,SAACC,EAAKC,GAGjC,OADAD,EADYC,EAAQC,KAAKC,KAAK,MACnB,CAAEC,QAASH,EAAQG,QAASC,KAAMJ,EAAQK,MAC9CN,CACT,EAAG,CAAA,GAEH,OAAOO,EAAYA,aAACtB,EAAQI,EAC9B,GACAG,EAAOgB,IAAI,WACT,OAAAhB,EAAOiB,KACL,WACE,OAAApB,EAAQqB,2BACRC,yBAAuB,CAAA,EAAItB,EAAQ,EACtC,GAEHG,EAAOoB,MAAM,CACXC,UAAW,SAAC5B,GAAY,MAAA,CAAEA,OAAAA,EAAQE,OAAQ,CAAA,EAAI,EAC9C2B,UAAW,SAACC,GAAM,MAAM,CAAE9B,OAAQ,CAAA,EAAIE,OAAQ4B,EAAQ,IAExDvB,EAAOwB,WAEX,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.mjs b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.mjs deleted file mode 100644 index e59361f8a5d666cf6b6d50167aa6b35f4bed2b2b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{formatIssue as r}from"@effect/schema/ArrayFormatter";import{decodeUnknown as e}from"@effect/schema/ParseResult";import{toNestErrors as t,validateFieldsNatively as o}from"@hookform/resolvers";import*as n from"effect/Effect";var u=function(u,s){return void 0===s&&(s={errors:"all",onExcessProperty:"ignore"}),function(a,c,f){return e(u,s)(a).pipe(n.catchAll(function(e){return n.flip(r(e))}),n.mapError(function(r){var e=r.reduce(function(r,e){return r[e.path.join(".")]={message:e.message,type:e._tag},r},{});return t(e,f)}),n.tap(function(){return n.sync(function(){return f.shouldUseNativeValidation&&o({},f)})}),n.match({onFailure:function(r){return{errors:r,values:{}}},onSuccess:function(r){return{errors:{},values:r}}}),n.runPromise)}};export{u as effectTsResolver}; -//# sourceMappingURL=effect-ts.module.js.map diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.modern.mjs b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.modern.mjs deleted file mode 100644 index b2c9f0365e919dc06bc9310e8da6483cc4d0c65d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{formatIssue as r}from"@effect/schema/ArrayFormatter";import{decodeUnknown as e}from"@effect/schema/ParseResult";import{toNestErrors as o,validateFieldsNatively as s}from"@hookform/resolvers";import*as t from"effect/Effect";const a=(a,m={errors:"all",onExcessProperty:"ignore"})=>(c,f,i)=>e(a,m)(c).pipe(t.catchAll(e=>t.flip(r(e))),t.mapError(r=>{const e=r.reduce((r,e)=>(r[e.path.join(".")]={message:e.message,type:e._tag},r),{});return o(e,i)}),t.tap(()=>t.sync(()=>i.shouldUseNativeValidation&&s({},i))),t.match({onFailure:r=>({errors:r,values:{}}),onSuccess:r=>({errors:{},values:r})}),t.runPromise);export{a as effectTsResolver}; -//# sourceMappingURL=effect-ts.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.modern.mjs.map b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.modern.mjs.map deleted file mode 100644 index 95bf092590773ea451d2becb1dc86e35948fb5c6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"effect-ts.modern.mjs","sources":["../src/effect-ts.ts"],"sourcesContent":["import { formatIssue } from '@effect/schema/ArrayFormatter';\nimport { decodeUnknown } from '@effect/schema/ParseResult';\nimport { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Effect from 'effect/Effect';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nexport const effectTsResolver: Resolver =\n (schema, config = { errors: 'all', onExcessProperty: 'ignore' }) =>\n (values, _, options) => {\n return decodeUnknown(\n schema,\n config,\n )(values).pipe(\n Effect.catchAll((parseIssue) => Effect.flip(formatIssue(parseIssue))),\n Effect.mapError((issues) => {\n const errors = issues.reduce((acc, current) => {\n const key = current.path.join('.');\n acc[key] = { message: current.message, type: current._tag };\n return acc;\n }, {} as FieldErrors);\n\n return toNestErrors(errors, options);\n }),\n Effect.tap(() =>\n Effect.sync(\n () =>\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options),\n ),\n ),\n Effect.match({\n onFailure: (errors) => ({ errors, values: {} }),\n onSuccess: (result) => ({ errors: {}, values: result }),\n }),\n Effect.runPromise,\n );\n };\n"],"names":["effectTsResolver","schema","config","errors","onExcessProperty","values","_","options","decodeUnknown","pipe","Effect","catchAll","parseIssue","flip","formatIssue","mapError","issues","reduce","acc","current","path","join","message","type","_tag","toNestErrors","tap","sync","shouldUseNativeValidation","validateFieldsNatively","match","onFailure","onSuccess","result","runPromise"],"mappings":"sOAOa,MAAAA,EACXA,CAACC,EAAQC,EAAS,CAAEC,OAAQ,MAAOC,iBAAkB,YACrD,CAACC,EAAQC,EAAGC,IACHC,EACLP,EACAC,EAFKM,CAGLH,GAAQI,KACRC,EAAOC,SAAUC,GAAeF,EAAOG,KAAKC,EAAYF,KACxDF,EAAOK,SAAUC,IACf,MAAMb,EAASa,EAAOC,OAAO,CAACC,EAAKC,KAEjCD,EADYC,EAAQC,KAAKC,KAAK,MACnB,CAAEC,QAASH,EAAQG,QAASC,KAAMJ,EAAQK,MAC9CN,GACN,CAAiB,GAEpB,OAAOO,EAAatB,EAAQI,EAAO,GAErCG,EAAOgB,IAAI,IACThB,EAAOiB,KACL,IACEpB,EAAQqB,2BACRC,EAAuB,CAAE,EAAEtB,KAGjCG,EAAOoB,MAAM,CACXC,UAAY5B,IAAY,CAAEA,SAAQE,OAAQ,KAC1C2B,UAAYC,IAAM,CAAQ9B,OAAQ,GAAIE,OAAQ4B,MAEhDvB,EAAOwB"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.module.js b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.module.js deleted file mode 100644 index e59361f8a5d666cf6b6d50167aa6b35f4bed2b2b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{formatIssue as r}from"@effect/schema/ArrayFormatter";import{decodeUnknown as e}from"@effect/schema/ParseResult";import{toNestErrors as t,validateFieldsNatively as o}from"@hookform/resolvers";import*as n from"effect/Effect";var u=function(u,s){return void 0===s&&(s={errors:"all",onExcessProperty:"ignore"}),function(a,c,f){return e(u,s)(a).pipe(n.catchAll(function(e){return n.flip(r(e))}),n.mapError(function(r){var e=r.reduce(function(r,e){return r[e.path.join(".")]={message:e.message,type:e._tag},r},{});return t(e,f)}),n.tap(function(){return n.sync(function(){return f.shouldUseNativeValidation&&o({},f)})}),n.match({onFailure:function(r){return{errors:r,values:{}}},onSuccess:function(r){return{errors:{},values:r}}}),n.runPromise)}};export{u as effectTsResolver}; -//# sourceMappingURL=effect-ts.module.js.map diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.module.js.map b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.module.js.map deleted file mode 100644 index 864e932f0337114f66c660c6aa8dd1d9e90104eb..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"effect-ts.module.js","sources":["../src/effect-ts.ts"],"sourcesContent":["import { formatIssue } from '@effect/schema/ArrayFormatter';\nimport { decodeUnknown } from '@effect/schema/ParseResult';\nimport { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Effect from 'effect/Effect';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nexport const effectTsResolver: Resolver =\n (schema, config = { errors: 'all', onExcessProperty: 'ignore' }) =>\n (values, _, options) => {\n return decodeUnknown(\n schema,\n config,\n )(values).pipe(\n Effect.catchAll((parseIssue) => Effect.flip(formatIssue(parseIssue))),\n Effect.mapError((issues) => {\n const errors = issues.reduce((acc, current) => {\n const key = current.path.join('.');\n acc[key] = { message: current.message, type: current._tag };\n return acc;\n }, {} as FieldErrors);\n\n return toNestErrors(errors, options);\n }),\n Effect.tap(() =>\n Effect.sync(\n () =>\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options),\n ),\n ),\n Effect.match({\n onFailure: (errors) => ({ errors, values: {} }),\n onSuccess: (result) => ({ errors: {}, values: result }),\n }),\n Effect.runPromise,\n );\n };\n"],"names":["effectTsResolver","schema","config","errors","onExcessProperty","values","_","options","decodeUnknown","pipe","Effect","catchAll","parseIssue","flip","formatIssue","mapError","issues","reduce","acc","current","path","join","message","type","_tag","toNestErrors","tap","sync","shouldUseNativeValidation","validateFieldsNatively","match","onFailure","onSuccess","result","runPromise"],"mappings":"sOAOa,IAAAA,EACX,SAACC,EAAQC,GAAsD,YAAtDA,IAAAA,IAAAA,EAAS,CAAEC,OAAQ,MAAOC,iBAAkB,WACpDC,SAAAA,EAAQC,EAAGC,GACV,OAAOC,EACLP,EACAC,EAFKM,CAGLH,GAAQI,KACRC,EAAOC,SAAS,SAACC,GAAe,OAAAF,EAAOG,KAAKC,EAAYF,GAAY,GACpEF,EAAOK,SAAS,SAACC,GACf,IAAMb,EAASa,EAAOC,OAAO,SAACC,EAAKC,GAGjC,OADAD,EADYC,EAAQC,KAAKC,KAAK,MACnB,CAAEC,QAASH,EAAQG,QAASC,KAAMJ,EAAQK,MAC9CN,CACT,EAAG,CAAA,GAEH,OAAOO,EAAatB,EAAQI,EAC9B,GACAG,EAAOgB,IAAI,WACT,OAAAhB,EAAOiB,KACL,WACE,OAAApB,EAAQqB,2BACRC,EAAuB,CAAA,EAAItB,EAAQ,EACtC,GAEHG,EAAOoB,MAAM,CACXC,UAAW,SAAC5B,GAAY,MAAA,CAAEA,OAAAA,EAAQE,OAAQ,CAAA,EAAI,EAC9C2B,UAAW,SAACC,GAAM,MAAM,CAAE9B,OAAQ,CAAA,EAAIE,OAAQ4B,EAAQ,IAExDvB,EAAOwB,WAEX,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.umd.js b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.umd.js deleted file mode 100644 index 4de4a11c76a58e11742906c12a5ff4fb30967fa6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@effect/schema/ArrayFormatter"),require("@effect/schema/ParseResult"),require("@hookform/resolvers"),require("effect/Effect")):"function"==typeof define&&define.amd?define(["exports","@effect/schema/ArrayFormatter","@effect/schema/ParseResult","@hookform/resolvers","effect/Effect"],r):r((e||self).hookformResolversEffectTs={},e.EffectSchemaArrayFormatter,e.EffectSchemaArrayFormatter,e.hookformResolvers,e.Effect)}(this,function(e,r,t,o,n){function f(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var c=/*#__PURE__*/f(n);e.effectTsResolver=function(e,n){return void 0===n&&(n={errors:"all",onExcessProperty:"ignore"}),function(f,s,u){return t.decodeUnknown(e,n)(f).pipe(c.catchAll(function(e){return c.flip(r.formatIssue(e))}),c.mapError(function(e){var r=e.reduce(function(e,r){return e[r.path.join(".")]={message:r.message,type:r._tag},e},{});return o.toNestErrors(r,u)}),c.tap(function(){return c.sync(function(){return u.shouldUseNativeValidation&&o.validateFieldsNatively({},u)})}),c.match({onFailure:function(e){return{errors:e,values:{}}},onSuccess:function(e){return{errors:{},values:e}}}),c.runPromise)}}}); -//# sourceMappingURL=effect-ts.umd.js.map diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.umd.js.map b/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.umd.js.map deleted file mode 100644 index 1297fb60d0bec4b3796a72d2fcd55497924346bd..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/effect-ts.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"effect-ts.umd.js","sources":["../src/effect-ts.ts"],"sourcesContent":["import { formatIssue } from '@effect/schema/ArrayFormatter';\nimport { decodeUnknown } from '@effect/schema/ParseResult';\nimport { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Effect from 'effect/Effect';\nimport type { FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nexport const effectTsResolver: Resolver =\n (schema, config = { errors: 'all', onExcessProperty: 'ignore' }) =>\n (values, _, options) => {\n return decodeUnknown(\n schema,\n config,\n )(values).pipe(\n Effect.catchAll((parseIssue) => Effect.flip(formatIssue(parseIssue))),\n Effect.mapError((issues) => {\n const errors = issues.reduce((acc, current) => {\n const key = current.path.join('.');\n acc[key] = { message: current.message, type: current._tag };\n return acc;\n }, {} as FieldErrors);\n\n return toNestErrors(errors, options);\n }),\n Effect.tap(() =>\n Effect.sync(\n () =>\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options),\n ),\n ),\n Effect.match({\n onFailure: (errors) => ({ errors, values: {} }),\n onSuccess: (result) => ({ errors: {}, values: result }),\n }),\n Effect.runPromise,\n );\n };\n"],"names":["schema","config","errors","onExcessProperty","values","_","options","decodeUnknown","pipe","Effect","catchAll","parseIssue","flip","formatIssue","mapError","issues","reduce","acc","current","path","join","message","type","_tag","toNestErrors","tap","sync","shouldUseNativeValidation","validateFieldsNatively","match","onFailure","onSuccess","result","runPromise"],"mappings":"q3BAQE,SAACA,EAAQC,GAAsD,YAAtDA,IAAAA,IAAAA,EAAS,CAAEC,OAAQ,MAAOC,iBAAkB,WACpDC,SAAAA,EAAQC,EAAGC,GACV,OAAOC,EAAAA,cACLP,EACAC,EAFKM,CAGLH,GAAQI,KACRC,EAAOC,SAAS,SAACC,GAAe,OAAAF,EAAOG,KAAKC,EAAWA,YAACF,GAAY,GACpEF,EAAOK,SAAS,SAACC,GACf,IAAMb,EAASa,EAAOC,OAAO,SAACC,EAAKC,GAGjC,OADAD,EADYC,EAAQC,KAAKC,KAAK,MACnB,CAAEC,QAASH,EAAQG,QAASC,KAAMJ,EAAQK,MAC9CN,CACT,EAAG,CAAA,GAEH,OAAOO,EAAYA,aAACtB,EAAQI,EAC9B,GACAG,EAAOgB,IAAI,WACT,OAAAhB,EAAOiB,KACL,WACE,OAAApB,EAAQqB,2BACRC,yBAAuB,CAAA,EAAItB,EAAQ,EACtC,GAEHG,EAAOoB,MAAM,CACXC,UAAW,SAAC5B,GAAY,MAAA,CAAEA,OAAAA,EAAQE,OAAQ,CAAA,EAAI,EAC9C2B,UAAW,SAACC,GAAM,MAAM,CAAE9B,OAAQ,CAAA,EAAIE,OAAQ4B,EAAQ,IAExDvB,EAAOwB,WAEX,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/index.d.ts b/node_modules/@hookform/resolvers/effect-ts/dist/index.d.ts deleted file mode 100644 index 58e89bf58dba1d762c021a95bfab09fc8916c3f4..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './effect-ts'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/effect-ts/dist/types.d.ts b/node_modules/@hookform/resolvers/effect-ts/dist/types.d.ts deleted file mode 100644 index 6882ff1b77a9e191cadf2b58023016519a38b79b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/dist/types.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Schema } from '@effect/schema'; -import { ParseOptions } from '@effect/schema/AST'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (schema: Schema.Schema, config?: ParseOptions) => (values: FieldValues, _context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/effect-ts/package.json b/node_modules/@hookform/resolvers/effect-ts/package.json deleted file mode 100644 index b29cc9295d02d5d52b418257677eebe47a44d981..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@hookform/resolvers/effect-ts", - "amdName": "hookformResolversEffectTs", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: effect-ts", - "main": "dist/effect-ts.js", - "module": "dist/effect-ts.module.js", - "umd:main": "dist/effect-ts.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "@hookform/resolvers": "^2.0.0", - "@effect/schema": "^0.66.14", - "effect": "^3.1.2", - "react-hook-form": "^7.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/effect-ts/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 2f7ef231cd63163fd9d7d80ea84a6a14134a056a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { Schema } from '@effect/schema'; -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { effectTsResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = Schema.Struct({ - username: Schema.String.pipe( - Schema.nonEmpty({ message: () => USERNAME_REQUIRED_MESSAGE }), - ), - password: Schema.String.pipe( - Schema.nonEmpty({ message: () => PASSWORD_REQUIRED_MESSAGE }), - ), -}); - -interface FormData { - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: effectTsResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with effect-ts", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/effect-ts/src/__tests__/Form.tsx deleted file mode 100644 index ee6a84a545314e874e725172a21e4618f6432077..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/Form.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { Schema } from '@effect/schema'; -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { effectTsResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = Schema.Struct({ - username: Schema.String.pipe( - Schema.nonEmpty({ message: () => USERNAME_REQUIRED_MESSAGE }), - ), - password: Schema.String.pipe( - Schema.nonEmpty({ message: () => PASSWORD_REQUIRED_MESSAGE }), - ), -}); - -type FormData = Schema.Schema.Type; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: effectTsResolver(schema), - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Zod and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/password field is required/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/effect-ts/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index a74af9e64d65e852d7ed008707f1b98cea27476f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { Schema } from '@effect/schema'; -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = Schema.Struct({ - username: Schema.String.pipe( - Schema.nonEmpty({ message: () => 'A username is required' }), - ), - password: Schema.String.pipe( - Schema.pattern(new RegExp('.*[A-Z].*'), { - message: () => 'At least 1 uppercase letter.', - }), - Schema.pattern(new RegExp('.*[a-z].*'), { - message: () => 'At least 1 lowercase letter.', - }), - Schema.pattern(new RegExp('.*\\d.*'), { - message: () => 'At least 1 number.', - }), - Schema.pattern( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - { - message: () => 'At least 1 special character.', - }, - ), - Schema.minLength(8, { message: () => 'Must be at least 8 characters.' }), - ), - accessToken: Schema.Union(Schema.String, Schema.Number), - birthYear: Schema.Number.pipe( - Schema.greaterThan(1900, { - message: () => 'Must be greater than the year 1900', - }), - Schema.filter((value) => value < new Date().getFullYear(), { - message: () => 'Must be before the current year.', - }), - ), - email: Schema.String.pipe( - Schema.pattern( - new RegExp( - /^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i, - ), - { - message: () => 'A valid email address is required.', - }, - ), - ), - tags: Schema.Array( - Schema.Struct({ - name: Schema.String, - }), - ), - luckyNumbers: Schema.Array(Schema.Number), - enabled: Schema.Boolean, - animal: Schema.Union(Schema.String, Schema.Literal('bird', 'snake')), - vehicles: Schema.Array( - Schema.Union( - Schema.Struct({ - type: Schema.Literal('car'), - brand: Schema.String, - horsepower: Schema.Number, - }), - Schema.Struct({ - type: Schema.Literal('bike'), - speed: Schema.Number, - }), - ), - ), -}); - -export const validData: Schema.Schema.Type = { - accessToken: 'abcd1234', - animal: 'dog', - birthYear: 2000, - email: 'johnDoe@here.there', - enabled: true, - luckyNumbers: [1, 2, 3, 4, 5], - password: 'Super#Secret123', - tags: [{ name: 'move' }, { name: 'over' }, { name: 'zod' }, { name: ';)' }], - username: 'johnDoe', - vehicles: [ - { type: 'bike', speed: 5 }, - { type: 'car', brand: 'BMW', horsepower: 150 }, - ], -}; - -export const invalidData = { - username: 'test', - password: 'Password123', - repeatPassword: 'Password123', - birthYear: 2000, - accessToken: '1015d809-e99d-41ec-b161-981a3c243df8', - email: 'john@doe.com', - tags: [{ name: 'test' }], - enabled: true, - animal: ['dog'], - luckyNumbers: [1, 2, '3'], - like: [ - { - id: '1', - name: 'name', - }, - ], - vehicles: [ - { type: 'car', brand: 'BMW', horsepower: 150 }, - { type: 'car', brand: 'Mercedes' }, - ], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/__snapshots__/effect-ts.ts.snap b/node_modules/@hookform/resolvers/effect-ts/src/__tests__/__snapshots__/effect-ts.ts.snap deleted file mode 100644 index 6d97f0e102914d3a408d3173048884b99d01d684..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/__snapshots__/effect-ts.ts.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`effectTsResolver > should return a single error from effectTsResolver when validation fails 1`] = ` -{ - "errors": { - "animal": { - "message": "Expected "snake", actual ["dog"]", - "ref": undefined, - "type": "Type", - }, - "luckyNumbers": [ - , - , - { - "message": "Expected number, actual "3"", - "ref": undefined, - "type": "Type", - }, - ], - "password": { - "message": "At least 1 special character.", - "ref": { - "name": "password", - }, - "type": "Refinement", - }, - "vehicles": [ - , - { - "horsepower": { - "message": "is missing", - "ref": undefined, - "type": "Missing", - }, - }, - ], - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/effect-ts.ts b/node_modules/@hookform/resolvers/effect-ts/src/__tests__/effect-ts.ts deleted file mode 100644 index 409adacde70620cb90c56bc01d75c02398f3f02c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/__tests__/effect-ts.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { effectTsResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('effectTsResolver', () => { - it('should return values from effectTsResolver when validation pass', async () => { - const result = await effectTsResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from effectTsResolver when validation fails', async () => { - const result = await effectTsResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); -}); diff --git a/node_modules/@hookform/resolvers/effect-ts/src/effect-ts.ts b/node_modules/@hookform/resolvers/effect-ts/src/effect-ts.ts deleted file mode 100644 index 0dc8f818e2d881efcc761a0337cc4596e4061a53..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/effect-ts.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { formatIssue } from '@effect/schema/ArrayFormatter'; -import { decodeUnknown } from '@effect/schema/ParseResult'; -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import * as Effect from 'effect/Effect'; -import type { FieldErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -export const effectTsResolver: Resolver = - (schema, config = { errors: 'all', onExcessProperty: 'ignore' }) => - (values, _, options) => { - return decodeUnknown( - schema, - config, - )(values).pipe( - Effect.catchAll((parseIssue) => Effect.flip(formatIssue(parseIssue))), - Effect.mapError((issues) => { - const errors = issues.reduce((acc, current) => { - const key = current.path.join('.'); - acc[key] = { message: current.message, type: current._tag }; - return acc; - }, {} as FieldErrors); - - return toNestErrors(errors, options); - }), - Effect.tap(() => - Effect.sync( - () => - options.shouldUseNativeValidation && - validateFieldsNatively({}, options), - ), - ), - Effect.match({ - onFailure: (errors) => ({ errors, values: {} }), - onSuccess: (result) => ({ errors: {}, values: result }), - }), - Effect.runPromise, - ); - }; diff --git a/node_modules/@hookform/resolvers/effect-ts/src/index.ts b/node_modules/@hookform/resolvers/effect-ts/src/index.ts deleted file mode 100644 index 58e89bf58dba1d762c021a95bfab09fc8916c3f4..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './effect-ts'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/effect-ts/src/types.ts b/node_modules/@hookform/resolvers/effect-ts/src/types.ts deleted file mode 100644 index 25b6d367606bef0a228682c34e91461558f55822..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/effect-ts/src/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Schema } from '@effect/schema'; -import { ParseOptions } from '@effect/schema/AST'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver =
( - schema: Schema.Schema, - config?: ParseOptions, -) => ( - values: FieldValues, - _context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.d.ts b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.d.ts deleted file mode 100644 index 5ca22ceff65af0ade150482f8267796d8cdedee2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { AsyncValidator, Validator } from 'fluentvalidation-ts'; -import { FieldValues, Resolver } from 'react-hook-form'; -export declare function fluentValidationResolver(validator: Validator): Resolver; -export declare function fluentAsyncValidationResolver>(validator: TValidator): Resolver; diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.js b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.js deleted file mode 100644 index 6f9ba9750c1d42dbe11ac2a724766016938811d2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers");function e(r,t,o){void 0===o&&(o=[]);var n=function(){var n=[].concat(o,[a]),i=r[a];Array.isArray(i)?i.forEach(function(r,o){e(r,t,[].concat(n,[o]))}):"object"==typeof i&&null!==i?e(i,t,n):"string"==typeof i&&(t[n.join(".")]={type:"validation",message:i})};for(var a in r)n()}var t=function(r,t){var o={};return e(r,o),o};exports.fluentAsyncValidationResolver=function(e){return function(o,n,a){try{return Promise.resolve(e.validateAsync(o)).then(function(e){var n=0===Object.keys(e).length;return a.shouldUseNativeValidation&&r.validateFieldsNatively({},a),n?{values:o,errors:{}}:{values:{},errors:r.toNestErrors(t(e),a)}})}catch(r){return Promise.reject(r)}}},exports.fluentValidationResolver=function(e){return function(o,n,a){try{var i=e.validate(o),s=0===Object.keys(i).length;return a.shouldUseNativeValidation&&r.validateFieldsNatively({},a),Promise.resolve(s?{values:o,errors:{}}:{values:{},errors:r.toNestErrors(t(i),a)})}catch(r){return Promise.reject(r)}}}; -//# sourceMappingURL=fluentvalidation-ts.js.map diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.js.map b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.js.map deleted file mode 100644 index 7bce1b97e74731bd53dabd3f30bb73808ac8f113..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fluentvalidation-ts.js","sources":["../src/fluentvalidation-ts.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n AsyncValidator,\n ValidationErrors,\n Validator,\n} from 'fluentvalidation-ts';\nimport { FieldError, FieldValues, Resolver } from 'react-hook-form';\n\nfunction traverseObject(\n object: ValidationErrors,\n errors: Record,\n parentIndices: (string | number)[] = [],\n) {\n for (const key in object) {\n const currentIndex = [...parentIndices, key];\n const currentValue = object[key];\n\n if (Array.isArray(currentValue)) {\n currentValue.forEach((item: any, index: number) => {\n traverseObject(item, errors, [...currentIndex, index]);\n });\n } else if (typeof currentValue === 'object' && currentValue !== null) {\n traverseObject(currentValue, errors, currentIndex);\n } else if (typeof currentValue === 'string') {\n errors[currentIndex.join('.')] = {\n type: 'validation',\n message: currentValue,\n };\n }\n }\n}\n\nconst parseErrorSchema = (\n validationErrors: ValidationErrors,\n validateAllFieldCriteria: boolean,\n) => {\n if (validateAllFieldCriteria) {\n // TODO: check this but i think its always one validation error\n }\n\n const errors: Record = {};\n traverseObject(validationErrors, errors);\n\n return errors;\n};\n\nexport function fluentValidationResolver(\n validator: Validator,\n): Resolver {\n return async (values, _context, options) => {\n const validationResult = validator.validate(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n\nexport function fluentAsyncValidationResolver<\n TFieldValues extends FieldValues,\n TValidator extends AsyncValidator,\n>(validator: TValidator): Resolver {\n return async (values, _context, options) => {\n const validationResult = await validator.validateAsync(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n"],"names":["traverseObject","object","errors","parentIndices","_loop","currentIndex","concat","key","currentValue","Array","isArray","forEach","item","index","join","type","message","parseErrorSchema","validationErrors","validateAllFieldCriteria","validator","values","_context","options","Promise","resolve","validateAsync","then","validationResult","isValid","Object","keys","length","shouldUseNativeValidation","validateFieldsNatively","toNestErrors","e","reject","validate"],"mappings":"qCAQA,SAASA,EACPC,EACAC,EACAC,YAAAA,IAAAA,EAAqC,IAAE,IAAAC,EAAAA,WAGrC,IAAMC,EAAY,GAAAC,OAAOH,EAAa,CAAEI,IAClCC,EAAeP,EAAOM,GAExBE,MAAMC,QAAQF,GAChBA,EAAaG,QAAQ,SAACC,EAAWC,GAC/Bb,EAAeY,EAAMV,EAAM,GAAAI,OAAMD,EAAcQ,CAAAA,IACjD,GACiC,iBAAjBL,GAA8C,OAAjBA,EAC7CR,EAAeQ,EAAcN,EAAQG,GACJ,iBAAjBG,IAChBN,EAAOG,EAAaS,KAAK,MAAQ,CAC/BC,KAAM,aACNC,QAASR,GAGf,EAhBA,IAAK,IAAMD,KAAON,EAAMG,GAiB1B,CAEA,IAAMa,EAAmB,SACvBC,EACAC,GAMA,IAAMjB,EAAqC,GAG3C,OAFAF,EAAekB,EAAkBhB,GAE1BA,CACT,wCA8BgB,SAGdkB,GACA,OAAcC,SAAAA,EAAQC,EAAUC,GAAW,IAAA,OAAAC,QAAAC,QACVL,EAAUM,cAAcL,IAAOM,KAAA,SAAxDC,GACN,IAAMC,EAAmD,IAAzCC,OAAOC,KAAKH,GAAkBI,OAI9C,OAFAT,EAAQU,2BAA6BC,yBAAuB,CAAA,EAAIX,GAEzDM,EACH,CACER,OAAQA,EACRnB,OAAQ,CACT,GACD,CACEmB,OAAQ,CAAA,EACRnB,OAAQiC,EAAYA,aAClBlB,EACEW,GAIFL,GAEF,EACR,CAAC,MAAAa,GAAA,OAAAZ,QAAAa,OAAAD,EACH,CAAA,CAAA,mCAvDgB,SACdhB,GAEA,OAAcC,SAAAA,EAAQC,EAAUC,GAAW,IACzC,IAAMK,EAAmBR,EAAUkB,SAASjB,GACtCQ,EAAmD,IAAzCC,OAAOC,KAAKH,GAAkBI,OAI9C,OAFAT,EAAQU,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEX,GAEhEC,QAAAC,QAAOI,EACH,CACER,OAAQA,EACRnB,OAAQ,CAAA,GAEV,CACEmB,OAAQ,CAAA,EACRnB,OAAQiC,EAAAA,aACNlB,EACEW,GAIFL,IAGV,CAAC,MAAAa,GAAA,OAAAZ,QAAAa,OAAAD,EACH,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.mjs b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.mjs deleted file mode 100644 index a5adaf0d36d8c7d17052495bcb26e90919e2be6f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";function t(r,e,o){void 0===o&&(o=[]);var n=function(){var n=[].concat(o,[a]),i=r[a];Array.isArray(i)?i.forEach(function(r,o){t(r,e,[].concat(n,[o]))}):"object"==typeof i&&null!==i?t(i,e,n):"string"==typeof i&&(e[n.join(".")]={type:"validation",message:i})};for(var a in r)n()}var o=function(r,e){var o={};return t(r,o),o};function n(t){return function(n,a,i){try{var s=t.validate(n),c=0===Object.keys(s).length;return i.shouldUseNativeValidation&&r({},i),Promise.resolve(c?{values:n,errors:{}}:{values:{},errors:e(o(s),i)})}catch(r){return Promise.reject(r)}}}function a(t){return function(n,a,i){try{return Promise.resolve(t.validateAsync(n)).then(function(t){var a=0===Object.keys(t).length;return i.shouldUseNativeValidation&&r({},i),a?{values:n,errors:{}}:{values:{},errors:e(o(t),i)}})}catch(r){return Promise.reject(r)}}}export{a as fluentAsyncValidationResolver,n as fluentValidationResolver}; -//# sourceMappingURL=fluentvalidation-ts.module.js.map diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs deleted file mode 100644 index ec55a7065d51e4b12650ce02a4c20d4e17cd4aa2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";function t(r,e,o=[]){for(const n in r){const s=[...o,n],a=r[n];Array.isArray(a)?a.forEach((r,o)=>{t(r,e,[...s,o])}):"object"==typeof a&&null!==a?t(a,e,s):"string"==typeof a&&(e[s.join(".")]={type:"validation",message:a})}}const o=(r,e)=>{const o={};return t(r,o),o};function n(t){return async(n,s,a)=>{const i=t.validate(n),c=0===Object.keys(i).length;return a.shouldUseNativeValidation&&r({},a),c?{values:n,errors:{}}:{values:{},errors:e(o(i),a)}}}function s(t){return async(n,s,a)=>{const i=await t.validateAsync(n),c=0===Object.keys(i).length;return a.shouldUseNativeValidation&&r({},a),c?{values:n,errors:{}}:{values:{},errors:e(o(i),a)}}}export{s as fluentAsyncValidationResolver,n as fluentValidationResolver}; -//# sourceMappingURL=fluentvalidation-ts.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs.map b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs.map deleted file mode 100644 index 7bad58aff205a202ab5df83f1c3d15e9bed3a8c0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fluentvalidation-ts.modern.mjs","sources":["../src/fluentvalidation-ts.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n AsyncValidator,\n ValidationErrors,\n Validator,\n} from 'fluentvalidation-ts';\nimport { FieldError, FieldValues, Resolver } from 'react-hook-form';\n\nfunction traverseObject(\n object: ValidationErrors,\n errors: Record,\n parentIndices: (string | number)[] = [],\n) {\n for (const key in object) {\n const currentIndex = [...parentIndices, key];\n const currentValue = object[key];\n\n if (Array.isArray(currentValue)) {\n currentValue.forEach((item: any, index: number) => {\n traverseObject(item, errors, [...currentIndex, index]);\n });\n } else if (typeof currentValue === 'object' && currentValue !== null) {\n traverseObject(currentValue, errors, currentIndex);\n } else if (typeof currentValue === 'string') {\n errors[currentIndex.join('.')] = {\n type: 'validation',\n message: currentValue,\n };\n }\n }\n}\n\nconst parseErrorSchema = (\n validationErrors: ValidationErrors,\n validateAllFieldCriteria: boolean,\n) => {\n if (validateAllFieldCriteria) {\n // TODO: check this but i think its always one validation error\n }\n\n const errors: Record = {};\n traverseObject(validationErrors, errors);\n\n return errors;\n};\n\nexport function fluentValidationResolver(\n validator: Validator,\n): Resolver {\n return async (values, _context, options) => {\n const validationResult = validator.validate(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n\nexport function fluentAsyncValidationResolver<\n TFieldValues extends FieldValues,\n TValidator extends AsyncValidator,\n>(validator: TValidator): Resolver {\n return async (values, _context, options) => {\n const validationResult = await validator.validateAsync(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n"],"names":["traverseObject","object","errors","parentIndices","key","currentIndex","currentValue","Array","isArray","forEach","item","index","join","type","message","parseErrorSchema","validationErrors","validateAllFieldCriteria","fluentValidationResolver","validator","async","values","_context","options","validationResult","validate","isValid","Object","keys","length","shouldUseNativeValidation","validateFieldsNatively","toNestErrors","fluentAsyncValidationResolver","validateAsync"],"mappings":"+EAQA,SAASA,EACPC,EACAC,EACAC,EAAqC,IAErC,IAAK,MAAMC,KAAOH,EAAQ,CACxB,MAAMI,EAAe,IAAIF,EAAeC,GAClCE,EAAeL,EAAOG,GAExBG,MAAMC,QAAQF,GAChBA,EAAaG,QAAQ,CAACC,EAAWC,KAC/BX,EAAeU,EAAMR,EAAQ,IAAIG,EAAcM,GAAM,GAEtB,iBAAjBL,GAA8C,OAAjBA,EAC7CN,EAAeM,EAAcJ,EAAQG,GACJ,iBAAjBC,IAChBJ,EAAOG,EAAaO,KAAK,MAAQ,CAC/BC,KAAM,aACNC,QAASR,GAGf,CACF,CAEA,MAAMS,EAAmBA,CACvBC,EACAC,KAMA,MAAMf,EAAqC,CAAA,EAG3C,OAFAF,EAAegB,EAAkBd,GAE1BA,YAGOgB,EACdC,GAEA,OAAOC,MAAOC,EAAQC,EAAUC,KAC9B,MAAMC,EAAmBL,EAAUM,SAASJ,GACtCK,EAAmD,IAAzCC,OAAOC,KAAKJ,GAAkBK,OAI9C,OAFAN,EAAQO,2BAA6BC,EAAuB,CAAE,EAAER,GAEzDG,EACH,CACEL,OAAQA,EACRnB,OAAQ,CAAA,GAEV,CACEmB,OAAQ,CAAE,EACVnB,OAAQ8B,EACNjB,EACES,GAIFD,IAIZ,CAEgB,SAAAU,EAGdd,GACA,OAAcE,MAAAA,EAAQC,EAAUC,KAC9B,MAAMC,QAAyBL,EAAUe,cAAcb,GACjDK,EAAmD,IAAzCC,OAAOC,KAAKJ,GAAkBK,OAI9C,OAFAN,EAAQO,2BAA6BC,EAAuB,CAAE,EAAER,GAEzDG,EACH,CACEL,OAAQA,EACRnB,OAAQ,CACT,GACD,CACEmB,OAAQ,CAAA,EACRnB,OAAQ8B,EACNjB,EACES,GAIFD,IAIZ"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.module.js b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.module.js deleted file mode 100644 index a5adaf0d36d8c7d17052495bcb26e90919e2be6f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";function t(r,e,o){void 0===o&&(o=[]);var n=function(){var n=[].concat(o,[a]),i=r[a];Array.isArray(i)?i.forEach(function(r,o){t(r,e,[].concat(n,[o]))}):"object"==typeof i&&null!==i?t(i,e,n):"string"==typeof i&&(e[n.join(".")]={type:"validation",message:i})};for(var a in r)n()}var o=function(r,e){var o={};return t(r,o),o};function n(t){return function(n,a,i){try{var s=t.validate(n),c=0===Object.keys(s).length;return i.shouldUseNativeValidation&&r({},i),Promise.resolve(c?{values:n,errors:{}}:{values:{},errors:e(o(s),i)})}catch(r){return Promise.reject(r)}}}function a(t){return function(n,a,i){try{return Promise.resolve(t.validateAsync(n)).then(function(t){var a=0===Object.keys(t).length;return i.shouldUseNativeValidation&&r({},i),a?{values:n,errors:{}}:{values:{},errors:e(o(t),i)}})}catch(r){return Promise.reject(r)}}}export{a as fluentAsyncValidationResolver,n as fluentValidationResolver}; -//# sourceMappingURL=fluentvalidation-ts.module.js.map diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.module.js.map b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.module.js.map deleted file mode 100644 index 5605b87f6c0d4aa05bbb6f56eb95e9053e2ccec8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fluentvalidation-ts.module.js","sources":["../src/fluentvalidation-ts.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n AsyncValidator,\n ValidationErrors,\n Validator,\n} from 'fluentvalidation-ts';\nimport { FieldError, FieldValues, Resolver } from 'react-hook-form';\n\nfunction traverseObject(\n object: ValidationErrors,\n errors: Record,\n parentIndices: (string | number)[] = [],\n) {\n for (const key in object) {\n const currentIndex = [...parentIndices, key];\n const currentValue = object[key];\n\n if (Array.isArray(currentValue)) {\n currentValue.forEach((item: any, index: number) => {\n traverseObject(item, errors, [...currentIndex, index]);\n });\n } else if (typeof currentValue === 'object' && currentValue !== null) {\n traverseObject(currentValue, errors, currentIndex);\n } else if (typeof currentValue === 'string') {\n errors[currentIndex.join('.')] = {\n type: 'validation',\n message: currentValue,\n };\n }\n }\n}\n\nconst parseErrorSchema = (\n validationErrors: ValidationErrors,\n validateAllFieldCriteria: boolean,\n) => {\n if (validateAllFieldCriteria) {\n // TODO: check this but i think its always one validation error\n }\n\n const errors: Record = {};\n traverseObject(validationErrors, errors);\n\n return errors;\n};\n\nexport function fluentValidationResolver(\n validator: Validator,\n): Resolver {\n return async (values, _context, options) => {\n const validationResult = validator.validate(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n\nexport function fluentAsyncValidationResolver<\n TFieldValues extends FieldValues,\n TValidator extends AsyncValidator,\n>(validator: TValidator): Resolver {\n return async (values, _context, options) => {\n const validationResult = await validator.validateAsync(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n"],"names":["traverseObject","object","errors","parentIndices","_loop","currentIndex","concat","key","currentValue","Array","isArray","forEach","item","index","join","type","message","parseErrorSchema","validationErrors","validateAllFieldCriteria","fluentValidationResolver","validator","values","_context","options","validationResult","validate","isValid","Object","keys","length","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","toNestErrors","e","reject","fluentAsyncValidationResolver","validateAsync","then"],"mappings":"+EAQA,SAASA,EACPC,EACAC,EACAC,YAAAA,IAAAA,EAAqC,IAAE,IAAAC,EAAAA,WAGrC,IAAMC,EAAY,GAAAC,OAAOH,EAAa,CAAEI,IAClCC,EAAeP,EAAOM,GAExBE,MAAMC,QAAQF,GAChBA,EAAaG,QAAQ,SAACC,EAAWC,GAC/Bb,EAAeY,EAAMV,EAAM,GAAAI,OAAMD,EAAcQ,CAAAA,IACjD,GACiC,iBAAjBL,GAA8C,OAAjBA,EAC7CR,EAAeQ,EAAcN,EAAQG,GACJ,iBAAjBG,IAChBN,EAAOG,EAAaS,KAAK,MAAQ,CAC/BC,KAAM,aACNC,QAASR,GAGf,EAhBA,IAAK,IAAMD,KAAON,EAAMG,GAiB1B,CAEA,IAAMa,EAAmB,SACvBC,EACAC,GAMA,IAAMjB,EAAqC,GAG3C,OAFAF,EAAekB,EAAkBhB,GAE1BA,CACT,EAEgB,SAAAkB,EACdC,GAEA,OAAcC,SAAAA,EAAQC,EAAUC,GAAW,IACzC,IAAMC,EAAmBJ,EAAUK,SAASJ,GACtCK,EAAmD,IAAzCC,OAAOC,KAAKJ,GAAkBK,OAI9C,OAFAN,EAAQO,2BAA6BC,EAAuB,CAAE,EAAER,GAEhES,QAAAC,QAAOP,EACH,CACEL,OAAQA,EACRpB,OAAQ,CAAA,GAEV,CACEoB,OAAQ,CAAA,EACRpB,OAAQiC,EACNlB,EACEQ,GAIFD,IAGV,CAAC,MAAAY,GAAA,OAAAH,QAAAI,OAAAD,EACH,CAAA,CAAA,CAEgB,SAAAE,EAGdjB,GACA,OAAcC,SAAAA,EAAQC,EAAUC,GAAW,IAAA,OAAAS,QAAAC,QACVb,EAAUkB,cAAcjB,IAAOkB,KAAA,SAAxDf,GACN,IAAME,EAAmD,IAAzCC,OAAOC,KAAKJ,GAAkBK,OAI9C,OAFAN,EAAQO,2BAA6BC,EAAuB,CAAA,EAAIR,GAEzDG,EACH,CACEL,OAAQA,EACRpB,OAAQ,CACT,GACD,CACEoB,OAAQ,CAAA,EACRpB,OAAQiC,EACNlB,EACEQ,GAIFD,GAEF,EACR,CAAC,MAAAY,GAAA,OAAAH,QAAAI,OAAAD,EACH,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js deleted file mode 100644 index fe886587be7a22940da542dc0e8b787dadb2227f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers"],r):r((e||self)["hookformResolversfluentvalidation-ts"]={},e.hookformResolvers)}(this,function(e,r){function o(e,r,t){void 0===t&&(t=[]);var n=function(){var n=[].concat(t,[i]),s=e[i];Array.isArray(s)?s.forEach(function(e,t){o(e,r,[].concat(n,[t]))}):"object"==typeof s&&null!==s?o(s,r,n):"string"==typeof s&&(r[n.join(".")]={type:"validation",message:s})};for(var i in e)n()}var t=function(e,r){var t={};return o(e,t),t};e.fluentAsyncValidationResolver=function(e){return function(o,n,i){try{return Promise.resolve(e.validateAsync(o)).then(function(e){var n=0===Object.keys(e).length;return i.shouldUseNativeValidation&&r.validateFieldsNatively({},i),n?{values:o,errors:{}}:{values:{},errors:r.toNestErrors(t(e),i)}})}catch(e){return Promise.reject(e)}}},e.fluentValidationResolver=function(e){return function(o,n,i){try{var s=e.validate(o),a=0===Object.keys(s).length;return i.shouldUseNativeValidation&&r.validateFieldsNatively({},i),Promise.resolve(a?{values:o,errors:{}}:{values:{},errors:r.toNestErrors(t(s),i)})}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=fluentvalidation-ts.umd.js.map diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js.map b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js.map deleted file mode 100644 index baeb906c27a0c4b14a5e7f128c4bf5fbdd825f9b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fluentvalidation-ts.umd.js","sources":["../src/fluentvalidation-ts.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n AsyncValidator,\n ValidationErrors,\n Validator,\n} from 'fluentvalidation-ts';\nimport { FieldError, FieldValues, Resolver } from 'react-hook-form';\n\nfunction traverseObject(\n object: ValidationErrors,\n errors: Record,\n parentIndices: (string | number)[] = [],\n) {\n for (const key in object) {\n const currentIndex = [...parentIndices, key];\n const currentValue = object[key];\n\n if (Array.isArray(currentValue)) {\n currentValue.forEach((item: any, index: number) => {\n traverseObject(item, errors, [...currentIndex, index]);\n });\n } else if (typeof currentValue === 'object' && currentValue !== null) {\n traverseObject(currentValue, errors, currentIndex);\n } else if (typeof currentValue === 'string') {\n errors[currentIndex.join('.')] = {\n type: 'validation',\n message: currentValue,\n };\n }\n }\n}\n\nconst parseErrorSchema = (\n validationErrors: ValidationErrors,\n validateAllFieldCriteria: boolean,\n) => {\n if (validateAllFieldCriteria) {\n // TODO: check this but i think its always one validation error\n }\n\n const errors: Record = {};\n traverseObject(validationErrors, errors);\n\n return errors;\n};\n\nexport function fluentValidationResolver(\n validator: Validator,\n): Resolver {\n return async (values, _context, options) => {\n const validationResult = validator.validate(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n\nexport function fluentAsyncValidationResolver<\n TFieldValues extends FieldValues,\n TValidator extends AsyncValidator,\n>(validator: TValidator): Resolver {\n return async (values, _context, options) => {\n const validationResult = await validator.validateAsync(values);\n const isValid = Object.keys(validationResult).length === 0;\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return isValid\n ? {\n values: values,\n errors: {},\n }\n : {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n validationResult,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n}\n"],"names":["traverseObject","object","errors","parentIndices","_loop","currentIndex","concat","key","currentValue","Array","isArray","forEach","item","index","join","type","message","parseErrorSchema","validationErrors","validateAllFieldCriteria","validator","values","_context","options","Promise","resolve","validateAsync","then","validationResult","isValid","Object","keys","length","shouldUseNativeValidation","validateFieldsNatively","toNestErrors","e","reject","validate"],"mappings":"4UAQA,SAASA,EACPC,EACAC,EACAC,YAAAA,IAAAA,EAAqC,IAAE,IAAAC,EAAAA,WAGrC,IAAMC,EAAY,GAAAC,OAAOH,EAAa,CAAEI,IAClCC,EAAeP,EAAOM,GAExBE,MAAMC,QAAQF,GAChBA,EAAaG,QAAQ,SAACC,EAAWC,GAC/Bb,EAAeY,EAAMV,EAAM,GAAAI,OAAMD,EAAcQ,CAAAA,IACjD,GACiC,iBAAjBL,GAA8C,OAAjBA,EAC7CR,EAAeQ,EAAcN,EAAQG,GACJ,iBAAjBG,IAChBN,EAAOG,EAAaS,KAAK,MAAQ,CAC/BC,KAAM,aACNC,QAASR,GAGf,EAhBA,IAAK,IAAMD,KAAON,EAAMG,GAiB1B,CAEA,IAAMa,EAAmB,SACvBC,EACAC,GAMA,IAAMjB,EAAqC,GAG3C,OAFAF,EAAekB,EAAkBhB,GAE1BA,CACT,kCA8BgB,SAGdkB,GACA,OAAcC,SAAAA,EAAQC,EAAUC,GAAW,IAAA,OAAAC,QAAAC,QACVL,EAAUM,cAAcL,IAAOM,KAAA,SAAxDC,GACN,IAAMC,EAAmD,IAAzCC,OAAOC,KAAKH,GAAkBI,OAI9C,OAFAT,EAAQU,2BAA6BC,yBAAuB,CAAA,EAAIX,GAEzDM,EACH,CACER,OAAQA,EACRnB,OAAQ,CACT,GACD,CACEmB,OAAQ,CAAA,EACRnB,OAAQiC,EAAYA,aAClBlB,EACEW,GAIFL,GAEF,EACR,CAAC,MAAAa,GAAA,OAAAZ,QAAAa,OAAAD,EACH,CAAA,CAAA,6BAvDgB,SACdhB,GAEA,OAAcC,SAAAA,EAAQC,EAAUC,GAAW,IACzC,IAAMK,EAAmBR,EAAUkB,SAASjB,GACtCQ,EAAmD,IAAzCC,OAAOC,KAAKH,GAAkBI,OAI9C,OAFAT,EAAQU,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEX,GAEhEC,QAAAC,QAAOI,EACH,CACER,OAAQA,EACRnB,OAAQ,CAAA,GAEV,CACEmB,OAAQ,CAAA,EACRnB,OAAQiC,EAAAA,aACNlB,EACEW,GAIFL,IAGV,CAAC,MAAAa,GAAA,OAAAZ,QAAAa,OAAAD,EACH,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/index.d.ts b/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/index.d.ts deleted file mode 100644 index 5f27a0c3fdd40f45e2f99a4ccdd16d382a323469..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fluentvalidation-ts'; diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/package.json b/node_modules/@hookform/resolvers/fluentvalidation-ts/package.json deleted file mode 100644 index d6f56ff19ec039b84cd33206d7a985379e1638d6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/fluentvalidation-ts", - "amdName": "hookformResolversfluentvalidation-ts", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: fluentvalidation-ts", - "main": "dist/fluentvalidation-ts.js", - "module": "dist/fluentvalidation-ts.module.js", - "umd:main": "dist/fluentvalidation-ts.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "fluentvalidation-ts": "^3.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 5b9ed768298805a75e9207874a9a3a846890174f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { Validator } from 'fluentvalidation-ts'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { fluentValidationResolver } from '../fluentvalidation-ts'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -type FormData = { - username: string; - password: string; -}; - -class FormDataValidator extends Validator { - constructor() { - super(); - - this.ruleFor('username').notEmpty().withMessage(USERNAME_REQUIRED_MESSAGE); - this.ruleFor('password').notEmpty().withMessage(PASSWORD_REQUIRED_MESSAGE); - } -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: fluentValidationResolver(new FormDataValidator()), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with fluentvalidation-ts", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/Form.tsx deleted file mode 100644 index 48dbf356ed0409df5b15fd097d13aaf95810880c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/Form.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import { Validator } from 'fluentvalidation-ts'; -import React from 'react'; -import { SubmitHandler, useForm } from 'react-hook-form'; -import { fluentValidationResolver } from '../fluentvalidation-ts'; - -type FormData = { - username: string; - password: string; -}; - -class FormDataValidator extends Validator { - constructor() { - super(); - - this.ruleFor('username') - .notEmpty() - .withMessage('username is a required field'); - this.ruleFor('password') - .notEmpty() - .withMessage('password is a required field'); - } -} - -interface Props { - onSubmit: SubmitHandler; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: fluentValidationResolver(new FormDataValidator()), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Yup and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username is a required field/i)).toBeInTheDocument(); - expect(screen.getByText(/password is a required field/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 03953e23c5e58083507a10d81ccb0fab6ddbf7e2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { Validator } from 'fluentvalidation-ts'; -import { Field, InternalFieldName } from 'react-hook-form'; - -const beNumeric = (value: string | number | undefined) => !isNaN(Number(value)); - -export type Schema = { - username: string; - password: string; - repeatPassword: string; - accessToken?: string; - birthYear?: number; - email?: string; - tags?: string[]; - enabled?: boolean; - like?: { - id: number; - name: string; - }[]; -}; - -export type SchemaWithWhen = { - name: string; - value: string; -}; - -export class SchemaValidator extends Validator { - constructor() { - super(); - - this.ruleFor('username') - .notEmpty() - .matches(/^\w+$/) - .minLength(3) - .maxLength(30); - - this.ruleFor('password') - .notEmpty() - .matches(/.*[A-Z].*/) - .withMessage('One uppercase character') - .matches(/.*[a-z].*/) - .withMessage('One lowercase character') - .matches(/.*\d.*/) - .withMessage('One number') - .matches(new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*')) - .withMessage('One special character') - .minLength(8) - .withMessage('Must be at least 8 characters in length'); - - this.ruleFor('repeatPassword') - .notEmpty() - .must((repeatPassword, data) => repeatPassword === data.password); - - this.ruleFor('accessToken'); - this.ruleFor('birthYear') - .must(beNumeric) - .inclusiveBetween(1900, 2013) - .when((birthYear) => birthYear != undefined); - - this.ruleFor('email').emailAddress(); - this.ruleFor('tags'); - this.ruleFor('enabled'); - - this.ruleForEach('like').setValidator(() => new LikeValidator()); - } -} - -export class LikeValidator extends Validator<{ - id: number; - name: string; -}> { - constructor() { - super(); - - this.ruleFor('id').notNull(); - this.ruleFor('name').notEmpty().length(4, 4); - } -} - -export const validData = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accesstoken: 'accesstoken', - like: [ - { - id: 1, - name: 'name', - }, - ], -} as Schema; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - // Must be set to "unknown", otherwise typescript knows that it is invalid -} as unknown as Required; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/__snapshots__/fluentvalidation-ts.ts.snap b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/__snapshots__/fluentvalidation-ts.ts.snap deleted file mode 100644 index f2ef0e42bcdfd44935a7283b4cb21ed80f72e1fc..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/__snapshots__/fluentvalidation-ts.ts.snap +++ /dev/null @@ -1,129 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`fluentValidationResolver > should return a single error from fluentValidationResolver when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - "email": { - "message": "Not a valid email address", - "ref": { - "name": "email", - }, - "type": "validation", - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "validation", - }, - "repeatPassword": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - }, - "values": {}, -} -`; - -exports[`fluentValidationResolver > should return a single error from fluentValidationResolver with \`mode: sync\` when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - "email": { - "message": "Not a valid email address", - "ref": { - "name": "email", - }, - "type": "validation", - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "validation", - }, - "repeatPassword": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - }, - "values": {}, -} -`; - -exports[`fluentValidationResolver > should return all the errors from fluentValidationResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "birthYear": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - "email": { - "message": "Not a valid email address", - "ref": { - "name": "email", - }, - "type": "validation", - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "validation", - }, - "repeatPassword": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - }, - "values": {}, -} -`; - -exports[`fluentValidationResolver > should return all the errors from fluentValidationResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "birthYear": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - "email": { - "message": "Not a valid email address", - "ref": { - "name": "email", - }, - "type": "validation", - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "validation", - }, - "repeatPassword": { - "message": "Value is not valid", - "ref": undefined, - "type": "validation", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/fluentvalidation-ts.ts b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/fluentvalidation-ts.ts deleted file mode 100644 index 52f611d18d1276f24fd251dc79339f8255d0d387..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/__tests__/fluentvalidation-ts.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */ -import { fluentValidationResolver } from '..'; -import { - SchemaValidator, - fields, - invalidData, - validData, -} from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -const validator = new SchemaValidator(); - -describe('fluentValidationResolver', () => { - it('should return values from fluentValidationResolver when validation pass', async () => { - const validatorSpy = vi.spyOn(validator, 'validate'); - - const result = await fluentValidationResolver(validator)( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(validatorSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return values from fluentValidationResolver with `mode: sync` when validation pass', async () => { - const validatorSpy = vi.spyOn(validator, 'validate'); - - const result = await fluentValidationResolver(validator)( - validData, - undefined, - { fields, shouldUseNativeValidation }, - ); - - expect(validatorSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from fluentValidationResolver when validation fails', async () => { - const result = await fluentValidationResolver(validator)( - invalidData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from fluentValidationResolver with `mode: sync` when validation fails', async () => { - const validateSpy = vi.spyOn(validator, 'validate'); - - const result = await fluentValidationResolver(validator)( - invalidData, - undefined, - { fields, shouldUseNativeValidation }, - ); - - expect(validateSpy).toHaveBeenCalledTimes(1); - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from fluentValidationResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await fluentValidationResolver(validator)( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from fluentValidationResolver when validation fails with `validateAllFieldCriteria` set to true and `mode: sync`', async () => { - const result = await fluentValidationResolver(validator)( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return values from fluentValidationResolver when validation pass & raw=true', async () => { - const schemaSpy = vi.spyOn(validator, 'validate'); - - const result = await fluentValidationResolver(validator)( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); -}); diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/fluentvalidation-ts.ts b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/fluentvalidation-ts.ts deleted file mode 100644 index f0b794f23b97e2a97b52c20dcf6524a94235058d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/fluentvalidation-ts.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { - AsyncValidator, - ValidationErrors, - Validator, -} from 'fluentvalidation-ts'; -import { FieldError, FieldValues, Resolver } from 'react-hook-form'; - -function traverseObject( - object: ValidationErrors, - errors: Record, - parentIndices: (string | number)[] = [], -) { - for (const key in object) { - const currentIndex = [...parentIndices, key]; - const currentValue = object[key]; - - if (Array.isArray(currentValue)) { - currentValue.forEach((item: any, index: number) => { - traverseObject(item, errors, [...currentIndex, index]); - }); - } else if (typeof currentValue === 'object' && currentValue !== null) { - traverseObject(currentValue, errors, currentIndex); - } else if (typeof currentValue === 'string') { - errors[currentIndex.join('.')] = { - type: 'validation', - message: currentValue, - }; - } - } -} - -const parseErrorSchema = ( - validationErrors: ValidationErrors, - validateAllFieldCriteria: boolean, -) => { - if (validateAllFieldCriteria) { - // TODO: check this but i think its always one validation error - } - - const errors: Record = {}; - traverseObject(validationErrors, errors); - - return errors; -}; - -export function fluentValidationResolver( - validator: Validator, -): Resolver { - return async (values, _context, options) => { - const validationResult = validator.validate(values); - const isValid = Object.keys(validationResult).length === 0; - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return isValid - ? { - values: values, - errors: {}, - } - : { - values: {}, - errors: toNestErrors( - parseErrorSchema( - validationResult, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - }; -} - -export function fluentAsyncValidationResolver< - TFieldValues extends FieldValues, - TValidator extends AsyncValidator, ->(validator: TValidator): Resolver { - return async (values, _context, options) => { - const validationResult = await validator.validateAsync(values); - const isValid = Object.keys(validationResult).length === 0; - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return isValid - ? { - values: values, - errors: {}, - } - : { - values: {}, - errors: toNestErrors( - parseErrorSchema( - validationResult, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - }; -} diff --git a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/index.ts b/node_modules/@hookform/resolvers/fluentvalidation-ts/src/index.ts deleted file mode 100644 index 5f27a0c3fdd40f45e2f99a4ccdd16d382a323469..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/fluentvalidation-ts/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fluentvalidation-ts'; diff --git a/node_modules/@hookform/resolvers/io-ts/dist/arrayToPath.d.ts b/node_modules/@hookform/resolvers/io-ts/dist/arrayToPath.d.ts deleted file mode 100644 index af8aae9269434b199de68f36a207fe3514aea1a8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/arrayToPath.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as Either from 'fp-ts/Either'; -declare const arrayToPath: (paths: Either.Either[]) => string; -export default arrayToPath; diff --git a/node_modules/@hookform/resolvers/io-ts/dist/errorsToRecord.d.ts b/node_modules/@hookform/resolvers/io-ts/dist/errorsToRecord.d.ts deleted file mode 100644 index 9bcde69a59bd4b6ba7126642ce7d85a094b24963..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/errorsToRecord.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ValidationError } from 'io-ts'; -import { ErrorObject } from './types'; -declare const errorsToRecord: (validateAllFieldCriteria: boolean) => (validationErrors: ReadonlyArray) => ErrorObject; -export default errorsToRecord; diff --git a/node_modules/@hookform/resolvers/io-ts/dist/index.d.ts b/node_modules/@hookform/resolvers/io-ts/dist/index.d.ts deleted file mode 100644 index a0489c71855f954848b2ad36b589f1bee3873768..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './io-ts'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.d.ts b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.d.ts deleted file mode 100644 index 206b1dc8f6a950e5be05316b70ac2fd5e0c94be9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Resolver } from './types'; -export declare const ioTsResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.js b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.js deleted file mode 100644 index 2f849204cbd769c8b5014ab4fe86f6ff3da09bdd..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),n=require("fp-ts/Either"),t=require("fp-ts/function"),r=require("fp-ts/Option"),i=require("fp-ts/ReadonlyArray"),u=require("fp-ts/ReadonlyRecord"),o=require("fp-ts/Semigroup"),a=require("io-ts");function f(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,n}var c=/*#__PURE__*/f(n),p=/*#__PURE__*/f(r),s=/*#__PURE__*/f(i),l=/*#__PURE__*/f(u),d=/*#__PURE__*/f(o);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n0?".":"")+e},function(e){return"["+e+"]"}),function(n){return""+e+n})},"")},v=["path"],g=[a.TaggedUnionType,a.UnionType,a.IntersectionType,a.ExactType,a.RefinementType],O=function(e){var n,r=t.pipe(n=e.context,s.filterMapWithIndex(function(e,t){var r=e-1,i=-1===r?void 0:n[r];return void 0===i||g.some(function(e){return i.type instanceof e})?p.none:p.some(t)}),s.map(function(e){return e.key}),s.map(function(e){return t.pipe(e,function(e){return parseInt(e,10)},c.fromPredicate(t.not(Number.isNaN),function(){return e}))}),s.toArray,y);return{message:t.pipe(e.message,c.fromNullable(e.context),c.mapLeft(t.flow(s.last,p.map(function(e){return"expected "+e.type.name+" but got "+JSON.stringify(e.actual)}),p.getOrElseW(function(){return t.absurd("Error context is missing name")}))),c.getOrElseW(t.identity)),type:t.pipe(e.context,s.last,p.map(function(e){return e.type.name}),p.getOrElse(function(){return"unknown"})),path:r}},b=function(e){return t.pipe(e,s.map(function(e){var n;return(n={})[e.path]={type:e.type,message:e.message},n}),function(e){return d.fold({concat:function(e,n){return Object.assign({},n,e)}})({},e)})},h={concat:function(e,n){var t;return m({},n,{types:m({},e.types,(t={},t[e.type]=e.message,t[n.type]=n.message,t))})}},x=function(e){return t.pipe(l.fromFoldableMap(h,s.Foldable)(e,function(e){return[e.path,e]}),l.map(function(e){return function(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}(e,v)}))};exports.ioTsResolver=function(n){return function(r,i,u){return t.pipe(r,n.decode,c.mapLeft((o=!u.shouldUseNativeValidation&&"all"===u.criteriaMode,function(e){var n=o?x:b;return t.pipe(e,s.map(O),n)})),c.mapLeft(function(n){return e.toNestErrors(n,u)}),c.fold(function(e){return{values:{},errors:e}},function(n){return u.shouldUseNativeValidation&&e.validateFieldsNatively({},u),{values:n,errors:{}}}));var o}}; -//# sourceMappingURL=io-ts.js.map diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.js.map b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.js.map deleted file mode 100644 index 9f0108cb0a97673a30ec800c529a17022c0c534c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"io-ts.js","sources":["../src/arrayToPath.ts","../src/errorsToRecord.ts","../src/io-ts.ts"],"sourcesContent":["import * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\n\nconst arrayToPath = (paths: Either.Either[]): string =>\n paths.reduce(\n (previous, path, index) =>\n pipe(\n path,\n Either.fold(\n (key) => `${index > 0 ? '.' : ''}${key}`,\n (key) => `[${key}]`,\n ),\n (path) => `${previous}${path}`,\n ),\n '',\n );\n\nexport default arrayToPath;\n","import * as Either from 'fp-ts/Either';\nimport * as Option from 'fp-ts/Option';\nimport * as ReadonlyArray from 'fp-ts/ReadonlyArray';\nimport * as ReadonlyRecord from 'fp-ts/ReadonlyRecord';\nimport * as SemiGroup from 'fp-ts/Semigroup';\nimport { absurd, flow, identity, not, pipe } from 'fp-ts/function';\nimport * as t from 'io-ts';\nimport {\n ExactType,\n IntersectionType,\n RefinementType,\n TaggedUnionType,\n UnionType,\n ValidationError,\n} from 'io-ts';\nimport arrayToPath from './arrayToPath';\nimport { ErrorObject, FieldErrorWithPath } from './types';\n\nconst INSTANCE_TYPES_TO_FILTER = [\n TaggedUnionType,\n UnionType,\n IntersectionType,\n ExactType,\n RefinementType,\n];\nconst formatErrorPath = (context: t.Context): string =>\n pipe(\n context,\n ReadonlyArray.filterMapWithIndex((index, contextEntry) => {\n const previousIndex = index - 1;\n const previousContextEntry =\n previousIndex === -1 ? undefined : context[previousIndex];\n const shouldBeFiltered =\n previousContextEntry === undefined ||\n INSTANCE_TYPES_TO_FILTER.some(\n (type) => previousContextEntry.type instanceof type,\n );\n\n return shouldBeFiltered ? Option.none : Option.some(contextEntry);\n }),\n ReadonlyArray.map(({ key }) => key),\n ReadonlyArray.map((key) =>\n pipe(\n key,\n (k) => parseInt(k, 10),\n Either.fromPredicate(not(Number.isNaN), () => key),\n ),\n ),\n ReadonlyArray.toArray,\n arrayToPath,\n );\n\nconst formatError = (e: t.ValidationError): FieldErrorWithPath => {\n const path = formatErrorPath(e.context);\n\n const message = pipe(\n e.message,\n Either.fromNullable(e.context),\n Either.mapLeft(\n flow(\n ReadonlyArray.last,\n Option.map(\n (contextEntry) =>\n `expected ${contextEntry.type.name} but got ${JSON.stringify(\n contextEntry.actual,\n )}`,\n ),\n Option.getOrElseW(() =>\n absurd('Error context is missing name' as never),\n ),\n ),\n ),\n Either.getOrElseW(identity),\n );\n\n const type = pipe(\n e.context,\n ReadonlyArray.last,\n Option.map((contextEntry) => contextEntry.type.name),\n Option.getOrElse(() => 'unknown'),\n );\n\n return { message, type, path };\n};\n\n// this is almost the same function like Semigroup.getObjectSemigroup but reversed\n// in order to get the first error\nconst getObjectSemigroup = <\n A extends Record = never,\n>(): SemiGroup.Semigroup
=> ({\n concat: (first, second) => Object.assign({}, second, first),\n});\n\nconst concatToSingleError = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n errors,\n ReadonlyArray.map((error) => ({\n [error.path]: {\n type: error.type,\n message: error.message,\n },\n })),\n (errors) => SemiGroup.fold(getObjectSemigroup())({}, errors),\n );\n\nconst appendSeveralErrors: SemiGroup.Semigroup = {\n concat: (a, b) => ({\n ...b,\n types: { ...a.types, [a.type]: a.message, [b.type]: b.message },\n }),\n};\n\nconst concatToMultipleErrors = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n ReadonlyRecord.fromFoldableMap(appendSeveralErrors, ReadonlyArray.Foldable)(\n errors,\n (error) => [error.path, error],\n ),\n ReadonlyRecord.map((errorWithPath) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { path, ...error } = errorWithPath;\n\n return error;\n }),\n );\n\nconst errorsToRecord =\n (validateAllFieldCriteria: boolean) =>\n (validationErrors: ReadonlyArray): ErrorObject => {\n const concat = validateAllFieldCriteria\n ? concatToMultipleErrors\n : concatToSingleError;\n\n return pipe(validationErrors, ReadonlyArray.map(formatError), concat);\n };\n\nexport default errorsToRecord;\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\nimport errorsToRecord from './errorsToRecord';\nimport { Resolver } from './types';\n\nexport const ioTsResolver: Resolver = (codec) => (values, _context, options) =>\n pipe(\n values,\n codec.decode,\n Either.mapLeft(\n errorsToRecord(\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n ),\n Either.mapLeft((errors) => toNestErrors(errors, options)),\n Either.fold(\n (errors) => ({\n values: {},\n errors,\n }),\n (values) => {\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options);\n\n return {\n values,\n errors: {},\n } as any;\n },\n ),\n );\n"],"names":["arrayToPath","paths","reduce","previous","path","index","pipe","Either","fold","key","_excluded","INSTANCE_TYPES_TO_FILTER","TaggedUnionType","UnionType","IntersectionType","ExactType","RefinementType","formatError","e","context","ReadonlyArray","filterMapWithIndex","contextEntry","previousIndex","previousContextEntry","undefined","some","type","Option","none","map","_ref","k","parseInt","fromPredicate","not","Number","isNaN","toArray","message","fromNullable","mapLeft","flow","last","name","JSON","stringify","actual","getOrElseW","absurd","identity","getOrElse","concatToSingleError","errors","error","_ref2","SemiGroup","concat","first","second","Object","assign","appendSeveralErrors","a","b","_extends2","_extends","types","concatToMultipleErrors","ReadonlyRecord","fromFoldableMap","Foldable","errorWithPath","_objectWithoutPropertiesLoose","codec","values","_context","options","decode","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","validationErrors","toNestErrors","validateFieldsNatively"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.mjs b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.mjs deleted file mode 100644 index 5ee58578025c50ff3b4ff01ebc389d88c1ed1421..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as n,validateFieldsNatively as t}from"@hookform/resolvers";import*as r from"fp-ts/Either";import{pipe as e,flow as o,absurd as u,identity as a,not as i}from"fp-ts/function";import*as f from"fp-ts/Option";import*as s from"fp-ts/ReadonlyArray";import*as c from"fp-ts/ReadonlyRecord";import*as p from"fp-ts/Semigroup";import{TaggedUnionType as m,UnionType as l,IntersectionType as d,ExactType as v,RefinementType as y}from"io-ts";function g(){return g=Object.assign?Object.assign.bind():function(n){for(var t=1;t0?".":"")+n},function(n){return"["+n+"]"}),function(t){return""+n+t})},"")},O=["path"],b=[m,l,d,v,y],x=function(n){var t,c=e(t=n.context,s.filterMapWithIndex(function(n,r){var e=n-1,o=-1===e?void 0:t[e];return void 0===o||b.some(function(n){return o.type instanceof n})?f.none:f.some(r)}),s.map(function(n){return n.key}),s.map(function(n){return e(n,function(n){return parseInt(n,10)},r.fromPredicate(i(Number.isNaN),function(){return n}))}),s.toArray,h);return{message:e(n.message,r.fromNullable(n.context),r.mapLeft(o(s.last,f.map(function(n){return"expected "+n.type.name+" but got "+JSON.stringify(n.actual)}),f.getOrElseW(function(){return u("Error context is missing name")}))),r.getOrElseW(a)),type:e(n.context,s.last,f.map(function(n){return n.type.name}),f.getOrElse(function(){return"unknown"})),path:c}},N=function(n){return e(n,s.map(function(n){var t;return(t={})[n.path]={type:n.type,message:n.message},t}),function(n){return p.fold({concat:function(n,t){return Object.assign({},t,n)}})({},n)})},E={concat:function(n,t){var r;return g({},t,{types:g({},n.types,(r={},r[n.type]=n.message,r[t.type]=t.message,r))})}},j=function(n){return e(c.fromFoldableMap(E,s.Foldable)(n,function(n){return[n.path,n]}),c.map(function(n){return function(n,t){if(null==n)return{};var r={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(t.indexOf(e)>=0)continue;r[e]=n[e]}return r}(n,O)}))},k=function(o){return function(u,a,i){return e(u,o.decode,r.mapLeft((f=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,function(n){var t=f?j:N;return e(n,s.map(x),t)})),r.mapLeft(function(t){return n(t,i)}),r.fold(function(n){return{values:{},errors:n}},function(n){return i.shouldUseNativeValidation&&t({},i),{values:n,errors:{}}}));var f}};export{k as ioTsResolver}; -//# sourceMappingURL=io-ts.module.js.map diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.modern.mjs b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.modern.mjs deleted file mode 100644 index fa8954ba7589a3a457692123109778e01401cf4d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as e,validateFieldsNatively as t}from"@hookform/resolvers";import*as r from"fp-ts/Either";import{pipe as o,flow as a,absurd as s,identity as n,not as p}from"fp-ts/function";import*as i from"fp-ts/Option";import*as m from"fp-ts/ReadonlyArray";import*as f from"fp-ts/ReadonlyRecord";import*as l from"fp-ts/Semigroup";import{TaggedUnionType as c,UnionType as u,IntersectionType as d,ExactType as y,RefinementType as g}from"io-ts";function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;te.reduce((e,t,a)=>o(t,r.fold(e=>`${a>0?".":""}${e}`,e=>`[${e}]`),t=>`${e}${t}`),""),O=["path"],b=[c,u,d,y,g],x=e=>{const t=o(f=e.context,m.filterMapWithIndex((e,t)=>{const r=e-1,o=-1===r?void 0:f[r];return void 0===o||b.some(e=>o.type instanceof e)?i.none:i.some(t)}),m.map(({key:e})=>e),m.map(e=>o(e,e=>parseInt(e,10),r.fromPredicate(p(Number.isNaN),()=>e))),m.toArray,h);var f;return{message:o(e.message,r.fromNullable(e.context),r.mapLeft(a(m.last,i.map(e=>`expected ${e.type.name} but got ${JSON.stringify(e.actual)}`),i.getOrElseW(()=>s("Error context is missing name")))),r.getOrElseW(n)),type:o(e.context,m.last,i.map(e=>e.type.name),i.getOrElse(()=>"unknown")),path:t}},N=e=>o(e,m.map(e=>({[e.path]:{type:e.type,message:e.message}})),e=>l.fold({concat:(e,t)=>Object.assign({},t,e)})({},e)),$={concat:(e,t)=>v({},t,{types:v({},e.types,{[e.type]:e.message,[t.type]:t.message})})},E=e=>o(f.fromFoldableMap($,m.Foldable)(e,e=>[e.path,e]),f.map(e=>function(e,t){if(null==e)return{};var r={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}(e,O))),j=a=>(s,n,p)=>{return o(s,a.decode,r.mapLeft((i=!p.shouldUseNativeValidation&&"all"===p.criteriaMode,e=>{const t=i?E:N;return o(e,m.map(x),t)})),r.mapLeft(t=>e(t,p)),r.fold(e=>({values:{},errors:e}),e=>(p.shouldUseNativeValidation&&t({},p),{values:e,errors:{}})));var i};export{j as ioTsResolver}; -//# sourceMappingURL=io-ts.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.modern.mjs.map b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.modern.mjs.map deleted file mode 100644 index e930dbe38f5e0b021215bee25fade885f394917b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"io-ts.modern.mjs","sources":["../src/arrayToPath.ts","../src/errorsToRecord.ts","../src/io-ts.ts"],"sourcesContent":["import * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\n\nconst arrayToPath = (paths: Either.Either[]): string =>\n paths.reduce(\n (previous, path, index) =>\n pipe(\n path,\n Either.fold(\n (key) => `${index > 0 ? '.' : ''}${key}`,\n (key) => `[${key}]`,\n ),\n (path) => `${previous}${path}`,\n ),\n '',\n );\n\nexport default arrayToPath;\n","import * as Either from 'fp-ts/Either';\nimport * as Option from 'fp-ts/Option';\nimport * as ReadonlyArray from 'fp-ts/ReadonlyArray';\nimport * as ReadonlyRecord from 'fp-ts/ReadonlyRecord';\nimport * as SemiGroup from 'fp-ts/Semigroup';\nimport { absurd, flow, identity, not, pipe } from 'fp-ts/function';\nimport * as t from 'io-ts';\nimport {\n ExactType,\n IntersectionType,\n RefinementType,\n TaggedUnionType,\n UnionType,\n ValidationError,\n} from 'io-ts';\nimport arrayToPath from './arrayToPath';\nimport { ErrorObject, FieldErrorWithPath } from './types';\n\nconst INSTANCE_TYPES_TO_FILTER = [\n TaggedUnionType,\n UnionType,\n IntersectionType,\n ExactType,\n RefinementType,\n];\nconst formatErrorPath = (context: t.Context): string =>\n pipe(\n context,\n ReadonlyArray.filterMapWithIndex((index, contextEntry) => {\n const previousIndex = index - 1;\n const previousContextEntry =\n previousIndex === -1 ? undefined : context[previousIndex];\n const shouldBeFiltered =\n previousContextEntry === undefined ||\n INSTANCE_TYPES_TO_FILTER.some(\n (type) => previousContextEntry.type instanceof type,\n );\n\n return shouldBeFiltered ? Option.none : Option.some(contextEntry);\n }),\n ReadonlyArray.map(({ key }) => key),\n ReadonlyArray.map((key) =>\n pipe(\n key,\n (k) => parseInt(k, 10),\n Either.fromPredicate(not(Number.isNaN), () => key),\n ),\n ),\n ReadonlyArray.toArray,\n arrayToPath,\n );\n\nconst formatError = (e: t.ValidationError): FieldErrorWithPath => {\n const path = formatErrorPath(e.context);\n\n const message = pipe(\n e.message,\n Either.fromNullable(e.context),\n Either.mapLeft(\n flow(\n ReadonlyArray.last,\n Option.map(\n (contextEntry) =>\n `expected ${contextEntry.type.name} but got ${JSON.stringify(\n contextEntry.actual,\n )}`,\n ),\n Option.getOrElseW(() =>\n absurd('Error context is missing name' as never),\n ),\n ),\n ),\n Either.getOrElseW(identity),\n );\n\n const type = pipe(\n e.context,\n ReadonlyArray.last,\n Option.map((contextEntry) => contextEntry.type.name),\n Option.getOrElse(() => 'unknown'),\n );\n\n return { message, type, path };\n};\n\n// this is almost the same function like Semigroup.getObjectSemigroup but reversed\n// in order to get the first error\nconst getObjectSemigroup = <\n A extends Record = never,\n>(): SemiGroup.Semigroup => ({\n concat: (first, second) => Object.assign({}, second, first),\n});\n\nconst concatToSingleError = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n errors,\n ReadonlyArray.map((error) => ({\n [error.path]: {\n type: error.type,\n message: error.message,\n },\n })),\n (errors) => SemiGroup.fold(getObjectSemigroup())({}, errors),\n );\n\nconst appendSeveralErrors: SemiGroup.Semigroup = {\n concat: (a, b) => ({\n ...b,\n types: { ...a.types, [a.type]: a.message, [b.type]: b.message },\n }),\n};\n\nconst concatToMultipleErrors = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n ReadonlyRecord.fromFoldableMap(appendSeveralErrors, ReadonlyArray.Foldable)(\n errors,\n (error) => [error.path, error],\n ),\n ReadonlyRecord.map((errorWithPath) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { path, ...error } = errorWithPath;\n\n return error;\n }),\n );\n\nconst errorsToRecord =\n (validateAllFieldCriteria: boolean) =>\n (validationErrors: ReadonlyArray): ErrorObject => {\n const concat = validateAllFieldCriteria\n ? concatToMultipleErrors\n : concatToSingleError;\n\n return pipe(validationErrors, ReadonlyArray.map(formatError), concat);\n };\n\nexport default errorsToRecord;\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\nimport errorsToRecord from './errorsToRecord';\nimport { Resolver } from './types';\n\nexport const ioTsResolver: Resolver = (codec) => (values, _context, options) =>\n pipe(\n values,\n codec.decode,\n Either.mapLeft(\n errorsToRecord(\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n ),\n Either.mapLeft((errors) => toNestErrors(errors, options)),\n Either.fold(\n (errors) => ({\n values: {},\n errors,\n }),\n (values) => {\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options);\n\n return {\n values,\n errors: {},\n } as any;\n },\n ),\n );\n"],"names":["arrayToPath","paths","reduce","previous","path","index","pipe","Either","fold","key","_excluded","INSTANCE_TYPES_TO_FILTER","TaggedUnionType","UnionType","IntersectionType","ExactType","RefinementType","formatError","e","context","ReadonlyArray","filterMapWithIndex","contextEntry","previousIndex","previousContextEntry","undefined","some","type","Option","none","map","k","parseInt","fromPredicate","not","Number","isNaN","toArray","message","fromNullable","mapLeft","flow","last","name","JSON","stringify","actual","getOrElseW","absurd","identity","getOrElse","concatToSingleError","errors","error","SemiGroup","getObjectSemigroup","concat","first","second","Object","assign","appendSeveralErrors","a","b","_extends","types","concatToMultipleErrors","ReadonlyRecord","fromFoldableMap","Foldable","errorWithPath","_objectWithoutPropertiesLoose","ioTsResolver","codec","values","_context","options","decode","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","validationErrors","toNestErrors","validateFieldsNatively"],"mappings":"upBAGA,MAAMA,EAAeC,GACnBA,EAAMC,OACJ,CAACC,EAAUC,EAAMC,IACfC,EACEF,EACAG,EAAOC,KACJC,GAAQ,GAAGJ,EAAQ,EAAI,IAAM,KAAKI,IAClCA,GAAQ,IAAIA,MAEdL,GAAS,GAAGD,IAAWC,KAE5B,ICdJM,EAAA,CAAA,QAkBMC,EAA2B,CAC/BC,EACAC,EACAC,EACAC,EACAC,GA6BIC,EAAeC,IACnB,MAAMd,EA3BNE,EADuBa,EA4BMD,EAAEC,QAzB7BC,EAAcC,mBAAmB,CAAChB,EAAOiB,KACvC,MAAMC,EAAgBlB,EAAQ,EACxBmB,GACe,IAAnBD,OAAuBE,EAAYN,EAAQI,GAO7C,YAL2BE,IAAzBD,GACAb,EAAyBe,KACtBC,GAASH,EAAqBG,gBAAgBA,GAGzBC,EAAOC,KAAOD,EAAOF,KAAKJ,EAAY,GAElEF,EAAcU,IAAI,EAAGrB,SAAUA,GAC/BW,EAAcU,IAAKrB,GACjBH,EACEG,EACCsB,GAAMC,SAASD,EAAG,IACnBxB,EAAO0B,cAAcC,EAAYC,OAAOC,OAAQ,IAAM3B,KAG1DW,EAAciB,QACdrC,GAxBqBmB,MAyDvB,MAAO,CAAEmB,QA3BOhC,EACdY,EAAEoB,QACF/B,EAAOgC,aAAarB,EAAEC,SACtBZ,EAAOiC,QACLC,EACErB,EAAcsB,KACdd,EAAOE,IACJR,GACC,YAAYA,EAAaK,KAAKgB,gBAAgBC,KAAKC,UACjDvB,EAAawB,WAGnBlB,EAAOmB,WAAW,IAChBC,EAAe,oCAIrBzC,EAAOwC,WAAWE,IAUFtB,KAPLrB,EACXY,EAAEC,QACFC,EAAcsB,KACdd,EAAOE,IAAKR,GAAiBA,EAAaK,KAAKgB,MAC/Cf,EAAOsB,UAAU,IAAM,YAGD9C,SAWpB+C,EACJC,GAEA9C,EACE8C,EACAhC,EAAcU,IAAKuB,IAAK,CACtB,CAACA,EAAMjD,MAAO,CACZuB,KAAM0B,EAAM1B,KACZW,QAASe,EAAMf,YAGlBc,GAAWE,EAAU9C,KAjBC+C,CAGzBC,OAAQA,CAACC,EAAOC,IAAWC,OAAOC,OAAO,CAAE,EAAEF,EAAQD,IAcvCH,CAAkD,CAAA,EAAIF,IAGhES,EAA+D,CACnEL,OAAQA,CAACM,EAAGC,IAACC,EAAA,CAAA,EACRD,EAAC,CACJE,MAAKD,EAAOF,CAAAA,EAAAA,EAAEG,MAAO,CAAA,CAACH,EAAEnC,MAAOmC,EAAExB,QAAS,CAACyB,EAAEpC,MAAOoC,EAAEzB,aAIpD4B,EACJd,GAEA9C,EACE6D,EAAeC,gBAAgBP,EAAqBzC,EAAciD,SAAlEF,CACEf,EACCC,GAAU,CAACA,EAAMjD,KAAMiD,IAE1Bc,EAAerC,IAAKwC,4IAEIC,CAAKD,EAAa5D,KCtHjC8D,EAA0BC,GAAU,CAACC,EAAQC,EAAUC,KAClEtE,SACEoE,EACAD,EAAMI,OACNtE,EAAOiC,SDyHRsC,GCvHMF,EAAQG,2BAAsD,QAAzBH,EAAQI,aDwHnDC,IACC,MAAMzB,EAASsB,EACXZ,EACAf,EAEJ,OAAO7C,EAAK2E,EAAkB7D,EAAcU,IAAIb,GAAcuC,EAAM,IC1HpEjD,EAAOiC,QAASY,GAAW8B,EAAa9B,EAAQwB,IAChDrE,EAAOC,KACJ4C,IAAY,CACXsB,OAAQ,CAAA,EACRtB,WAEDsB,IACCE,EAAQG,2BACNI,EAAuB,CAAA,EAAIP,GAEtB,CACLF,SACAtB,OAAQ,ODwGf0B,KCrGE"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.module.js b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.module.js deleted file mode 100644 index 5ee58578025c50ff3b4ff01ebc389d88c1ed1421..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as n,validateFieldsNatively as t}from"@hookform/resolvers";import*as r from"fp-ts/Either";import{pipe as e,flow as o,absurd as u,identity as a,not as i}from"fp-ts/function";import*as f from"fp-ts/Option";import*as s from"fp-ts/ReadonlyArray";import*as c from"fp-ts/ReadonlyRecord";import*as p from"fp-ts/Semigroup";import{TaggedUnionType as m,UnionType as l,IntersectionType as d,ExactType as v,RefinementType as y}from"io-ts";function g(){return g=Object.assign?Object.assign.bind():function(n){for(var t=1;t0?".":"")+n},function(n){return"["+n+"]"}),function(t){return""+n+t})},"")},O=["path"],b=[m,l,d,v,y],x=function(n){var t,c=e(t=n.context,s.filterMapWithIndex(function(n,r){var e=n-1,o=-1===e?void 0:t[e];return void 0===o||b.some(function(n){return o.type instanceof n})?f.none:f.some(r)}),s.map(function(n){return n.key}),s.map(function(n){return e(n,function(n){return parseInt(n,10)},r.fromPredicate(i(Number.isNaN),function(){return n}))}),s.toArray,h);return{message:e(n.message,r.fromNullable(n.context),r.mapLeft(o(s.last,f.map(function(n){return"expected "+n.type.name+" but got "+JSON.stringify(n.actual)}),f.getOrElseW(function(){return u("Error context is missing name")}))),r.getOrElseW(a)),type:e(n.context,s.last,f.map(function(n){return n.type.name}),f.getOrElse(function(){return"unknown"})),path:c}},N=function(n){return e(n,s.map(function(n){var t;return(t={})[n.path]={type:n.type,message:n.message},t}),function(n){return p.fold({concat:function(n,t){return Object.assign({},t,n)}})({},n)})},E={concat:function(n,t){var r;return g({},t,{types:g({},n.types,(r={},r[n.type]=n.message,r[t.type]=t.message,r))})}},j=function(n){return e(c.fromFoldableMap(E,s.Foldable)(n,function(n){return[n.path,n]}),c.map(function(n){return function(n,t){if(null==n)return{};var r={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(t.indexOf(e)>=0)continue;r[e]=n[e]}return r}(n,O)}))},k=function(o){return function(u,a,i){return e(u,o.decode,r.mapLeft((f=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,function(n){var t=f?j:N;return e(n,s.map(x),t)})),r.mapLeft(function(t){return n(t,i)}),r.fold(function(n){return{values:{},errors:n}},function(n){return i.shouldUseNativeValidation&&t({},i),{values:n,errors:{}}}));var f}};export{k as ioTsResolver}; -//# sourceMappingURL=io-ts.module.js.map diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.module.js.map b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.module.js.map deleted file mode 100644 index 3f70fcd2f68cd57cc9e6c5f8349d5009fa469297..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"io-ts.module.js","sources":["../src/arrayToPath.ts","../src/errorsToRecord.ts","../src/io-ts.ts"],"sourcesContent":["import * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\n\nconst arrayToPath = (paths: Either.Either[]): string =>\n paths.reduce(\n (previous, path, index) =>\n pipe(\n path,\n Either.fold(\n (key) => `${index > 0 ? '.' : ''}${key}`,\n (key) => `[${key}]`,\n ),\n (path) => `${previous}${path}`,\n ),\n '',\n );\n\nexport default arrayToPath;\n","import * as Either from 'fp-ts/Either';\nimport * as Option from 'fp-ts/Option';\nimport * as ReadonlyArray from 'fp-ts/ReadonlyArray';\nimport * as ReadonlyRecord from 'fp-ts/ReadonlyRecord';\nimport * as SemiGroup from 'fp-ts/Semigroup';\nimport { absurd, flow, identity, not, pipe } from 'fp-ts/function';\nimport * as t from 'io-ts';\nimport {\n ExactType,\n IntersectionType,\n RefinementType,\n TaggedUnionType,\n UnionType,\n ValidationError,\n} from 'io-ts';\nimport arrayToPath from './arrayToPath';\nimport { ErrorObject, FieldErrorWithPath } from './types';\n\nconst INSTANCE_TYPES_TO_FILTER = [\n TaggedUnionType,\n UnionType,\n IntersectionType,\n ExactType,\n RefinementType,\n];\nconst formatErrorPath = (context: t.Context): string =>\n pipe(\n context,\n ReadonlyArray.filterMapWithIndex((index, contextEntry) => {\n const previousIndex = index - 1;\n const previousContextEntry =\n previousIndex === -1 ? undefined : context[previousIndex];\n const shouldBeFiltered =\n previousContextEntry === undefined ||\n INSTANCE_TYPES_TO_FILTER.some(\n (type) => previousContextEntry.type instanceof type,\n );\n\n return shouldBeFiltered ? Option.none : Option.some(contextEntry);\n }),\n ReadonlyArray.map(({ key }) => key),\n ReadonlyArray.map((key) =>\n pipe(\n key,\n (k) => parseInt(k, 10),\n Either.fromPredicate(not(Number.isNaN), () => key),\n ),\n ),\n ReadonlyArray.toArray,\n arrayToPath,\n );\n\nconst formatError = (e: t.ValidationError): FieldErrorWithPath => {\n const path = formatErrorPath(e.context);\n\n const message = pipe(\n e.message,\n Either.fromNullable(e.context),\n Either.mapLeft(\n flow(\n ReadonlyArray.last,\n Option.map(\n (contextEntry) =>\n `expected ${contextEntry.type.name} but got ${JSON.stringify(\n contextEntry.actual,\n )}`,\n ),\n Option.getOrElseW(() =>\n absurd('Error context is missing name' as never),\n ),\n ),\n ),\n Either.getOrElseW(identity),\n );\n\n const type = pipe(\n e.context,\n ReadonlyArray.last,\n Option.map((contextEntry) => contextEntry.type.name),\n Option.getOrElse(() => 'unknown'),\n );\n\n return { message, type, path };\n};\n\n// this is almost the same function like Semigroup.getObjectSemigroup but reversed\n// in order to get the first error\nconst getObjectSemigroup = <\n A extends Record = never,\n>(): SemiGroup.Semigroup => ({\n concat: (first, second) => Object.assign({}, second, first),\n});\n\nconst concatToSingleError = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n errors,\n ReadonlyArray.map((error) => ({\n [error.path]: {\n type: error.type,\n message: error.message,\n },\n })),\n (errors) => SemiGroup.fold(getObjectSemigroup())({}, errors),\n );\n\nconst appendSeveralErrors: SemiGroup.Semigroup = {\n concat: (a, b) => ({\n ...b,\n types: { ...a.types, [a.type]: a.message, [b.type]: b.message },\n }),\n};\n\nconst concatToMultipleErrors = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n ReadonlyRecord.fromFoldableMap(appendSeveralErrors, ReadonlyArray.Foldable)(\n errors,\n (error) => [error.path, error],\n ),\n ReadonlyRecord.map((errorWithPath) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { path, ...error } = errorWithPath;\n\n return error;\n }),\n );\n\nconst errorsToRecord =\n (validateAllFieldCriteria: boolean) =>\n (validationErrors: ReadonlyArray): ErrorObject => {\n const concat = validateAllFieldCriteria\n ? concatToMultipleErrors\n : concatToSingleError;\n\n return pipe(validationErrors, ReadonlyArray.map(formatError), concat);\n };\n\nexport default errorsToRecord;\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\nimport errorsToRecord from './errorsToRecord';\nimport { Resolver } from './types';\n\nexport const ioTsResolver: Resolver = (codec) => (values, _context, options) =>\n pipe(\n values,\n codec.decode,\n Either.mapLeft(\n errorsToRecord(\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n ),\n Either.mapLeft((errors) => toNestErrors(errors, options)),\n Either.fold(\n (errors) => ({\n values: {},\n errors,\n }),\n (values) => {\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options);\n\n return {\n values,\n errors: {},\n } as any;\n },\n ),\n );\n"],"names":["arrayToPath","paths","reduce","previous","path","index","pipe","Either","fold","key","_excluded","INSTANCE_TYPES_TO_FILTER","TaggedUnionType","UnionType","IntersectionType","ExactType","RefinementType","formatError","e","context","ReadonlyArray","filterMapWithIndex","contextEntry","previousIndex","previousContextEntry","undefined","some","type","Option","none","map","_ref","k","parseInt","fromPredicate","not","Number","isNaN","toArray","message","fromNullable","mapLeft","flow","last","name","JSON","stringify","actual","getOrElseW","absurd","identity","getOrElse","concatToSingleError","errors","error","_ref2","SemiGroup","concat","first","second","Object","assign","appendSeveralErrors","a","b","_extends2","_extends","types","concatToMultipleErrors","ReadonlyRecord","fromFoldableMap","Foldable","errorWithPath","_objectWithoutPropertiesLoose","ioTsResolver","codec","values","_context","options","decode","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","validationErrors","toNestErrors","validateFieldsNatively"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.umd.js b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.umd.js deleted file mode 100644 index a4df41fe6a06b0d8b8edf62f356504b7acd15dde..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@hookform/resolvers"),require("fp-ts/Either"),require("fp-ts/function"),require("fp-ts/Option"),require("fp-ts/ReadonlyArray"),require("fp-ts/ReadonlyRecord"),require("fp-ts/Semigroup"),require("io-ts")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","fp-ts/Either","fp-ts/function","fp-ts/Option","fp-ts/ReadonlyArray","fp-ts/ReadonlyRecord","fp-ts/Semigroup","io-ts"],n):n((e||self).hookformResolversIoTs={},e.hookformResolvers,e.Either,e._function,e.Option,e.ReadonlyArray,e.ReadonlyRecord,e.Semigroup,e.ioTs)}(this,function(e,n,t,r,o,i,u,a,f){function s(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,n}var p=/*#__PURE__*/s(t),c=/*#__PURE__*/s(o),l=/*#__PURE__*/s(i),d=/*#__PURE__*/s(u),y=/*#__PURE__*/s(a);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n0?".":"")+e},function(e){return"["+e+"]"}),function(n){return""+e+n})},"")},g=["path"],h=[f.TaggedUnionType,f.UnionType,f.IntersectionType,f.ExactType,f.RefinementType],b=function(e){var n,t=r.pipe(n=e.context,l.filterMapWithIndex(function(e,t){var r=e-1,o=-1===r?void 0:n[r];return void 0===o||h.some(function(e){return o.type instanceof e})?c.none:c.some(t)}),l.map(function(e){return e.key}),l.map(function(e){return r.pipe(e,function(e){return parseInt(e,10)},p.fromPredicate(r.not(Number.isNaN),function(){return e}))}),l.toArray,v);return{message:r.pipe(e.message,p.fromNullable(e.context),p.mapLeft(r.flow(l.last,c.map(function(e){return"expected "+e.type.name+" but got "+JSON.stringify(e.actual)}),c.getOrElseW(function(){return r.absurd("Error context is missing name")}))),p.getOrElseW(r.identity)),type:r.pipe(e.context,l.last,c.map(function(e){return e.type.name}),c.getOrElse(function(){return"unknown"})),path:t}},O=function(e){return r.pipe(e,l.map(function(e){var n;return(n={})[e.path]={type:e.type,message:e.message},n}),function(e){return y.fold({concat:function(e,n){return Object.assign({},n,e)}})({},e)})},R={concat:function(e,n){var t;return m({},n,{types:m({},e.types,(t={},t[e.type]=e.message,t[n.type]=n.message,t))})}},x=function(e){return r.pipe(d.fromFoldableMap(R,l.Foldable)(e,function(e){return[e.path,e]}),d.map(function(e){return function(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}(e,g)}))};e.ioTsResolver=function(e){return function(t,o,i){return r.pipe(t,e.decode,p.mapLeft((u=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,function(e){var n=u?x:O;return r.pipe(e,l.map(b),n)})),p.mapLeft(function(e){return n.toNestErrors(e,i)}),p.fold(function(e){return{values:{},errors:e}},function(e){return i.shouldUseNativeValidation&&n.validateFieldsNatively({},i),{values:e,errors:{}}}));var u}}}); -//# sourceMappingURL=io-ts.umd.js.map diff --git a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.umd.js.map b/node_modules/@hookform/resolvers/io-ts/dist/io-ts.umd.js.map deleted file mode 100644 index a0c42f73147cb2a6e40fcfbc9defa551413a7df8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/io-ts.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"io-ts.umd.js","sources":["../src/arrayToPath.ts","../src/errorsToRecord.ts","../src/io-ts.ts"],"sourcesContent":["import * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\n\nconst arrayToPath = (paths: Either.Either[]): string =>\n paths.reduce(\n (previous, path, index) =>\n pipe(\n path,\n Either.fold(\n (key) => `${index > 0 ? '.' : ''}${key}`,\n (key) => `[${key}]`,\n ),\n (path) => `${previous}${path}`,\n ),\n '',\n );\n\nexport default arrayToPath;\n","import * as Either from 'fp-ts/Either';\nimport * as Option from 'fp-ts/Option';\nimport * as ReadonlyArray from 'fp-ts/ReadonlyArray';\nimport * as ReadonlyRecord from 'fp-ts/ReadonlyRecord';\nimport * as SemiGroup from 'fp-ts/Semigroup';\nimport { absurd, flow, identity, not, pipe } from 'fp-ts/function';\nimport * as t from 'io-ts';\nimport {\n ExactType,\n IntersectionType,\n RefinementType,\n TaggedUnionType,\n UnionType,\n ValidationError,\n} from 'io-ts';\nimport arrayToPath from './arrayToPath';\nimport { ErrorObject, FieldErrorWithPath } from './types';\n\nconst INSTANCE_TYPES_TO_FILTER = [\n TaggedUnionType,\n UnionType,\n IntersectionType,\n ExactType,\n RefinementType,\n];\nconst formatErrorPath = (context: t.Context): string =>\n pipe(\n context,\n ReadonlyArray.filterMapWithIndex((index, contextEntry) => {\n const previousIndex = index - 1;\n const previousContextEntry =\n previousIndex === -1 ? undefined : context[previousIndex];\n const shouldBeFiltered =\n previousContextEntry === undefined ||\n INSTANCE_TYPES_TO_FILTER.some(\n (type) => previousContextEntry.type instanceof type,\n );\n\n return shouldBeFiltered ? Option.none : Option.some(contextEntry);\n }),\n ReadonlyArray.map(({ key }) => key),\n ReadonlyArray.map((key) =>\n pipe(\n key,\n (k) => parseInt(k, 10),\n Either.fromPredicate(not(Number.isNaN), () => key),\n ),\n ),\n ReadonlyArray.toArray,\n arrayToPath,\n );\n\nconst formatError = (e: t.ValidationError): FieldErrorWithPath => {\n const path = formatErrorPath(e.context);\n\n const message = pipe(\n e.message,\n Either.fromNullable(e.context),\n Either.mapLeft(\n flow(\n ReadonlyArray.last,\n Option.map(\n (contextEntry) =>\n `expected ${contextEntry.type.name} but got ${JSON.stringify(\n contextEntry.actual,\n )}`,\n ),\n Option.getOrElseW(() =>\n absurd('Error context is missing name' as never),\n ),\n ),\n ),\n Either.getOrElseW(identity),\n );\n\n const type = pipe(\n e.context,\n ReadonlyArray.last,\n Option.map((contextEntry) => contextEntry.type.name),\n Option.getOrElse(() => 'unknown'),\n );\n\n return { message, type, path };\n};\n\n// this is almost the same function like Semigroup.getObjectSemigroup but reversed\n// in order to get the first error\nconst getObjectSemigroup = <\n A extends Record = never,\n>(): SemiGroup.Semigroup => ({\n concat: (first, second) => Object.assign({}, second, first),\n});\n\nconst concatToSingleError = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n errors,\n ReadonlyArray.map((error) => ({\n [error.path]: {\n type: error.type,\n message: error.message,\n },\n })),\n (errors) => SemiGroup.fold(getObjectSemigroup())({}, errors),\n );\n\nconst appendSeveralErrors: SemiGroup.Semigroup = {\n concat: (a, b) => ({\n ...b,\n types: { ...a.types, [a.type]: a.message, [b.type]: b.message },\n }),\n};\n\nconst concatToMultipleErrors = (\n errors: ReadonlyArray,\n): ErrorObject =>\n pipe(\n ReadonlyRecord.fromFoldableMap(appendSeveralErrors, ReadonlyArray.Foldable)(\n errors,\n (error) => [error.path, error],\n ),\n ReadonlyRecord.map((errorWithPath) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { path, ...error } = errorWithPath;\n\n return error;\n }),\n );\n\nconst errorsToRecord =\n (validateAllFieldCriteria: boolean) =>\n (validationErrors: ReadonlyArray): ErrorObject => {\n const concat = validateAllFieldCriteria\n ? concatToMultipleErrors\n : concatToSingleError;\n\n return pipe(validationErrors, ReadonlyArray.map(formatError), concat);\n };\n\nexport default errorsToRecord;\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport * as Either from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\nimport errorsToRecord from './errorsToRecord';\nimport { Resolver } from './types';\n\nexport const ioTsResolver: Resolver = (codec) => (values, _context, options) =>\n pipe(\n values,\n codec.decode,\n Either.mapLeft(\n errorsToRecord(\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n ),\n Either.mapLeft((errors) => toNestErrors(errors, options)),\n Either.fold(\n (errors) => ({\n values: {},\n errors,\n }),\n (values) => {\n options.shouldUseNativeValidation &&\n validateFieldsNatively({}, options);\n\n return {\n values,\n errors: {},\n } as any;\n },\n ),\n );\n"],"names":["arrayToPath","paths","reduce","previous","path","index","pipe","Either","fold","key","_excluded","INSTANCE_TYPES_TO_FILTER","TaggedUnionType","UnionType","IntersectionType","ExactType","RefinementType","formatError","e","context","ReadonlyArray","filterMapWithIndex","contextEntry","previousIndex","previousContextEntry","undefined","some","type","Option","none","map","_ref","k","parseInt","fromPredicate","not","Number","isNaN","toArray","message","fromNullable","mapLeft","flow","last","name","JSON","stringify","actual","getOrElseW","absurd","identity","getOrElse","concatToSingleError","errors","error","_ref2","SemiGroup","concat","first","second","Object","assign","appendSeveralErrors","a","b","_extends2","_extends","types","concatToMultipleErrors","ReadonlyRecord","fromFoldableMap","Foldable","errorWithPath","_objectWithoutPropertiesLoose","codec","values","_context","options","decode","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","validationErrors","toNestErrors","validateFieldsNatively"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/io-ts/dist/types.d.ts b/node_modules/@hookform/resolvers/io-ts/dist/types.d.ts deleted file mode 100644 index d56a93767bce24a22cd90e5edfc4028d497c5e08..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/dist/types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as t from 'io-ts'; -import { FieldError, FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (codec: t.Decoder) => (values: TFieldValues, _context: TContext | undefined, options: ResolverOptions) => ResolverResult; -export type ErrorObject = Record; -export type FieldErrorWithPath = FieldError & { - path: string; -}; diff --git a/node_modules/@hookform/resolvers/io-ts/package.json b/node_modules/@hookform/resolvers/io-ts/package.json deleted file mode 100644 index ea626cb84f15425a652b740d18ce86eabd5e5cc5..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@hookform/resolvers/io-ts", - "amdName": "hookformResolversIoTs", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: io-ts", - "main": "dist/io-ts.js", - "module": "dist/io-ts.module.js", - "umd:main": "dist/io-ts.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "io-ts": "^2.0.0", - "fp-ts": "^2.7.0" - } -} diff --git a/node_modules/@hookform/resolvers/io-ts/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/io-ts/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index bf8ce0a9405650d9fa1d8f6ea59159edc064b921..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import * as t from 'io-ts'; -import * as tt from 'io-ts-types'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { ioTsResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = t.type({ - username: tt.withMessage(tt.NonEmptyString, () => USERNAME_REQUIRED_MESSAGE), - password: tt.withMessage(tt.NonEmptyString, () => PASSWORD_REQUIRED_MESSAGE), -}); - -interface FormData { - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: ioTsResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with io-ts", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/io-ts/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/io-ts/src/__tests__/Form.tsx deleted file mode 100644 index c641dfcb96a2ea1e17acbf7ef00dd855e31f36ca..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/__tests__/Form.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import * as t from 'io-ts'; -import * as tt from 'io-ts-types'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { ioTsResolver } from '..'; - -const schema = t.type({ - username: tt.withMessage( - tt.NonEmptyString, - () => 'username is a required field', - ), - password: tt.withMessage( - tt.NonEmptyString, - () => 'password is a required field', - ), -}); - -interface FormData { - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: ioTsResolver(schema), - criteriaMode: 'all', - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with io-ts and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username is a required field/i)).toBeInTheDocument(); - expect(screen.getByText(/password is a required field/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/io-ts/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/io-ts/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 7e845a34fab3e1e23d14108adc54dfe5cddf5653..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,129 +0,0 @@ -import * as t from 'io-ts'; -import * as tt from 'io-ts-types'; - -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = t.intersection([ - t.type({ - username: tt.NonEmptyString, - password: tt.NonEmptyString, - accessToken: tt.UUID, - birthYear: t.number, - email: t.string, - tags: t.array( - t.type({ - name: t.string, - }), - ), - luckyNumbers: t.array(t.number), - enabled: t.boolean, - animal: t.union([ - t.string, - t.number, - t.literal('bird'), - t.literal('snake'), - ]), - vehicles: t.array( - t.union([ - t.type({ - type: t.literal('car'), - brand: t.string, - horsepower: t.number, - }), - t.type({ - type: t.literal('bike'), - speed: t.number, - }), - ]), - ), - }), - t.partial({ - like: t.array( - t.type({ - id: tt.withMessage( - t.number, - (i) => `this id is very important but you passed: ${typeof i}(${i})`, - ), - name: t.string, - }), - ), - }), -]); - -interface Data { - username: string; - password: string; - accessToken: string; - birthYear?: number; - luckyNumbers: number[]; - email?: string; - animal: string | number; - tags: { name: string }[]; - enabled: boolean; - like: { id: number; name: string }[]; - vehicles: Array< - | { type: 'car'; brand: string; horsepower: number } - | { type: 'bike'; speed: number } - >; -} - -export const validData: Data = { - username: 'Doe', - password: 'Password123', - accessToken: 'c2883927-5178-4ad1-bbee-07ba33a5de19', - birthYear: 2000, - email: 'john@doe.com', - tags: [{ name: 'test' }], - enabled: true, - luckyNumbers: [17, 5], - animal: 'cat', - like: [ - { - id: 1, - name: 'name', - }, - ], - vehicles: [{ type: 'car', brand: 'BMW', horsepower: 150 }], -}; - -export const invalidData = { - username: 'test', - password: 'Password123', - repeatPassword: 'Password123', - birthYear: 2000, - accessToken: '1015d809-e99d-41ec-b161-981a3c243df8', - email: 'john@doe.com', - tags: [{ name: 'test' }], - enabled: true, - animal: ['dog'], - luckyNumbers: [1, 2, '3'], - like: [ - { - id: '1', - name: 'name', - }, - ], - vehicles: [ - { type: 'car', brand: 'BMW', horsepower: 150 }, - { type: 'car', brand: 'Mercedes' }, - ], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/io-ts/src/__tests__/__snapshots__/io-ts.ts.snap b/node_modules/@hookform/resolvers/io-ts/src/__tests__/__snapshots__/io-ts.ts.snap deleted file mode 100644 index badecbd461308a261b3ab113e350dc0ff2d00d26..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/__tests__/__snapshots__/io-ts.ts.snap +++ /dev/null @@ -1,89 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`ioTsResolver > should return a single error from ioTsResolver when validation fails 1`] = ` -{ - "errors": { - "animal": { - "message": "expected string but got ["dog"]", - "ref": undefined, - "type": "string", - }, - "like": [ - { - "id": { - "message": "this id is very important but you passed: string(1)", - "ref": undefined, - "type": "number", - }, - }, - ], - "luckyNumbers": [ - , - , - { - "message": "expected number but got "3"", - "ref": undefined, - "type": "number", - }, - ], - "vehicles": [ - , - { - "horsepower": { - "message": "expected number but got undefined", - "ref": undefined, - "type": "number", - }, - }, - ], - }, - "values": {}, -} -`; - -exports[`ioTsResolver > should return all the errors from ioTsResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "animal": { - "message": "expected "snake" but got ["dog"]", - "ref": undefined, - "type": ""snake"", - "types": { - ""bird"": "expected "bird" but got ["dog"]", - ""snake"": "expected "snake" but got ["dog"]", - "number": "expected number but got ["dog"]", - "string": "expected string but got ["dog"]", - }, - }, - "like": [ - { - "id": { - "message": "this id is very important but you passed: string(1)", - "ref": undefined, - "type": "number", - }, - }, - ], - "luckyNumbers": [ - , - , - { - "message": "expected number but got "3"", - "ref": undefined, - "type": "number", - }, - ], - "vehicles": [ - , - { - "horsepower": { - "message": "expected number but got undefined", - "ref": undefined, - "type": "number", - }, - }, - ], - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/io-ts/src/__tests__/errorsToRecord.ts b/node_modules/@hookform/resolvers/io-ts/src/__tests__/errorsToRecord.ts deleted file mode 100644 index 9174a9525a1271047c0100425eb2961daebb89e8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/__tests__/errorsToRecord.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { isLeft } from 'fp-ts/Either'; -import * as t from 'io-ts'; -import errorsToRecord from '../errorsToRecord'; - -const assertLeft = (result: t.Validation) => { - expect(isLeft(result)).toBe(true); - if (!isLeft(result)) { - throw new Error( - 'panic! error is not of the "left" type, should be unreachable', - ); - } - return result.left; -}; - -const FIRST_NAME_FIELD_PATH = 'firstName' as const; -const FIRST_NAME_ERROR_SHAPE = { - message: 'expected string but got undefined', - type: 'string', -}; -describe('errorsToRecord', () => { - it('should return a correct error for an exact intersection type error object', () => { - // a recommended pattern from https://github.com/gcanti/io-ts/blob/master/index.md#mixing-required-and-optional-props - const schema = t.exact( - t.intersection([ - t.type({ - [FIRST_NAME_FIELD_PATH]: t.string, - }), - t.partial({ - lastName: t.string, - }), - ]), - ); - const error = assertLeft(schema.decode({})); - const record = errorsToRecord(false)(error); - expect(record[FIRST_NAME_FIELD_PATH]).toMatchObject(FIRST_NAME_ERROR_SHAPE); - }); - it('should return a correct error for a branded intersection', () => { - interface Brand { - readonly Brand: unique symbol; - } - const schema = t.brand( - t.intersection([ - t.type({ - [FIRST_NAME_FIELD_PATH]: t.string, - }), - t.type({ - lastName: t.string, - }), - ]), - (_x): _x is t.Branded => true, - 'Brand', - ); - const error = assertLeft(schema.decode({})); - const record = errorsToRecord(false)(error); - expect(record[FIRST_NAME_FIELD_PATH]).toMatchObject(FIRST_NAME_ERROR_SHAPE); - }); -}); diff --git a/node_modules/@hookform/resolvers/io-ts/src/__tests__/io-ts.ts b/node_modules/@hookform/resolvers/io-ts/src/__tests__/io-ts.ts deleted file mode 100644 index 0b1d1d319d13cec39cdd96f9b3508586107b4c21..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/__tests__/io-ts.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { ioTsResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('ioTsResolver', () => { - it('should return values from ioTsResolver when validation pass', async () => { - const validateSpy = vi.spyOn(schema, 'decode'); - - const result = ioTsResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(validateSpy).toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from ioTsResolver when validation fails', () => { - const result = ioTsResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from ioTsResolver when validation fails with `validateAllFieldCriteria` set to true', () => { - const result = ioTsResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); -}); diff --git a/node_modules/@hookform/resolvers/io-ts/src/arrayToPath.ts b/node_modules/@hookform/resolvers/io-ts/src/arrayToPath.ts deleted file mode 100644 index b75d6c6bcae78e61e7f78ca080c3331dd2be579f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/arrayToPath.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as Either from 'fp-ts/Either'; -import { pipe } from 'fp-ts/function'; - -const arrayToPath = (paths: Either.Either[]): string => - paths.reduce( - (previous, path, index) => - pipe( - path, - Either.fold( - (key) => `${index > 0 ? '.' : ''}${key}`, - (key) => `[${key}]`, - ), - (path) => `${previous}${path}`, - ), - '', - ); - -export default arrayToPath; diff --git a/node_modules/@hookform/resolvers/io-ts/src/errorsToRecord.ts b/node_modules/@hookform/resolvers/io-ts/src/errorsToRecord.ts deleted file mode 100644 index 1828cd0099c94b90a4760a45d1e3a8cf01dcc087..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/errorsToRecord.ts +++ /dev/null @@ -1,141 +0,0 @@ -import * as Either from 'fp-ts/Either'; -import * as Option from 'fp-ts/Option'; -import * as ReadonlyArray from 'fp-ts/ReadonlyArray'; -import * as ReadonlyRecord from 'fp-ts/ReadonlyRecord'; -import * as SemiGroup from 'fp-ts/Semigroup'; -import { absurd, flow, identity, not, pipe } from 'fp-ts/function'; -import * as t from 'io-ts'; -import { - ExactType, - IntersectionType, - RefinementType, - TaggedUnionType, - UnionType, - ValidationError, -} from 'io-ts'; -import arrayToPath from './arrayToPath'; -import { ErrorObject, FieldErrorWithPath } from './types'; - -const INSTANCE_TYPES_TO_FILTER = [ - TaggedUnionType, - UnionType, - IntersectionType, - ExactType, - RefinementType, -]; -const formatErrorPath = (context: t.Context): string => - pipe( - context, - ReadonlyArray.filterMapWithIndex((index, contextEntry) => { - const previousIndex = index - 1; - const previousContextEntry = - previousIndex === -1 ? undefined : context[previousIndex]; - const shouldBeFiltered = - previousContextEntry === undefined || - INSTANCE_TYPES_TO_FILTER.some( - (type) => previousContextEntry.type instanceof type, - ); - - return shouldBeFiltered ? Option.none : Option.some(contextEntry); - }), - ReadonlyArray.map(({ key }) => key), - ReadonlyArray.map((key) => - pipe( - key, - (k) => parseInt(k, 10), - Either.fromPredicate(not(Number.isNaN), () => key), - ), - ), - ReadonlyArray.toArray, - arrayToPath, - ); - -const formatError = (e: t.ValidationError): FieldErrorWithPath => { - const path = formatErrorPath(e.context); - - const message = pipe( - e.message, - Either.fromNullable(e.context), - Either.mapLeft( - flow( - ReadonlyArray.last, - Option.map( - (contextEntry) => - `expected ${contextEntry.type.name} but got ${JSON.stringify( - contextEntry.actual, - )}`, - ), - Option.getOrElseW(() => - absurd('Error context is missing name' as never), - ), - ), - ), - Either.getOrElseW(identity), - ); - - const type = pipe( - e.context, - ReadonlyArray.last, - Option.map((contextEntry) => contextEntry.type.name), - Option.getOrElse(() => 'unknown'), - ); - - return { message, type, path }; -}; - -// this is almost the same function like Semigroup.getObjectSemigroup but reversed -// in order to get the first error -const getObjectSemigroup = < - A extends Record = never, ->(): SemiGroup.Semigroup
=> ({ - concat: (first, second) => Object.assign({}, second, first), -}); - -const concatToSingleError = ( - errors: ReadonlyArray, -): ErrorObject => - pipe( - errors, - ReadonlyArray.map((error) => ({ - [error.path]: { - type: error.type, - message: error.message, - }, - })), - (errors) => SemiGroup.fold(getObjectSemigroup())({}, errors), - ); - -const appendSeveralErrors: SemiGroup.Semigroup = { - concat: (a, b) => ({ - ...b, - types: { ...a.types, [a.type]: a.message, [b.type]: b.message }, - }), -}; - -const concatToMultipleErrors = ( - errors: ReadonlyArray, -): ErrorObject => - pipe( - ReadonlyRecord.fromFoldableMap(appendSeveralErrors, ReadonlyArray.Foldable)( - errors, - (error) => [error.path, error], - ), - ReadonlyRecord.map((errorWithPath) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { path, ...error } = errorWithPath; - - return error; - }), - ); - -const errorsToRecord = - (validateAllFieldCriteria: boolean) => - (validationErrors: ReadonlyArray): ErrorObject => { - const concat = validateAllFieldCriteria - ? concatToMultipleErrors - : concatToSingleError; - - return pipe(validationErrors, ReadonlyArray.map(formatError), concat); - }; - -export default errorsToRecord; diff --git a/node_modules/@hookform/resolvers/io-ts/src/index.ts b/node_modules/@hookform/resolvers/io-ts/src/index.ts deleted file mode 100644 index a0489c71855f954848b2ad36b589f1bee3873768..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './io-ts'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/io-ts/src/io-ts.ts b/node_modules/@hookform/resolvers/io-ts/src/io-ts.ts deleted file mode 100644 index 02ddb8e10c9e98b1d790b7e365e6212309672ffe..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/io-ts.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import * as Either from 'fp-ts/Either'; -import { pipe } from 'fp-ts/function'; -import errorsToRecord from './errorsToRecord'; -import { Resolver } from './types'; - -export const ioTsResolver: Resolver = (codec) => (values, _context, options) => - pipe( - values, - codec.decode, - Either.mapLeft( - errorsToRecord( - !options.shouldUseNativeValidation && options.criteriaMode === 'all', - ), - ), - Either.mapLeft((errors) => toNestErrors(errors, options)), - Either.fold( - (errors) => ({ - values: {}, - errors, - }), - (values) => { - options.shouldUseNativeValidation && - validateFieldsNatively({}, options); - - return { - values, - errors: {}, - } as any; - }, - ), - ); diff --git a/node_modules/@hookform/resolvers/io-ts/src/types.ts b/node_modules/@hookform/resolvers/io-ts/src/types.ts deleted file mode 100644 index d9fdda4812342b94cb1391c1abd94b50722ff345..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/io-ts/src/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as t from 'io-ts'; -import { - FieldError, - FieldValues, - ResolverOptions, - ResolverResult, -} from 'react-hook-form'; - -export type Resolver = ( - codec: t.Decoder, -) => ( - values: TFieldValues, - _context: TContext | undefined, - options: ResolverOptions, -) => ResolverResult; - -export type ErrorObject = Record; -export type FieldErrorWithPath = FieldError & { path: string }; diff --git a/node_modules/@hookform/resolvers/joi/dist/index.d.ts b/node_modules/@hookform/resolvers/joi/dist/index.d.ts deleted file mode 100644 index 1e9d42aba06d014deccc5465d5109b9bff07d4d6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './joi'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.d.ts b/node_modules/@hookform/resolvers/joi/dist/joi.d.ts deleted file mode 100644 index aa10ba5ef2ac70c3ea109a686795f621a82d45f8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Resolver } from './types'; -export declare const joiResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.js b/node_modules/@hookform/resolvers/joi/dist/joi.js deleted file mode 100644 index d35a3c38ae4da523a18661f4f7dace82cbd4f052..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("react-hook-form");exports.joiResolver=function(t,n,o){return void 0===n&&(n={abortEarly:!1}),void 0===o&&(o={}),function(a,i,s){try{var u=function(){return l.error?{values:{},errors:e.toNestErrors((t=l.error,n=!s.shouldUseNativeValidation&&"all"===s.criteriaMode,t.details.length?t.details.reduce(function(e,t){var o=t.path.join(".");if(e[o]||(e[o]={message:t.message,type:t.type}),n){var a=e[o].types,i=a&&a[t.type];e[o]=r.appendErrors(o,n,e,t.type,i?[].concat(i,t.message):t.message)}return e},{}):{}),s)}:(s.shouldUseNativeValidation&&e.validateFieldsNatively({},s),{errors:{},values:l.value});var t,n},c=Object.assign({},n,{context:i}),l={},v=function(){if("sync"===o.mode)l=t.validate(a,c);else{var e=function(e,r){try{var t=e()}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(function(){return Promise.resolve(t.validateAsync(a,c)).then(function(e){l.value=e})},function(e){l.error=e});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(v&&v.then?v.then(u):u())}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=joi.js.map diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.js.map b/node_modules/@hookform/resolvers/joi/dist/joi.js.map deleted file mode 100644 index 4ebdb97ff7a1fffa966e7af3e9b8b6ff55682cb6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"joi.js","sources":["../src/joi.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'joi';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n error: ValidationError,\n validateAllFieldCriteria: boolean,\n) =>\n error.details.length\n ? error.details.reduce>((previous, error) => {\n const _path = error.path.join('.');\n\n if (!previous[_path]) {\n previous[_path] = { message: error.message, type: error.type };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[_path].types;\n const messages = types && types[error.type!];\n\n previous[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n previous,\n error.type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {})\n : {};\n\nexport const joiResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n resolverOptions = {},\n ) =>\n async (values, context, options) => {\n const _schemaOptions = Object.assign({}, schemaOptions, {\n context,\n });\n\n let result: Record = {};\n if (resolverOptions.mode === 'sync') {\n result = schema.validate(values, _schemaOptions);\n } else {\n try {\n result.value = await schema.validateAsync(values, _schemaOptions);\n } catch (e) {\n result.error = e;\n }\n }\n\n if (result.error) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.error,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: result.value,\n };\n };\n"],"names":["schema","schemaOptions","resolverOptions","abortEarly","values","context","options","_temp3","result","error","errors","toNestErrors","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","details","length","reduce","previous","_path","path","join","message","type","types","messages","appendErrors","concat","validateFieldsNatively","value","_schemaOptions","Object","assign","_temp2","mode","validate","_temp","_catch","Promise","resolve","validateAsync","then","_schema$validateAsync","e","reject"],"mappings":"sFAqCE,SACEA,EACAC,EAGAC,GAAoB,YAHpBD,IAAAA,IAAAA,EAAgB,CACdE,YAAY,SAEdD,IAAAA,IAAAA,EAAkB,CAAE,GAAA,SAEfE,EAAQC,EAASC,GAAW,IAAA,IAAAC,EAAAA,WAgBjC,OAAIC,EAAOC,MACF,CACLL,OAAQ,CAAA,EACRM,OAAQC,EAAAA,cAzDdF,EA2DUD,EAAOC,MA1DjBG,GA2DWN,EAAQO,2BACkB,QAAzBP,EAAQQ,aA1DpBL,EAAMM,QAAQC,OACVP,EAAMM,QAAQE,OAAmC,SAACC,EAAUT,GAC1D,IAAMU,EAAQV,EAAMW,KAAKC,KAAK,KAM9B,GAJKH,EAASC,KACZD,EAASC,GAAS,CAAEG,QAASb,EAAMa,QAASC,KAAMd,EAAMc,OAGtDX,EAA0B,CAC5B,IAAMY,EAAQN,EAASC,GAAOK,MACxBC,EAAWD,GAASA,EAAMf,EAAMc,MAEtCL,EAASC,GAASO,EAAAA,aAChBP,EACAP,EACAM,EACAT,EAAMc,KACNE,EACK,GAAgBE,OAAOF,EAAsBhB,EAAMa,SACpDb,EAAMa,QAEd,CAEA,OAAOJ,CACT,EAAG,CAAA,GACH,CAAE,GAmCEZ,KAKNA,EAAQO,2BAA6Be,EAAsBA,uBAAC,GAAItB,GAEzD,CACLI,OAAQ,CAAA,EACRN,OAAQI,EAAOqB,QAzEI,IACvBpB,EACAG,CAwEI,EAlCIkB,EAAiBC,OAAOC,OAAO,CAAA,EAAI/B,EAAe,CACtDI,QAAAA,IAGEG,EAA8B,CAAA,EAAGyB,gBACR,SAAzB/B,EAAgBgC,KAClB1B,EAASR,EAAOmC,SAAS/B,EAAQ0B,OAAgBM,CAAAA,IAAAA,uFAAAC,YAE7CC,OAAAA,QAAAC,QACmBvC,EAAOwC,cAAcpC,EAAQ0B,IAAeW,KAAA,SAAAC,GAAjElC,EAAOqB,MAAKa,CAAsD,EACpE,EAASC,SAAAA,GACPnC,EAAOC,MAAQkC,CACjB,GAACP,GAAAA,GAAAA,EAAAK,YAAAL,EAAAK,KAAA,aAAA,CAAA,IAAA,OAAAH,QAAAC,QAAAN,GAAAA,EAAAQ,KAAAR,EAAAQ,KAAAlC,GAAAA,IAuBL,CAAC,MAAAoC,UAAAL,QAAAM,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.mjs b/node_modules/@hookform/resolvers/joi/dist/joi.mjs deleted file mode 100644 index b3637daff829f5fcf9394517d2c1891dde0ce39d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as e,validateFieldsNatively as r}from"@hookform/resolvers";import{appendErrors as t}from"react-hook-form";var n=function(n,o,a){return void 0===o&&(o={abortEarly:!1}),void 0===a&&(a={}),function(i,s,u){try{var c=function(){return l.error?{values:{},errors:e((n=l.error,o=!u.shouldUseNativeValidation&&"all"===u.criteriaMode,n.details.length?n.details.reduce(function(e,r){var n=r.path.join(".");if(e[n]||(e[n]={message:r.message,type:r.type}),o){var a=e[n].types,i=a&&a[r.type];e[n]=t(n,o,e,r.type,i?[].concat(i,r.message):r.message)}return e},{}):{}),u)}:(u.shouldUseNativeValidation&&r({},u),{errors:{},values:l.value});var n,o},v=Object.assign({},o,{context:s}),l={},f=function(){if("sync"===a.mode)l=n.validate(i,v);else{var e=function(e,r){try{var t=e()}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(function(){return Promise.resolve(n.validateAsync(i,v)).then(function(e){l.value=e})},function(e){l.error=e});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(f&&f.then?f.then(c):c())}catch(e){return Promise.reject(e)}}};export{n as joiResolver}; -//# sourceMappingURL=joi.module.js.map diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.modern.mjs b/node_modules/@hookform/resolvers/joi/dist/joi.modern.mjs deleted file mode 100644 index b60d3a0c59eb57d5951ee915cbc0f7ef53b9345b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as e,validateFieldsNatively as r}from"@hookform/resolvers";import{appendErrors as t}from"react-hook-form";const a=(a,o={abortEarly:!1},s={})=>async(i,l,c)=>{const n=Object.assign({},o,{context:l});let d={};if("sync"===s.mode)d=a.validate(i,n);else try{d.value=await a.validateAsync(i,n)}catch(e){d.error=e}return d.error?{values:{},errors:e((m=d.error,v=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,m.details.length?m.details.reduce((e,r)=>{const a=r.path.join(".");if(e[a]||(e[a]={message:r.message,type:r.type}),v){const o=e[a].types,s=o&&o[r.type];e[a]=t(a,v,e,r.type,s?[].concat(s,r.message):r.message)}return e},{}):{}),c)}:(c.shouldUseNativeValidation&&r({},c),{errors:{},values:d.value});var m,v};export{a as joiResolver}; -//# sourceMappingURL=joi.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.modern.mjs.map b/node_modules/@hookform/resolvers/joi/dist/joi.modern.mjs.map deleted file mode 100644 index 94a9d204b0ca91f715901477fab1f9e6800821d8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"joi.modern.mjs","sources":["../src/joi.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'joi';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n error: ValidationError,\n validateAllFieldCriteria: boolean,\n) =>\n error.details.length\n ? error.details.reduce>((previous, error) => {\n const _path = error.path.join('.');\n\n if (!previous[_path]) {\n previous[_path] = { message: error.message, type: error.type };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[_path].types;\n const messages = types && types[error.type!];\n\n previous[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n previous,\n error.type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {})\n : {};\n\nexport const joiResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n resolverOptions = {},\n ) =>\n async (values, context, options) => {\n const _schemaOptions = Object.assign({}, schemaOptions, {\n context,\n });\n\n let result: Record = {};\n if (resolverOptions.mode === 'sync') {\n result = schema.validate(values, _schemaOptions);\n } else {\n try {\n result.value = await schema.validateAsync(values, _schemaOptions);\n } catch (e) {\n result.error = e;\n }\n }\n\n if (result.error) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.error,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: result.value,\n };\n };\n"],"names":["joiResolver","schema","schemaOptions","abortEarly","resolverOptions","async","values","context","options","_schemaOptions","Object","assign","result","mode","validate","value","validateAsync","e","error","errors","toNestErrors","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","details","length","reduce","previous","_path","path","join","message","type","types","messages","appendErrors","concat","validateFieldsNatively","parseErrorSchema"],"mappings":"8HAKA,MA+BaA,EACXA,CACEC,EACAC,EAAgB,CACdC,YAAY,GAEdC,EAAkB,KAEpBC,MAAOC,EAAQC,EAASC,KACtB,MAAMC,EAAiBC,OAAOC,OAAO,CAAA,EAAIT,EAAe,CACtDK,YAGF,IAAIK,EAA8B,CAAA,EAClC,GAA6B,SAAzBR,EAAgBS,KAClBD,EAASX,EAAOa,SAASR,EAAQG,QAEjC,IACEG,EAAOG,YAAcd,EAAOe,cAAcV,EAAQG,EACpD,CAAE,MAAOQ,GACPL,EAAOM,MAAQD,CACjB,CAGF,OAAIL,EAAOM,MACF,CACLZ,OAAQ,CAAE,EACVa,OAAQC,GAzDdF,EA2DUN,EAAOM,MA1DjBG,GA2DWb,EAAQc,2BACkB,QAAzBd,EAAQe,aA1DpBL,EAAMM,QAAQC,OACVP,EAAMM,QAAQE,OAAmC,CAACC,EAAUT,KAC1D,MAAMU,EAAQV,EAAMW,KAAKC,KAAK,KAM9B,GAJKH,EAASC,KACZD,EAASC,GAAS,CAAEG,QAASb,EAAMa,QAASC,KAAMd,EAAMc,OAGtDX,EAA0B,CAC5B,MAAMY,EAAQN,EAASC,GAAOK,MACxBC,EAAWD,GAASA,EAAMf,EAAMc,MAEtCL,EAASC,GAASO,EAChBP,EACAP,EACAM,EACAT,EAAMc,KACNE,EACK,GAAgBE,OAAOF,EAAsBhB,EAAMa,SACpDb,EAAMa,QAEd,CAEA,OAAOJ,GACN,CAAE,GACL,CAAE,GAmCEnB,KAKNA,EAAQc,2BAA6Be,EAAuB,CAAA,EAAI7B,GAEzD,CACLW,OAAQ,CAAA,EACRb,OAAQM,EAAOG,QAzEIuB,IACvBpB,EACAG"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.module.js b/node_modules/@hookform/resolvers/joi/dist/joi.module.js deleted file mode 100644 index b3637daff829f5fcf9394517d2c1891dde0ce39d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as e,validateFieldsNatively as r}from"@hookform/resolvers";import{appendErrors as t}from"react-hook-form";var n=function(n,o,a){return void 0===o&&(o={abortEarly:!1}),void 0===a&&(a={}),function(i,s,u){try{var c=function(){return l.error?{values:{},errors:e((n=l.error,o=!u.shouldUseNativeValidation&&"all"===u.criteriaMode,n.details.length?n.details.reduce(function(e,r){var n=r.path.join(".");if(e[n]||(e[n]={message:r.message,type:r.type}),o){var a=e[n].types,i=a&&a[r.type];e[n]=t(n,o,e,r.type,i?[].concat(i,r.message):r.message)}return e},{}):{}),u)}:(u.shouldUseNativeValidation&&r({},u),{errors:{},values:l.value});var n,o},v=Object.assign({},o,{context:s}),l={},f=function(){if("sync"===a.mode)l=n.validate(i,v);else{var e=function(e,r){try{var t=e()}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(function(){return Promise.resolve(n.validateAsync(i,v)).then(function(e){l.value=e})},function(e){l.error=e});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(f&&f.then?f.then(c):c())}catch(e){return Promise.reject(e)}}};export{n as joiResolver}; -//# sourceMappingURL=joi.module.js.map diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.module.js.map b/node_modules/@hookform/resolvers/joi/dist/joi.module.js.map deleted file mode 100644 index c09bdd9e0095b7b3c67722e6df9e72ecca22573b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"joi.module.js","sources":["../src/joi.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'joi';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n error: ValidationError,\n validateAllFieldCriteria: boolean,\n) =>\n error.details.length\n ? error.details.reduce>((previous, error) => {\n const _path = error.path.join('.');\n\n if (!previous[_path]) {\n previous[_path] = { message: error.message, type: error.type };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[_path].types;\n const messages = types && types[error.type!];\n\n previous[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n previous,\n error.type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {})\n : {};\n\nexport const joiResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n resolverOptions = {},\n ) =>\n async (values, context, options) => {\n const _schemaOptions = Object.assign({}, schemaOptions, {\n context,\n });\n\n let result: Record = {};\n if (resolverOptions.mode === 'sync') {\n result = schema.validate(values, _schemaOptions);\n } else {\n try {\n result.value = await schema.validateAsync(values, _schemaOptions);\n } catch (e) {\n result.error = e;\n }\n }\n\n if (result.error) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.error,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: result.value,\n };\n };\n"],"names":["joiResolver","schema","schemaOptions","resolverOptions","abortEarly","values","context","options","_temp3","result","error","errors","toNestErrors","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","details","length","reduce","previous","_path","path","join","message","type","types","messages","appendErrors","concat","validateFieldsNatively","value","_schemaOptions","Object","assign","_temp2","mode","validate","_temp","_catch","Promise","resolve","validateAsync","then","_schema$validateAsync","e","reject"],"mappings":"8HAKA,IA+BaA,EACX,SACEC,EACAC,EAGAC,GAAoB,YAHpBD,IAAAA,IAAAA,EAAgB,CACdE,YAAY,SAEdD,IAAAA,IAAAA,EAAkB,CAAE,GAAA,SAEfE,EAAQC,EAASC,GAAW,IAAA,IAAAC,EAAAA,WAgBjC,OAAIC,EAAOC,MACF,CACLL,OAAQ,CAAA,EACRM,OAAQC,GAzDdF,EA2DUD,EAAOC,MA1DjBG,GA2DWN,EAAQO,2BACkB,QAAzBP,EAAQQ,aA1DpBL,EAAMM,QAAQC,OACVP,EAAMM,QAAQE,OAAmC,SAACC,EAAUT,GAC1D,IAAMU,EAAQV,EAAMW,KAAKC,KAAK,KAM9B,GAJKH,EAASC,KACZD,EAASC,GAAS,CAAEG,QAASb,EAAMa,QAASC,KAAMd,EAAMc,OAGtDX,EAA0B,CAC5B,IAAMY,EAAQN,EAASC,GAAOK,MACxBC,EAAWD,GAASA,EAAMf,EAAMc,MAEtCL,EAASC,GAASO,EAChBP,EACAP,EACAM,EACAT,EAAMc,KACNE,EACK,GAAgBE,OAAOF,EAAsBhB,EAAMa,SACpDb,EAAMa,QAEd,CAEA,OAAOJ,CACT,EAAG,CAAA,GACH,CAAE,GAmCEZ,KAKNA,EAAQO,2BAA6Be,EAAuB,GAAItB,GAEzD,CACLI,OAAQ,CAAA,EACRN,OAAQI,EAAOqB,QAzEI,IACvBpB,EACAG,CAwEI,EAlCIkB,EAAiBC,OAAOC,OAAO,CAAA,EAAI/B,EAAe,CACtDI,QAAAA,IAGEG,EAA8B,CAAA,EAAGyB,gBACR,SAAzB/B,EAAgBgC,KAClB1B,EAASR,EAAOmC,SAAS/B,EAAQ0B,OAAgBM,CAAAA,IAAAA,uFAAAC,YAE7CC,OAAAA,QAAAC,QACmBvC,EAAOwC,cAAcpC,EAAQ0B,IAAeW,KAAA,SAAAC,GAAjElC,EAAOqB,MAAKa,CAAsD,EACpE,EAASC,SAAAA,GACPnC,EAAOC,MAAQkC,CACjB,GAACP,GAAAA,GAAAA,EAAAK,YAAAL,EAAAK,KAAA,aAAA,CAAA,IAAA,OAAAH,QAAAC,QAAAN,GAAAA,EAAAQ,KAAAR,EAAAQ,KAAAlC,GAAAA,IAuBL,CAAC,MAAAoC,UAAAL,QAAAM,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.umd.js b/node_modules/@hookform/resolvers/joi/dist/joi.umd.js deleted file mode 100644 index 7a66008403477ae87f0e64b385d99f9bd4659650..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],r):r((e||self).hookformResolversJoi={},e.hookformResolvers,e.ReactHookForm)}(this,function(e,r,o){e.joiResolver=function(e,t,n){return void 0===t&&(t={abortEarly:!1}),void 0===n&&(n={}),function(i,s,a){try{var u=function(){return f.error?{values:{},errors:r.toNestErrors((e=f.error,t=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,e.details.length?e.details.reduce(function(e,r){var n=r.path.join(".");if(e[n]||(e[n]={message:r.message,type:r.type}),t){var i=e[n].types,s=i&&i[r.type];e[n]=o.appendErrors(n,t,e,r.type,s?[].concat(s,r.message):r.message)}return e},{}):{}),a)}:(a.shouldUseNativeValidation&&r.validateFieldsNatively({},a),{errors:{},values:f.value});var e,t},l=Object.assign({},t,{context:s}),f={},c=function(){if("sync"===n.mode)f=e.validate(i,l);else{var r=function(e,r){try{var o=e()}catch(e){return r(e)}return o&&o.then?o.then(void 0,r):o}(function(){return Promise.resolve(e.validateAsync(i,l)).then(function(e){f.value=e})},function(e){f.error=e});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(c&&c.then?c.then(u):u())}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=joi.umd.js.map diff --git a/node_modules/@hookform/resolvers/joi/dist/joi.umd.js.map b/node_modules/@hookform/resolvers/joi/dist/joi.umd.js.map deleted file mode 100644 index ab2cd2baaa0cfc8e0eb25489a7f274455ace1aa2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/joi.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"joi.umd.js","sources":["../src/joi.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationError } from 'joi';\nimport { FieldError, appendErrors } from 'react-hook-form';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (\n error: ValidationError,\n validateAllFieldCriteria: boolean,\n) =>\n error.details.length\n ? error.details.reduce>((previous, error) => {\n const _path = error.path.join('.');\n\n if (!previous[_path]) {\n previous[_path] = { message: error.message, type: error.type };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[_path].types;\n const messages = types && types[error.type!];\n\n previous[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n previous,\n error.type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n }, {})\n : {};\n\nexport const joiResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n resolverOptions = {},\n ) =>\n async (values, context, options) => {\n const _schemaOptions = Object.assign({}, schemaOptions, {\n context,\n });\n\n let result: Record = {};\n if (resolverOptions.mode === 'sync') {\n result = schema.validate(values, _schemaOptions);\n } else {\n try {\n result.value = await schema.validateAsync(values, _schemaOptions);\n } catch (e) {\n result.error = e;\n }\n }\n\n if (result.error) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.error,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {},\n values: result.value,\n };\n };\n"],"names":["schema","schemaOptions","resolverOptions","abortEarly","values","context","options","_temp3","result","error","errors","toNestErrors","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","details","length","reduce","previous","_path","path","join","message","type","types","messages","appendErrors","concat","validateFieldsNatively","value","_schemaOptions","Object","assign","_temp2","mode","validate","_temp","_catch","Promise","resolve","validateAsync","then","_schema$validateAsync","e","reject"],"mappings":"sYAqCE,SACEA,EACAC,EAGAC,GAAoB,YAHpBD,IAAAA,IAAAA,EAAgB,CACdE,YAAY,SAEdD,IAAAA,IAAAA,EAAkB,CAAE,GAAA,SAEfE,EAAQC,EAASC,GAAW,IAAA,IAAAC,EAAAA,WAgBjC,OAAIC,EAAOC,MACF,CACLL,OAAQ,CAAA,EACRM,OAAQC,EAAAA,cAzDdF,EA2DUD,EAAOC,MA1DjBG,GA2DWN,EAAQO,2BACkB,QAAzBP,EAAQQ,aA1DpBL,EAAMM,QAAQC,OACVP,EAAMM,QAAQE,OAAmC,SAACC,EAAUT,GAC1D,IAAMU,EAAQV,EAAMW,KAAKC,KAAK,KAM9B,GAJKH,EAASC,KACZD,EAASC,GAAS,CAAEG,QAASb,EAAMa,QAASC,KAAMd,EAAMc,OAGtDX,EAA0B,CAC5B,IAAMY,EAAQN,EAASC,GAAOK,MACxBC,EAAWD,GAASA,EAAMf,EAAMc,MAEtCL,EAASC,GAASO,EAAAA,aAChBP,EACAP,EACAM,EACAT,EAAMc,KACNE,EACK,GAAgBE,OAAOF,EAAsBhB,EAAMa,SACpDb,EAAMa,QAEd,CAEA,OAAOJ,CACT,EAAG,CAAA,GACH,CAAE,GAmCEZ,KAKNA,EAAQO,2BAA6Be,EAAsBA,uBAAC,GAAItB,GAEzD,CACLI,OAAQ,CAAA,EACRN,OAAQI,EAAOqB,QAzEI,IACvBpB,EACAG,CAwEI,EAlCIkB,EAAiBC,OAAOC,OAAO,CAAA,EAAI/B,EAAe,CACtDI,QAAAA,IAGEG,EAA8B,CAAA,EAAGyB,gBACR,SAAzB/B,EAAgBgC,KAClB1B,EAASR,EAAOmC,SAAS/B,EAAQ0B,OAAgBM,CAAAA,IAAAA,uFAAAC,YAE7CC,OAAAA,QAAAC,QACmBvC,EAAOwC,cAAcpC,EAAQ0B,IAAeW,KAAA,SAAAC,GAAjElC,EAAOqB,MAAKa,CAAsD,EACpE,EAASC,SAAAA,GACPnC,EAAOC,MAAQkC,CACjB,GAACP,GAAAA,GAAAA,EAAAK,YAAAL,EAAAK,KAAA,aAAA,CAAA,IAAA,OAAAH,QAAAC,QAAAN,GAAAA,EAAAQ,KAAAR,EAAAQ,KAAAlC,GAAAA,IAuBL,CAAC,MAAAoC,UAAAL,QAAAM,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/joi/dist/types.d.ts b/node_modules/@hookform/resolvers/joi/dist/types.d.ts deleted file mode 100644 index 067cbc17b8e3b45ba105a89e21d587c50e8bd9d2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/dist/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AsyncValidationOptions, Schema } from 'joi'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (schema: T, schemaOptions?: AsyncValidationOptions, factoryOptions?: { - mode?: 'async' | 'sync'; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/joi/package.json b/node_modules/@hookform/resolvers/joi/package.json deleted file mode 100644 index 7f0464dbcbbf62dd5b210243aeff531fc4960f26..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@hookform/resolvers/joi", - "amdName": "hookformResolversJoi", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: joi", - "main": "dist/joi.js", - "module": "dist/joi.module.js", - "umd:main": "dist/joi.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/joi/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/joi/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index f4a2e83ce8df6e99e84d5a062c27d34cfdf68a16..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import * as Joi from 'joi'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { joiResolver } from '..'; - -const schema = Joi.object({ - username: Joi.string().required(), - password: Joi.string().required(), -}); - -interface FormData { - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: joiResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Joi", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe( - '"username" is not allowed to be empty', - ); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe( - '"password" is not allowed to be empty', - ); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/joi/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/joi/src/__tests__/Form.tsx deleted file mode 100644 index 038fe9d2f93d011dbb46265111d61de122bfcf0c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/__tests__/Form.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import * as Joi from 'joi'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { joiResolver } from '..'; - -const schema = Joi.object({ - username: Joi.string().required(), - password: Joi.string().required(), -}); - -interface FormData { - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: joiResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Joi and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getByText(/"username" is not allowed to be empty/i), - ).toBeInTheDocument(); - expect( - screen.getByText(/"password" is not allowed to be empty/i), - ).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/joi/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/joi/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 87a6b9b77ae089a531c67d48ca8474c61bec2aef..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as Joi from 'joi'; - -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = Joi.object({ - username: Joi.string().alphanum().min(3).max(30).required(), - password: Joi.string() - .pattern(new RegExp('.*[A-Z].*'), 'One uppercase character') - .pattern(new RegExp('.*[a-z].*'), 'One lowercase character') - .pattern(new RegExp('.*\\d.*'), 'One number') - .pattern( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ) - .min(8) - .required(), - repeatPassword: Joi.ref('password'), - accessToken: [Joi.string(), Joi.number()], - birthYear: Joi.number().integer().min(1900).max(2013), - email: Joi.string().email({ - minDomainSegments: 2, - tlds: { allow: ['com', 'net'] }, - }), - tags: Joi.array().items(Joi.string()).required(), - enabled: Joi.boolean().required(), - like: Joi.array() - .items( - Joi.object({ id: Joi.number(), name: Joi.string().length(4).regex(/a/) }), - ) - .optional(), -}); - -interface Data { - username: string; - password: string; - repeatPassword: string; - accessToken?: number | string; - birthYear?: number; - email?: string; - tags: string[]; - enabled: boolean; - like: { id: number; name: string }[]; -} - -export const validData: Data = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - like: [ - { - id: 1, - name: 'name', - }, - ], -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z', name: 'r' }], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/joi/src/__tests__/__snapshots__/joi.ts.snap b/node_modules/@hookform/resolvers/joi/src/__tests__/__snapshots__/joi.ts.snap deleted file mode 100644 index 06dee50be489d82766cca9122d29dda7d333deaa..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/__tests__/__snapshots__/joi.ts.snap +++ /dev/null @@ -1,293 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`joiResolver > should return a single error from joiResolver when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": ""birthYear" must be a number", - "ref": undefined, - "type": "number.base", - }, - "email": { - "message": ""email" is not allowed to be empty", - "ref": { - "name": "email", - }, - "type": "string.empty", - }, - "enabled": { - "message": ""enabled" is required", - "ref": undefined, - "type": "any.required", - }, - "like": [ - { - "id": { - "message": ""like[0].id" must be a number", - "ref": undefined, - "type": "number.base", - }, - "name": { - "message": ""like[0].name" length must be 4 characters long", - "ref": undefined, - "type": "string.length", - }, - }, - ], - "password": { - "message": ""password" with value "___" fails to match the One uppercase character pattern", - "ref": { - "name": "password", - }, - "type": "string.pattern.name", - }, - "tags": { - "message": ""tags" is required", - "ref": undefined, - "type": "any.required", - }, - "username": { - "message": ""username" is required", - "ref": { - "name": "username", - }, - "type": "any.required", - }, - }, - "values": {}, -} -`; - -exports[`joiResolver > should return a single error from joiResolver with \`mode: sync\` when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": ""birthYear" must be a number", - "ref": undefined, - "type": "number.base", - }, - "email": { - "message": ""email" is not allowed to be empty", - "ref": { - "name": "email", - }, - "type": "string.empty", - }, - "enabled": { - "message": ""enabled" is required", - "ref": undefined, - "type": "any.required", - }, - "like": [ - { - "id": { - "message": ""like[0].id" must be a number", - "ref": undefined, - "type": "number.base", - }, - "name": { - "message": ""like[0].name" length must be 4 characters long", - "ref": undefined, - "type": "string.length", - }, - }, - ], - "password": { - "message": ""password" with value "___" fails to match the One uppercase character pattern", - "ref": { - "name": "password", - }, - "type": "string.pattern.name", - }, - "tags": { - "message": ""tags" is required", - "ref": undefined, - "type": "any.required", - }, - "username": { - "message": ""username" is required", - "ref": { - "name": "username", - }, - "type": "any.required", - }, - }, - "values": {}, -} -`; - -exports[`joiResolver > should return all the errors from joiResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "birthYear": { - "message": ""birthYear" must be a number", - "ref": undefined, - "type": "number.base", - "types": { - "number.base": ""birthYear" must be a number", - }, - }, - "email": { - "message": ""email" is not allowed to be empty", - "ref": { - "name": "email", - }, - "type": "string.empty", - "types": { - "string.empty": ""email" is not allowed to be empty", - }, - }, - "enabled": { - "message": ""enabled" is required", - "ref": undefined, - "type": "any.required", - "types": { - "any.required": ""enabled" is required", - }, - }, - "like": [ - { - "id": { - "message": ""like[0].id" must be a number", - "ref": undefined, - "type": "number.base", - "types": { - "number.base": ""like[0].id" must be a number", - }, - }, - "name": { - "message": ""like[0].name" length must be 4 characters long", - "ref": undefined, - "type": "string.length", - "types": { - "string.length": ""like[0].name" length must be 4 characters long", - "string.pattern.base": ""like[0].name" with value "r" fails to match the required pattern: /a/", - }, - }, - }, - ], - "password": { - "message": ""password" with value "___" fails to match the One uppercase character pattern", - "ref": { - "name": "password", - }, - "type": "string.pattern.name", - "types": { - "string.min": ""password" length must be at least 8 characters long", - "string.pattern.name": [ - ""password" with value "___" fails to match the One uppercase character pattern", - ""password" with value "___" fails to match the One lowercase character pattern", - ""password" with value "___" fails to match the One number pattern", - ], - }, - }, - "tags": { - "message": ""tags" is required", - "ref": undefined, - "type": "any.required", - "types": { - "any.required": ""tags" is required", - }, - }, - "username": { - "message": ""username" is required", - "ref": { - "name": "username", - }, - "type": "any.required", - "types": { - "any.required": ""username" is required", - }, - }, - }, - "values": {}, -} -`; - -exports[`joiResolver > should return all the errors from joiResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "birthYear": { - "message": ""birthYear" must be a number", - "ref": undefined, - "type": "number.base", - "types": { - "number.base": ""birthYear" must be a number", - }, - }, - "email": { - "message": ""email" is not allowed to be empty", - "ref": { - "name": "email", - }, - "type": "string.empty", - "types": { - "string.empty": ""email" is not allowed to be empty", - }, - }, - "enabled": { - "message": ""enabled" is required", - "ref": undefined, - "type": "any.required", - "types": { - "any.required": ""enabled" is required", - }, - }, - "like": [ - { - "id": { - "message": ""like[0].id" must be a number", - "ref": undefined, - "type": "number.base", - "types": { - "number.base": ""like[0].id" must be a number", - }, - }, - "name": { - "message": ""like[0].name" length must be 4 characters long", - "ref": undefined, - "type": "string.length", - "types": { - "string.length": ""like[0].name" length must be 4 characters long", - "string.pattern.base": ""like[0].name" with value "r" fails to match the required pattern: /a/", - }, - }, - }, - ], - "password": { - "message": ""password" with value "___" fails to match the One uppercase character pattern", - "ref": { - "name": "password", - }, - "type": "string.pattern.name", - "types": { - "string.min": ""password" length must be at least 8 characters long", - "string.pattern.name": [ - ""password" with value "___" fails to match the One uppercase character pattern", - ""password" with value "___" fails to match the One lowercase character pattern", - ""password" with value "___" fails to match the One number pattern", - ], - }, - }, - "tags": { - "message": ""tags" is required", - "ref": undefined, - "type": "any.required", - "types": { - "any.required": ""tags" is required", - }, - }, - "username": { - "message": ""username" is required", - "ref": { - "name": "username", - }, - "type": "any.required", - "types": { - "any.required": ""username" is required", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/joi/src/__tests__/joi.ts b/node_modules/@hookform/resolvers/joi/src/__tests__/joi.ts deleted file mode 100644 index 36dc28b9058e70a21a8c9f868252cc24e3e4d6ff..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/__tests__/joi.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { joiResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('joiResolver', () => { - it('should return values from joiResolver when validation pass', async () => { - const validateAsyncSpy = vi.spyOn(schema, 'validateAsync'); - const validateSpy = vi.spyOn(schema, 'validate'); - - const result = await joiResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(validateSpy).not.toHaveBeenCalled(); - expect(validateAsyncSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return values from joiResolver with `mode: sync` when validation pass', async () => { - const validateAsyncSpy = vi.spyOn(schema, 'validateAsync'); - const validateSpy = vi.spyOn(schema, 'validate'); - - const result = await joiResolver(schema, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }); - - expect(validateAsyncSpy).not.toHaveBeenCalled(); - expect(validateSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from joiResolver when validation fails', async () => { - const result = await joiResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from joiResolver with `mode: sync` when validation fails', async () => { - const validateAsyncSpy = vi.spyOn(schema, 'validateAsync'); - const validateSpy = vi.spyOn(schema, 'validate'); - - const result = await joiResolver(schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }); - - expect(validateAsyncSpy).not.toHaveBeenCalled(); - expect(validateSpy).toHaveBeenCalledTimes(1); - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from joiResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await joiResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from joiResolver when validation fails with `validateAllFieldCriteria` set to true and `mode: sync`', async () => { - const result = await joiResolver(schema, undefined, { mode: 'sync' })( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return values from joiResolver when validation pass and pass down the Joi context', async () => { - const context = { value: 'context' }; - const validateAsyncSpy = vi.spyOn(schema, 'validateAsync'); - const validateSpy = vi.spyOn(schema, 'validate'); - - const result = await joiResolver(schema)(validData, context, { - fields, - shouldUseNativeValidation, - }); - - expect(validateSpy).not.toHaveBeenCalled(); - expect(validateAsyncSpy).toHaveBeenCalledTimes(1); - expect(validateAsyncSpy).toHaveBeenCalledWith(validData, { - abortEarly: false, - context, - }); - expect(result).toEqual({ errors: {}, values: validData }); - }); -}); diff --git a/node_modules/@hookform/resolvers/joi/src/index.ts b/node_modules/@hookform/resolvers/joi/src/index.ts deleted file mode 100644 index 1e9d42aba06d014deccc5465d5109b9bff07d4d6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './joi'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/joi/src/joi.ts b/node_modules/@hookform/resolvers/joi/src/joi.ts deleted file mode 100644 index bdcd73d07b31dc729edef5f278dc3ba1dc30d058..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/joi.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import type { ValidationError } from 'joi'; -import { FieldError, appendErrors } from 'react-hook-form'; -import { Resolver } from './types'; - -const parseErrorSchema = ( - error: ValidationError, - validateAllFieldCriteria: boolean, -) => - error.details.length - ? error.details.reduce>((previous, error) => { - const _path = error.path.join('.'); - - if (!previous[_path]) { - previous[_path] = { message: error.message, type: error.type }; - } - - if (validateAllFieldCriteria) { - const types = previous[_path].types; - const messages = types && types[error.type!]; - - previous[_path] = appendErrors( - _path, - validateAllFieldCriteria, - previous, - error.type, - messages - ? ([] as string[]).concat(messages as string[], error.message) - : error.message, - ) as FieldError; - } - - return previous; - }, {}) - : {}; - -export const joiResolver: Resolver = - ( - schema, - schemaOptions = { - abortEarly: false, - }, - resolverOptions = {}, - ) => - async (values, context, options) => { - const _schemaOptions = Object.assign({}, schemaOptions, { - context, - }); - - let result: Record = {}; - if (resolverOptions.mode === 'sync') { - result = schema.validate(values, _schemaOptions); - } else { - try { - result.value = await schema.validateAsync(values, _schemaOptions); - } catch (e) { - result.error = e; - } - } - - if (result.error) { - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - result.error, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - } - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - errors: {}, - values: result.value, - }; - }; diff --git a/node_modules/@hookform/resolvers/joi/src/types.ts b/node_modules/@hookform/resolvers/joi/src/types.ts deleted file mode 100644 index 262c5cf4dff97eaba6d94bcecb167b70bd5a511d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/joi/src/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AsyncValidationOptions, Schema } from 'joi'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = ( - schema: T, - schemaOptions?: AsyncValidationOptions, - factoryOptions?: { mode?: 'async' | 'sync' }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/nope/dist/index.d.ts b/node_modules/@hookform/resolvers/nope/dist/index.d.ts deleted file mode 100644 index 70d2e237299d0ebfd856eb4c8016838df67c5a99..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './nope'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.d.ts b/node_modules/@hookform/resolvers/nope/dist/nope.d.ts deleted file mode 100644 index 45487a98fbe4b3c138b59f5754ba6894251defb6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const nopeResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.js b/node_modules/@hookform/resolvers/nope/dist/nope.js deleted file mode 100644 index 690c1bc673312924571a0239d4c91cdf71a2023e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers"),e=function r(e,o,t){return void 0===o&&(o={}),void 0===t&&(t=""),Object.keys(e).reduce(function(o,s){var a=t?t+"."+s:s,i=e[s];return"string"==typeof i?o[a]={message:i}:r(i,o,a),o},o)};exports.nopeResolver=function(o,t){return void 0===t&&(t={abortEarly:!1}),function(s,a,i){var n=o.validate(s,a,t);return n?{values:{},errors:r.toNestErrors(e(n),i)}:(i.shouldUseNativeValidation&&r.validateFieldsNatively({},i),{values:s,errors:{}})}}; -//# sourceMappingURL=nope.js.map diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.js.map b/node_modules/@hookform/resolvers/nope/dist/nope.js.map deleted file mode 100644 index f5111e93dc0cef42b9acef44acd21c360caae259..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nope.js","sources":["../src/nope.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ShapeErrors } from 'nope-validator/lib/cjs/types';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ShapeErrors,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return Object.keys(errors).reduce((acc, key) => {\n const _path = path ? `${path}.${key}` : key;\n const error = errors[key];\n\n if (typeof error === 'string') {\n acc[_path] = {\n message: error,\n } as FieldError;\n } else {\n parseErrors(error, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const nopeResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n ) =>\n (values, context, options) => {\n const result = schema.validate(values, context, schemaOptions) as\n | ShapeErrors\n | undefined;\n\n if (result) {\n return { values: {}, errors: toNestErrors(parseErrors(result), options) };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrors","errors","parsedErrors","path","Object","keys","reduce","acc","key","_path","error","message","schema","schemaOptions","abortEarly","values","context","options","result","validate","toNestErrors","shouldUseNativeValidation","validateFieldsNatively"],"mappings":"qCAKMA,EAAc,SAAdA,EACJC,EACAC,EACAC,GAEA,YAHAD,IAAAA,IAAAA,EAA4B,CAAE,QAC1B,IAAJC,IAAAA,EAAO,IAEAC,OAAOC,KAAKJ,GAAQK,OAAO,SAACC,EAAKC,GACtC,IAAMC,EAAQN,EAAUA,EAAI,IAAIK,EAAQA,EAClCE,EAAQT,EAAOO,GAUrB,MARqB,iBAAVE,EACTH,EAAIE,GAAS,CACXE,QAASD,GAGXV,EAAYU,EAAOH,EAAKE,GAGnBF,CACT,EAAGL,EACL,uBAGE,SACEU,EACAC,GAEC,YAFY,IAAbA,IAAAA,EAAgB,CACdC,YAAY,aAGfC,EAAQC,EAASC,GAChB,IAAMC,EAASN,EAAOO,SAASJ,EAAQC,EAASH,GAIhD,OAAIK,EACK,CAAEH,OAAQ,CAAE,EAAEd,OAAQmB,EAAAA,aAAapB,EAAYkB,GAASD,KAGjEA,EAAQI,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEL,GAEzD,CAAEF,OAAAA,EAAQd,OAAQ,IAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.mjs b/node_modules/@hookform/resolvers/nope/dist/nope.mjs deleted file mode 100644 index 364f48cae2306ec9cf171f512560415d676f8c06..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";var o=function r(e,o,t){return void 0===o&&(o={}),void 0===t&&(t=""),Object.keys(e).reduce(function(o,n){var a=t?t+"."+n:n,i=e[n];return"string"==typeof i?o[a]={message:i}:r(i,o,a),o},o)},t=function(t,n){return void 0===n&&(n={abortEarly:!1}),function(a,i,s){var u=t.validate(a,i,n);return u?{values:{},errors:r(o(u),s)}:(s.shouldUseNativeValidation&&e({},s),{values:a,errors:{}})}};export{t as nopeResolver}; -//# sourceMappingURL=nope.module.js.map diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.modern.mjs b/node_modules/@hookform/resolvers/nope/dist/nope.modern.mjs deleted file mode 100644 index c515864c2dd17ac7e4a4550b59da8178a91e8c49..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";const o=(r,e={},s="")=>Object.keys(r).reduce((e,t)=>{const a=s?`${s}.${t}`:t,l=r[t];return"string"==typeof l?e[a]={message:l}:o(l,e,a),e},e),s=(s,t={abortEarly:!1})=>(a,l,n)=>{const i=s.validate(a,l,t);return i?{values:{},errors:r(o(i),n)}:(n.shouldUseNativeValidation&&e({},n),{values:a,errors:{}})};export{s as nopeResolver}; -//# sourceMappingURL=nope.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.modern.mjs.map b/node_modules/@hookform/resolvers/nope/dist/nope.modern.mjs.map deleted file mode 100644 index d4b67c1f10cdfabaa625954bf79b829f99335f98..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nope.modern.mjs","sources":["../src/nope.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ShapeErrors } from 'nope-validator/lib/cjs/types';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ShapeErrors,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return Object.keys(errors).reduce((acc, key) => {\n const _path = path ? `${path}.${key}` : key;\n const error = errors[key];\n\n if (typeof error === 'string') {\n acc[_path] = {\n message: error,\n } as FieldError;\n } else {\n parseErrors(error, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const nopeResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n ) =>\n (values, context, options) => {\n const result = schema.validate(values, context, schemaOptions) as\n | ShapeErrors\n | undefined;\n\n if (result) {\n return { values: {}, errors: toNestErrors(parseErrors(result), options) };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrors","errors","parsedErrors","path","Object","keys","reduce","acc","key","_path","error","message","nopeResolver","schema","schemaOptions","abortEarly","values","context","options","result","validate","toNestErrors","shouldUseNativeValidation","validateFieldsNatively"],"mappings":"+EAKA,MAAMA,EAAcA,CAClBC,EACAC,EAA4B,CAAA,EAC5BC,EAAO,KAEAC,OAAOC,KAAKJ,GAAQK,OAAO,CAACC,EAAKC,KACtC,MAAMC,EAAQN,EAAO,GAAGA,KAAQK,IAAQA,EAClCE,EAAQT,EAAOO,GAUrB,MARqB,iBAAVE,EACTH,EAAIE,GAAS,CACXE,QAASD,GAGXV,EAAYU,EAAOH,EAAKE,GAGnBF,GACNL,GAGQU,EACXA,CACEC,EACAC,EAAgB,CACdC,YAAY,KAGhB,CAACC,EAAQC,EAASC,KAChB,MAAMC,EAASN,EAAOO,SAASJ,EAAQC,EAASH,GAIhD,OAAIK,EACK,CAAEH,OAAQ,CAAE,EAAEf,OAAQoB,EAAarB,EAAYmB,GAASD,KAGjEA,EAAQI,2BAA6BC,EAAuB,GAAIL,GAEzD,CAAEF,SAAQf,OAAQ"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.module.js b/node_modules/@hookform/resolvers/nope/dist/nope.module.js deleted file mode 100644 index 364f48cae2306ec9cf171f512560415d676f8c06..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";var o=function r(e,o,t){return void 0===o&&(o={}),void 0===t&&(t=""),Object.keys(e).reduce(function(o,n){var a=t?t+"."+n:n,i=e[n];return"string"==typeof i?o[a]={message:i}:r(i,o,a),o},o)},t=function(t,n){return void 0===n&&(n={abortEarly:!1}),function(a,i,s){var u=t.validate(a,i,n);return u?{values:{},errors:r(o(u),s)}:(s.shouldUseNativeValidation&&e({},s),{values:a,errors:{}})}};export{t as nopeResolver}; -//# sourceMappingURL=nope.module.js.map diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.module.js.map b/node_modules/@hookform/resolvers/nope/dist/nope.module.js.map deleted file mode 100644 index 920cefc72ee0e57a034c2a67e97ba2d6e055c441..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nope.module.js","sources":["../src/nope.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ShapeErrors } from 'nope-validator/lib/cjs/types';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ShapeErrors,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return Object.keys(errors).reduce((acc, key) => {\n const _path = path ? `${path}.${key}` : key;\n const error = errors[key];\n\n if (typeof error === 'string') {\n acc[_path] = {\n message: error,\n } as FieldError;\n } else {\n parseErrors(error, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const nopeResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n ) =>\n (values, context, options) => {\n const result = schema.validate(values, context, schemaOptions) as\n | ShapeErrors\n | undefined;\n\n if (result) {\n return { values: {}, errors: toNestErrors(parseErrors(result), options) };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrors","errors","parsedErrors","path","Object","keys","reduce","acc","key","_path","error","message","nopeResolver","schema","schemaOptions","abortEarly","values","context","options","result","validate","toNestErrors","shouldUseNativeValidation","validateFieldsNatively"],"mappings":"+EAKA,IAAMA,EAAc,SAAdA,EACJC,EACAC,EACAC,GAEA,YAHAD,IAAAA,IAAAA,EAA4B,CAAE,QAC1B,IAAJC,IAAAA,EAAO,IAEAC,OAAOC,KAAKJ,GAAQK,OAAO,SAACC,EAAKC,GACtC,IAAMC,EAAQN,EAAUA,EAAI,IAAIK,EAAQA,EAClCE,EAAQT,EAAOO,GAUrB,MARqB,iBAAVE,EACTH,EAAIE,GAAS,CACXE,QAASD,GAGXV,EAAYU,EAAOH,EAAKE,GAGnBF,CACT,EAAGL,EACL,EAEaU,EACX,SACEC,EACAC,GAEC,YAFY,IAAbA,IAAAA,EAAgB,CACdC,YAAY,aAGfC,EAAQC,EAASC,GAChB,IAAMC,EAASN,EAAOO,SAASJ,EAAQC,EAASH,GAIhD,OAAIK,EACK,CAAEH,OAAQ,CAAE,EAAEf,OAAQoB,EAAarB,EAAYmB,GAASD,KAGjEA,EAAQI,2BAA6BC,EAAuB,CAAE,EAAEL,GAEzD,CAAEF,OAAAA,EAAQf,OAAQ,IAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.umd.js b/node_modules/@hookform/resolvers/nope/dist/nope.umd.js deleted file mode 100644 index b700a81b113357ff4746f2c9972b74fb9560ed22..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers"],o):o((e||self).hookformResolversNope={},e.hookformResolvers)}(this,function(e,o){var r=function e(o,r,t){return void 0===r&&(r={}),void 0===t&&(t=""),Object.keys(o).reduce(function(r,s){var n=t?t+"."+s:s,i=o[s];return"string"==typeof i?r[n]={message:i}:e(i,r,n),r},r)};e.nopeResolver=function(e,t){return void 0===t&&(t={abortEarly:!1}),function(s,n,i){var f=e.validate(s,n,t);return f?{values:{},errors:o.toNestErrors(r(f),i)}:(i.shouldUseNativeValidation&&o.validateFieldsNatively({},i),{values:s,errors:{}})}}}); -//# sourceMappingURL=nope.umd.js.map diff --git a/node_modules/@hookform/resolvers/nope/dist/nope.umd.js.map b/node_modules/@hookform/resolvers/nope/dist/nope.umd.js.map deleted file mode 100644 index d79ce2eebe978b319ed5dba44b806388965a49d9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/nope.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nope.umd.js","sources":["../src/nope.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ShapeErrors } from 'nope-validator/lib/cjs/types';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (\n errors: ShapeErrors,\n parsedErrors: FieldErrors = {},\n path = '',\n) => {\n return Object.keys(errors).reduce((acc, key) => {\n const _path = path ? `${path}.${key}` : key;\n const error = errors[key];\n\n if (typeof error === 'string') {\n acc[_path] = {\n message: error,\n } as FieldError;\n } else {\n parseErrors(error, acc, _path);\n }\n\n return acc;\n }, parsedErrors);\n};\n\nexport const nopeResolver: Resolver =\n (\n schema,\n schemaOptions = {\n abortEarly: false,\n },\n ) =>\n (values, context, options) => {\n const result = schema.validate(values, context, schemaOptions) as\n | ShapeErrors\n | undefined;\n\n if (result) {\n return { values: {}, errors: toNestErrors(parseErrors(result), options) };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrors","errors","parsedErrors","path","Object","keys","reduce","acc","key","_path","error","message","schema","schemaOptions","abortEarly","values","context","options","result","validate","toNestErrors","shouldUseNativeValidation","validateFieldsNatively"],"mappings":"0TAKA,IAAMA,EAAc,SAAdA,EACJC,EACAC,EACAC,GAEA,YAHAD,IAAAA,IAAAA,EAA4B,CAAE,QAC1B,IAAJC,IAAAA,EAAO,IAEAC,OAAOC,KAAKJ,GAAQK,OAAO,SAACC,EAAKC,GACtC,IAAMC,EAAQN,EAAUA,EAAI,IAAIK,EAAQA,EAClCE,EAAQT,EAAOO,GAUrB,MARqB,iBAAVE,EACTH,EAAIE,GAAS,CACXE,QAASD,GAGXV,EAAYU,EAAOH,EAAKE,GAGnBF,CACT,EAAGL,EACL,iBAGE,SACEU,EACAC,GAEC,YAFY,IAAbA,IAAAA,EAAgB,CACdC,YAAY,aAGfC,EAAQC,EAASC,GAChB,IAAMC,EAASN,EAAOO,SAASJ,EAAQC,EAASH,GAIhD,OAAIK,EACK,CAAEH,OAAQ,CAAE,EAAEd,OAAQmB,EAAAA,aAAapB,EAAYkB,GAASD,KAGjEA,EAAQI,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEL,GAEzD,CAAEF,OAAAA,EAAQd,OAAQ,IAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/nope/dist/types.d.ts b/node_modules/@hookform/resolvers/nope/dist/types.d.ts deleted file mode 100644 index a3101ea79d825db6d950a3839c130dcbb2b52991..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/dist/types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NopeObject } from 'nope-validator/lib/cjs/NopeObject'; -import type { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -type ValidateOptions = Parameters[2]; -type Context = Parameters[1]; -export type Resolver = (schema: T, schemaOptions?: ValidateOptions, resolverOptions?: { - mode?: 'async' | 'sync'; - rawValues?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => ResolverResult; -export {}; diff --git a/node_modules/@hookform/resolvers/nope/package.json b/node_modules/@hookform/resolvers/nope/package.json deleted file mode 100644 index 3edadd70252bd39827eaaa335f80bb7d5ec8afc7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/nope", - "amdName": "hookformResolversNope", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: nope", - "main": "dist/nope.js", - "module": "dist/nope.module.js", - "umd:main": "dist/nope.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "nope-validator": "^0.12.0" - } -} diff --git a/node_modules/@hookform/resolvers/nope/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/nope/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index e0635b30cb9278986bcd3293e269af7cb2a89906..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import Nope from 'nope-validator'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { nopeResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = Nope.object().shape({ - username: Nope.string().required(USERNAME_REQUIRED_MESSAGE), - password: Nope.string().required(PASSWORD_REQUIRED_MESSAGE), -}); - -interface FormData { - unusedProperty: string; - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: nopeResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Nope", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/nope/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/nope/src/__tests__/Form.tsx deleted file mode 100644 index 08194a539075e3ed5ad307b82a2848592a175996..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/__tests__/Form.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import Nope from 'nope-validator'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { nopeResolver } from '..'; - -const schema = Nope.object().shape({ - username: Nope.string().required(), - password: Nope.string().required(), -}); - -interface FormData { - unusedProperty: string; - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: nopeResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Yup and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getAllByText(/This field is required/i)).toHaveLength(2); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/nope/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/nope/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 7068b5781c1ed5bd5c21e2a3c0ec8c66b23c6fb7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,70 +0,0 @@ -import Nope from 'nope-validator'; -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = Nope.object().shape({ - username: Nope.string().regex(/^\w+$/).min(2).max(30).required(), - password: Nope.string() - .regex(new RegExp('.*[A-Z].*'), 'One uppercase character') - .regex(new RegExp('.*[a-z].*'), 'One lowercase character') - .regex(new RegExp('.*\\d.*'), 'One number') - .regex( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ) - .min(8, 'Must be at least 8 characters in length') - .required('New Password is required'), - repeatPassword: Nope.string() - .oneOf([Nope.ref('password')], "Passwords don't match") - .required(), - accessToken: Nope.string(), - birthYear: Nope.number().min(1900).max(2013), - email: Nope.string().email(), - tags: Nope.array().of(Nope.string()).required(), - enabled: Nope.boolean(), - like: Nope.object().shape({ - id: Nope.number().required(), - name: Nope.string().atLeast(4).required(), - }), -}); - -export const validData = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: { - id: 1, - name: 'name', - }, -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: { id: 'z' }, - tags: [1, 2, 3], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/nope/src/__tests__/__snapshots__/nope.ts.snap b/node_modules/@hookform/resolvers/nope/src/__tests__/__snapshots__/nope.ts.snap deleted file mode 100644 index 094cd1788b58192407eb05ec732d7d14180c7a28..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/__tests__/__snapshots__/nope.ts.snap +++ /dev/null @@ -1,43 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`nopeResolver > should return a single error from nopeResolver when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "The field is not a valid number", - "ref": undefined, - }, - "like": { - "id": { - "message": "The field is not a valid number", - "ref": undefined, - }, - "name": { - "message": "This field is required", - "ref": undefined, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - }, - "repeatPassword": { - "message": "This field is required", - "ref": undefined, - }, - "tags": { - "message": "One or more elements are of invalid type", - "ref": undefined, - }, - "username": { - "message": "This field is required", - "ref": { - "name": "username", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/nope/src/__tests__/nope.ts b/node_modules/@hookform/resolvers/nope/src/__tests__/nope.ts deleted file mode 100644 index 0aee74935c2faee2f406ccbc5d8ba8d2fb7c4bfa..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/__tests__/nope.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */ -import { nopeResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('nopeResolver', () => { - it('should return values from nopeResolver when validation pass', async () => { - const schemaSpy = vi.spyOn(schema, 'validate'); - - const result = await nopeResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from nopeResolver when validation fails', async () => { - const result = await nopeResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); -}); diff --git a/node_modules/@hookform/resolvers/nope/src/index.ts b/node_modules/@hookform/resolvers/nope/src/index.ts deleted file mode 100644 index 70d2e237299d0ebfd856eb4c8016838df67c5a99..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './nope'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/nope/src/nope.ts b/node_modules/@hookform/resolvers/nope/src/nope.ts deleted file mode 100644 index dd082b9c0c16a84a03a97d24ed436d15bc5505e3..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/nope.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import type { ShapeErrors } from 'nope-validator/lib/cjs/types'; -import type { FieldError, FieldErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrors = ( - errors: ShapeErrors, - parsedErrors: FieldErrors = {}, - path = '', -) => { - return Object.keys(errors).reduce((acc, key) => { - const _path = path ? `${path}.${key}` : key; - const error = errors[key]; - - if (typeof error === 'string') { - acc[_path] = { - message: error, - } as FieldError; - } else { - parseErrors(error, acc, _path); - } - - return acc; - }, parsedErrors); -}; - -export const nopeResolver: Resolver = - ( - schema, - schemaOptions = { - abortEarly: false, - }, - ) => - (values, context, options) => { - const result = schema.validate(values, context, schemaOptions) as - | ShapeErrors - | undefined; - - if (result) { - return { values: {}, errors: toNestErrors(parseErrors(result), options) }; - } - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { values, errors: {} }; - }; diff --git a/node_modules/@hookform/resolvers/nope/src/types.ts b/node_modules/@hookform/resolvers/nope/src/types.ts deleted file mode 100644 index ced0f29b8a62b501be54f43ba22b37017ffbf38d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/nope/src/types.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NopeObject } from 'nope-validator/lib/cjs/NopeObject'; -import type { - FieldValues, - ResolverOptions, - ResolverResult, -} from 'react-hook-form'; - -type ValidateOptions = Parameters[2]; -type Context = Parameters[1]; - -export type Resolver = ( - schema: T, - schemaOptions?: ValidateOptions, - resolverOptions?: { mode?: 'async' | 'sync'; rawValues?: boolean }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => ResolverResult; diff --git a/node_modules/@hookform/resolvers/package.json b/node_modules/@hookform/resolvers/package.json deleted file mode 100644 index 1e6e1d5056f274a5a1b6e6a7fe85931f3da6bf07..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/package.json +++ /dev/null @@ -1,311 +0,0 @@ -{ - "name": "@hookform/resolvers", - "amdName": "hookformResolvers", - "version": "3.9.1", - "description": "React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types, TypeBox, arktype, Typanion, Effect-TS and VineJS", - "main": "dist/resolvers.js", - "module": "dist/resolvers.module.js", - "umd:main": "dist/resolvers.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "umd": "./dist/resolvers.umd.js", - "import": "./dist/resolvers.mjs", - "require": "./dist/resolvers.js" - }, - "./zod": { - "types": "./zod/dist/index.d.ts", - "umd": "./zod/dist/zod.umd.js", - "import": "./zod/dist/zod.mjs", - "require": "./zod/dist/zod.js" - }, - "./typebox": { - "types": "./typebox/dist/index.d.ts", - "umd": "./typebox/dist/typebox.umd.js", - "import": "./typebox/dist/typebox.mjs", - "require": "./typebox/dist/typebox.js" - }, - "./yup": { - "types": "./yup/dist/index.d.ts", - "umd": "./yup/dist/yup.umd.js", - "import": "./yup/dist/yup.mjs", - "require": "./yup/dist/yup.js" - }, - "./joi": { - "types": "./joi/dist/index.d.ts", - "umd": "./joi/dist/joi.umd.js", - "import": "./joi/dist/joi.mjs", - "require": "./joi/dist/joi.js" - }, - "./vest": { - "types": "./vest/dist/index.d.ts", - "umd": "./vest/dist/vest.umd.js", - "import": "./vest/dist/vest.mjs", - "require": "./vest/dist/vest.js" - }, - "./superstruct": { - "types": "./superstruct/dist/index.d.ts", - "umd": "./superstruct/dist/superstruct.umd.js", - "import": "./superstruct/dist/superstruct.mjs", - "require": "./superstruct/dist/superstruct.js" - }, - "./class-validator": { - "types": "./class-validator/dist/index.d.ts", - "umd": "./class-validator/dist/class-validator.umd.js", - "import": "./class-validator/dist/class-validator.mjs", - "require": "./class-validator/dist/class-validator.js" - }, - "./io-ts": { - "types": "./io-ts/dist/index.d.ts", - "umd": "./io-ts/dist/io-ts.umd.js", - "import": "./io-ts/dist/io-ts.mjs", - "require": "./io-ts/dist/io-ts.js" - }, - "./nope": { - "types": "./nope/dist/index.d.ts", - "umd": "./nope/dist/nope.umd.js", - "import": "./nope/dist/nope.mjs", - "require": "./nope/dist/nope.js" - }, - "./computed-types": { - "types": "./computed-types/dist/index.d.ts", - "umd": "./computed-types/dist/computed-types.umd.js", - "import": "./computed-types/dist/computed-types.mjs", - "require": "./computed-types/dist/computed-types.js" - }, - "./typanion": { - "types": "./typanion/dist/index.d.ts", - "umd": "./typanion/dist/typanion.umd.js", - "import": "./typanion/dist/typanion.mjs", - "require": "./typanion/dist/typanion.js" - }, - "./ajv": { - "types": "./ajv/dist/index.d.ts", - "umd": "./ajv/dist/ajv.umd.js", - "import": "./ajv/dist/ajv.mjs", - "require": "./ajv/dist/ajv.js" - }, - "./arktype": { - "types": "./arktype/dist/index.d.ts", - "umd": "./arktype/dist/arktype.umd.js", - "import": "./arktype/dist/arktype.mjs", - "require": "./arktype/dist/arktype.js" - }, - "./valibot": { - "types": "./valibot/dist/index.d.ts", - "umd": "./valibot/dist/valibot.umd.js", - "import": "./valibot/dist/valibot.mjs", - "require": "./valibot/dist/valibot.js" - }, - "./typeschema": { - "types": "./typeschema/dist/index.d.ts", - "umd": "./typeschema/dist/typeschema.umd.js", - "import": "./typeschema/dist/typeschema.mjs", - "require": "./typeschema/dist/typeschema.js" - }, - "./effect-ts": { - "types": "./effect-ts/dist/index.d.ts", - "umd": "./effect-ts/dist/effect-ts.umd.js", - "import": "./effect-ts/dist/effect-ts.mjs", - "require": "./effect-ts/dist/effect-ts.js" - }, - "./vine": { - "types": "./vine/dist/index.d.ts", - "umd": "./vine/dist/vine.umd.js", - "import": "./vine/dist/vine.mjs", - "require": "./vine/dist/vine.js" - }, - "./fluentvalidation-ts": { - "types": "./fluentvalidation-ts/dist/index.d.ts", - "umd": "./fluentvalidation-ts/dist/fluentvalidation-ts.umd.js", - "import": "./fluentvalidation-ts/dist/fluentvalidation-ts.mjs", - "require": "./fluentvalidation-ts/dist/fluentvalidation-ts.js" - }, - "./package.json": "./package.json", - "./*": "./*" - }, - "files": [ - "dist", - "yup/package.json", - "yup/src", - "yup/dist", - "zod/package.json", - "zod/src", - "zod/dist", - "vest/package.json", - "vest/src", - "vest/dist", - "joi/package.json", - "joi/src", - "joi/dist", - "superstruct/package.json", - "superstruct/src", - "superstruct/dist", - "class-validator/package.json", - "class-validator/src", - "class-validator/dist", - "io-ts/package.json", - "io-ts/src", - "io-ts/dist", - "nope/package.json", - "nope/src", - "nope/dist", - "computed-types/package.json", - "computed-types/src", - "computed-types/dist", - "typanion/package.json", - "typanion/src", - "typanion/dist", - "ajv/package.json", - "ajv/src", - "ajv/dist", - "typebox/package.json", - "typebox/src", - "typebox/dist", - "arktype/package.json", - "arktype/src", - "arktype/dist", - "valibot/package.json", - "valibot/src", - "valibot/dist", - "typeschema/package.json", - "typeschema/src", - "typeschema/dist", - "effect-ts/package.json", - "effect-ts/src", - "effect-ts/dist", - "effect-ts/package.json", - "effect-ts/src", - "effect-ts/dist", - "vine/package.json", - "vine/src", - "vine/dist", - "fluentvalidation-ts/package.json", - "fluentvalidation-ts/src", - "fluentvalidation-ts/dist" - ], - "publishConfig": { - "access": "public" - }, - "scripts": { - "prepare": "run-s build:src", - "build": "cross-env npm-run-all --parallel 'build:*'", - "build:src": "microbundle build --globals react-hook-form=ReactHookForm", - "build:zod": "microbundle --cwd zod --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:yup": "microbundle --cwd yup --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:joi": "microbundle --cwd joi --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:superstruct": "microbundle --cwd superstruct --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:io-ts": "microbundle --cwd io-ts --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm,fp-ts/Either=Either,fp-ts/function=_function,fp-ts/Option=Option,fp-ts/ReadonlyArray=ReadonlyArray,fp-ts/Semigroup=Semigroup,fp-ts/ReadonlyRecord=ReadonlyRecord", - "build:vest": "microbundle --cwd vest --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm,vest/promisify=promisify", - "build:class-validator": "microbundle --cwd class-validator --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:nope": "microbundle --cwd nope --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:computed-types": "microbundle --cwd computed-types --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:typanion": "microbundle --cwd typanion --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:ajv": "microbundle --cwd ajv --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:typebox": "microbundle --cwd typebox --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm,@sinclair/typebox/value=value,@sinclair/typebox/compiler=compiler", - "build:arktype": "microbundle --cwd arktype --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:valibot": "microbundle --cwd valibot --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "build:typeschema": "microbundle --cwd typeschema --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm,@typeschema/main=main", - "build:effect-ts": "microbundle --cwd effect-ts --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm,@effect/schema=EffectSchema,@effect/schema/AST=EffectSchemaAST,@effect/schema/ArrayFormatter=EffectSchemaArrayFormatter,@effect/schema/ParseResult=EffectSchemaArrayFormatter,effect/Effect=Effect", - "build:vine": "microbundle --cwd vine --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm,@vinejs/vine=vine", - "build:fluentvalidation-ts": "microbundle --cwd fluentvalidation-ts --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm", - "postbuild": "node ./config/node-13-exports.js && check-export-map", - "lint": "bunx @biomejs/biome check --write --vcs-use-ignore-file=true .", - "lint:types": "tsc", - "test": "vitest run", - "test:watch": "vitest watch", - "check:all": "npm-run-all --parallel lint:* test", - "csb:install": "pnpx replace-json-property@1.9.0 package.json prepare \"node -e 'process.exit(0)'\" && pnpm i --no-frozen-lockfile", - "csb:build": "cross-env npm-run-all --sequential 'build:*'" - }, - "keywords": [ - "scheme", - "validation", - "scheme-validation", - "hookform", - "react-hook-form", - "yup", - "joi", - "superstruct", - "typescript", - "zod", - "vest", - "class-validator", - "io-ts", - "effect-ts", - "nope", - "computed-types", - "typanion", - "ajv", - "TypeBox", - "arktype", - "typeschema", - "vine", - "fluentvalidation-ts" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/react-hook-form/resolvers.git" - }, - "author": "bluebill1049 ", - "license": "MIT", - "bugs": { - "url": "https://github.com/react-hook-form/resolvers/issues" - }, - "homepage": "https://react-hook-form.com", - "devDependencies": { - "@effect/schema": "^0.68.17", - "@sinclair/typebox": "^0.32.34", - "@testing-library/dom": "^10.3.1", - "@testing-library/jest-dom": "^6.4.6", - "@testing-library/react": "^16.0.0", - "@testing-library/user-event": "^14.5.2", - "@types/node": "^20.14.9", - "@types/react": "^18.3.3", - "@typeschema/core": "^0.13.2", - "@typeschema/main": "^0.13.10", - "@typeschema/zod": "^0.13.3", - "@vinejs/vine": "^2.1.0", - "@vitejs/plugin-react": "^4.3.1", - "ajv": "^8.16.0", - "ajv-errors": "^3.0.0", - "arktype": "2.0.0-dev.26", - "check-export-map": "^1.3.1", - "class-transformer": "^0.5.1", - "class-validator": "^0.14.1", - "computed-types": "^1.11.2", - "cross-env": "^7.0.3", - "effect": "^3.4.7", - "fluentvalidation-ts": "^3.2.0", - "fp-ts": "^2.16.7", - "io-ts": "^2.2.21", - "io-ts-types": "^0.5.19", - "joi": "^17.13.3", - "jsdom": "^24.1.0", - "lefthook": "^1.6.18", - "microbundle": "^0.15.1", - "monocle-ts": "^2.3.13", - "newtype-ts": "^0.3.5", - "nope-validator": "^1.0.4", - "npm-run-all": "^4.1.5", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-hook-form": "^7.52.1", - "reflect-metadata": "^0.2.2", - "superstruct": "^1.0.4", - "typanion": "^3.14.0", - "typescript": "^5.5.3", - "valibot": "^1.0.0-beta.0", - "vest": "^5.3.0", - "vite": "^5.3.3", - "vite-tsconfig-paths": "^4.3.2", - "vitest": "^1.6.0", - "yup": "^1.4.0", - "zod": "^3.23.8" - }, - "peerDependencies": { - "react-hook-form": "^7.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/superstruct/dist/index.d.ts b/node_modules/@hookform/resolvers/superstruct/dist/index.d.ts deleted file mode 100644 index d45b047a1094047fa081c7acc49b3266a340ae84..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './superstruct'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.d.ts b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.d.ts deleted file mode 100644 index f8db905c6c1d7fbdf8f5df0678958fb4e4e5b470..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Resolver } from './types'; -export declare const superstructResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.js b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.js deleted file mode 100644 index d9e9a4fee25c233c62c137805c61b9c120232567..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("superstruct");exports.superstructResolver=function(s,t,a){return void 0===a&&(a={}),function(o,u,i){var l,n=r.validate(o,s,t);return n[0]?{values:{},errors:e.toNestErrors((l=n[0],l.failures().reduce(function(e,r){return(e[r.path.join(".")]={message:r.message,type:r.type})&&e},{})),i)}:(i.shouldUseNativeValidation&&e.validateFieldsNatively({},i),{values:a.raw?o:n[1],errors:{}})}}; -//# sourceMappingURL=superstruct.js.map diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.js.map b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.js.map deleted file mode 100644 index 2d6b07476e2c75710eaacab37a544f3622dcf7c9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"superstruct.js","sources":["../src/superstruct.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\n\nimport { StructError, validate } from 'superstruct';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (error: StructError) =>\n error.failures().reduce>(\n (previous, error) =>\n (previous[error.path.join('.')] = {\n message: error.message,\n type: error.type,\n }) && previous,\n {},\n );\n\nexport const superstructResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const result = validate(values, schema, schemaOptions);\n\n if (result[0]) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(result[0]), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result[1],\n errors: {},\n };\n };\n"],"names":["schema","schemaOptions","resolverOptions","values","_","options","error","result","validate","errors","toNestErrors","failures","reduce","previous","path","join","message","type","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"0FAiBE,SAACA,EAAQC,EAAeC,GACxB,YADwBA,IAAAA,IAAAA,EAAkB,CAAA,GAC1C,SAACC,EAAQC,EAAGC,GACV,IAbsBC,EAahBC,EAASC,EAAQA,SAACL,EAAQH,EAAQC,GAExC,OAAIM,EAAO,GACF,CACLJ,OAAQ,CAAE,EACVM,OAAQC,EAAAA,cAlBUJ,EAkBoBC,EAAO,GAjBnDD,EAAMK,WAAWC,OACf,SAACC,EAAUP,GACT,OAACO,EAASP,EAAMQ,KAAKC,KAAK,MAAQ,CAChCC,QAASV,EAAMU,QACfC,KAAMX,EAAMW,QACRJ,CAAQ,EAChB,CAAA,IAWsDR,KAItDA,EAAQa,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEd,GAEzD,CACLF,OAAQD,EAAgBkB,IAAMjB,EAASI,EAAO,GAC9CE,OAAQ,CAAA,GAEZ,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.mjs b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.mjs deleted file mode 100644 index 4405cceef55a1fde520435e0f6d6548714c8a9c2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import{validate as o}from"superstruct";var t=function(t,s,u){return void 0===u&&(u={}),function(a,i,n){var f,m=o(a,t,s);return m[0]?{values:{},errors:r((f=m[0],f.failures().reduce(function(r,e){return(r[e.path.join(".")]={message:e.message,type:e.type})&&r},{})),n)}:(n.shouldUseNativeValidation&&e({},n),{values:u.raw?a:m[1],errors:{}})}};export{t as superstructResolver}; -//# sourceMappingURL=superstruct.module.js.map diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.modern.mjs b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.modern.mjs deleted file mode 100644 index af20b972c1f2d5a41459ce9dbaa34b795d058636..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import{validate as s}from"superstruct";const o=(o,t,a={})=>(u,i,m)=>{const p=s(u,o,t);return p[0]?{values:{},errors:r((l=p[0],l.failures().reduce((r,e)=>(r[e.path.join(".")]={message:e.message,type:e.type})&&r,{})),m)}:(m.shouldUseNativeValidation&&e({},m),{values:a.raw?u:p[1],errors:{}});var l};export{o as superstructResolver}; -//# sourceMappingURL=superstruct.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.modern.mjs.map b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.modern.mjs.map deleted file mode 100644 index 2cc4a8b224832fdf00490523592fec567a9ac0a9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"superstruct.modern.mjs","sources":["../src/superstruct.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\n\nimport { StructError, validate } from 'superstruct';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (error: StructError) =>\n error.failures().reduce>(\n (previous, error) =>\n (previous[error.path.join('.')] = {\n message: error.message,\n type: error.type,\n }) && previous,\n {},\n );\n\nexport const superstructResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const result = validate(values, schema, schemaOptions);\n\n if (result[0]) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(result[0]), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result[1],\n errors: {},\n };\n };\n"],"names":["superstructResolver","schema","schemaOptions","resolverOptions","values","_","options","result","validate","errors","toNestErrors","error","failures","reduce","previous","path","join","message","type","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"sHAMA,MAUaA,EACXA,CAACC,EAAQC,EAAeC,EAAkB,CAAE,IAC5C,CAACC,EAAQC,EAAGC,KACV,MAAMC,EAASC,EAASJ,EAAQH,EAAQC,GAExC,OAAIK,EAAO,GACF,CACLH,OAAQ,CAAA,EACRK,OAAQC,GAlBUC,EAkBoBJ,EAAO,GAjBnDI,EAAMC,WAAWC,OACf,CAACC,EAAUH,KACRG,EAASH,EAAMI,KAAKC,KAAK,MAAQ,CAChCC,QAASN,EAAMM,QACfC,KAAMP,EAAMO,QACRJ,EACR,CAAA,IAWsDR,KAItDA,EAAQa,2BAA6BC,EAAuB,CAAE,EAAEd,GAEzD,CACLF,OAAQD,EAAgBkB,IAAMjB,EAASG,EAAO,GAC9CE,OAAQ,KA1BYE"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.module.js b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.module.js deleted file mode 100644 index 4405cceef55a1fde520435e0f6d6548714c8a9c2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import{validate as o}from"superstruct";var t=function(t,s,u){return void 0===u&&(u={}),function(a,i,n){var f,m=o(a,t,s);return m[0]?{values:{},errors:r((f=m[0],f.failures().reduce(function(r,e){return(r[e.path.join(".")]={message:e.message,type:e.type})&&r},{})),n)}:(n.shouldUseNativeValidation&&e({},n),{values:u.raw?a:m[1],errors:{}})}};export{t as superstructResolver}; -//# sourceMappingURL=superstruct.module.js.map diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.module.js.map b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.module.js.map deleted file mode 100644 index f01da0f9624eb91632a137d14f7095bd973a4092..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"superstruct.module.js","sources":["../src/superstruct.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\n\nimport { StructError, validate } from 'superstruct';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (error: StructError) =>\n error.failures().reduce>(\n (previous, error) =>\n (previous[error.path.join('.')] = {\n message: error.message,\n type: error.type,\n }) && previous,\n {},\n );\n\nexport const superstructResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const result = validate(values, schema, schemaOptions);\n\n if (result[0]) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(result[0]), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result[1],\n errors: {},\n };\n };\n"],"names":["superstructResolver","schema","schemaOptions","resolverOptions","values","_","options","error","result","validate","errors","toNestErrors","failures","reduce","previous","path","join","message","type","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"sHAMA,IAUaA,EACX,SAACC,EAAQC,EAAeC,GACxB,YADwBA,IAAAA,IAAAA,EAAkB,CAAA,GAC1C,SAACC,EAAQC,EAAGC,GACV,IAbsBC,EAahBC,EAASC,EAASL,EAAQH,EAAQC,GAExC,OAAIM,EAAO,GACF,CACLJ,OAAQ,CAAE,EACVM,OAAQC,GAlBUJ,EAkBoBC,EAAO,GAjBnDD,EAAMK,WAAWC,OACf,SAACC,EAAUP,GACT,OAACO,EAASP,EAAMQ,KAAKC,KAAK,MAAQ,CAChCC,QAASV,EAAMU,QACfC,KAAMX,EAAMW,QACRJ,CAAQ,EAChB,CAAA,IAWsDR,KAItDA,EAAQa,2BAA6BC,EAAuB,CAAE,EAAEd,GAEzD,CACLF,OAAQD,EAAgBkB,IAAMjB,EAASI,EAAO,GAC9CE,OAAQ,CAAA,GAEZ,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.umd.js b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.umd.js deleted file mode 100644 index 5cdbb6956ae0a6559e0fba9ca295f1824b4e9259..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("superstruct")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","superstruct"],r):r((e||self).hookformResolversSuperstruct={},e.hookformResolvers,e.superstruct)}(this,function(e,r,o){e.superstructResolver=function(e,s,t){return void 0===t&&(t={}),function(u,i,n){var f,l=o.validate(u,e,s);return l[0]?{values:{},errors:r.toNestErrors((f=l[0],f.failures().reduce(function(e,r){return(e[r.path.join(".")]={message:r.message,type:r.type})&&e},{})),n)}:(n.shouldUseNativeValidation&&r.validateFieldsNatively({},n),{values:t.raw?u:l[1],errors:{}})}}}); -//# sourceMappingURL=superstruct.umd.js.map diff --git a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.umd.js.map b/node_modules/@hookform/resolvers/superstruct/dist/superstruct.umd.js.map deleted file mode 100644 index ad6770e4f48b71d673bdbddb349e3af21102c5d0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/superstruct.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"superstruct.umd.js","sources":["../src/superstruct.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\n\nimport { StructError, validate } from 'superstruct';\nimport { Resolver } from './types';\n\nconst parseErrorSchema = (error: StructError) =>\n error.failures().reduce>(\n (previous, error) =>\n (previous[error.path.join('.')] = {\n message: error.message,\n type: error.type,\n }) && previous,\n {},\n );\n\nexport const superstructResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n (values, _, options) => {\n const result = validate(values, schema, schemaOptions);\n\n if (result[0]) {\n return {\n values: {},\n errors: toNestErrors(parseErrorSchema(result[0]), options),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result[1],\n errors: {},\n };\n };\n"],"names":["schema","schemaOptions","resolverOptions","values","_","options","error","result","validate","errors","toNestErrors","failures","reduce","previous","path","join","message","type","shouldUseNativeValidation","validateFieldsNatively","raw"],"mappings":"4YAiBE,SAACA,EAAQC,EAAeC,GACxB,YADwBA,IAAAA,IAAAA,EAAkB,CAAA,GAC1C,SAACC,EAAQC,EAAGC,GACV,IAbsBC,EAahBC,EAASC,EAAQA,SAACL,EAAQH,EAAQC,GAExC,OAAIM,EAAO,GACF,CACLJ,OAAQ,CAAE,EACVM,OAAQC,EAAAA,cAlBUJ,EAkBoBC,EAAO,GAjBnDD,EAAMK,WAAWC,OACf,SAACC,EAAUP,GACT,OAACO,EAASP,EAAMQ,KAAKC,KAAK,MAAQ,CAChCC,QAASV,EAAMU,QACfC,KAAMX,EAAMW,QACRJ,CAAQ,EAChB,CAAA,IAWsDR,KAItDA,EAAQa,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEd,GAEzD,CACLF,OAAQD,EAAgBkB,IAAMjB,EAASI,EAAO,GAC9CE,OAAQ,CAAA,GAEZ,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/superstruct/dist/types.d.ts b/node_modules/@hookform/resolvers/superstruct/dist/types.d.ts deleted file mode 100644 index 21df8d5ff590f49bef98023c42cda265b6631959..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/dist/types.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { Struct, validate } from 'superstruct'; -type Options = Parameters[2]; -export type Resolver = >(schema: T, options?: Options, factoryOptions?: { - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => ResolverResult; -export {}; diff --git a/node_modules/@hookform/resolvers/superstruct/package.json b/node_modules/@hookform/resolvers/superstruct/package.json deleted file mode 100644 index 649e59930894475621c163e57b8afae644a10331..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/superstruct", - "amdName": "hookformResolversSuperstruct", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: superstruct", - "main": "dist/superstruct.js", - "module": "dist/superstruct.module.js", - "umd:main": "dist/superstruct.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "superstruct": ">=0.12.0" - } -} diff --git a/node_modules/@hookform/resolvers/superstruct/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/superstruct/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index b09f9a3c0fb35325507d786012d8d2eacb10bbb1..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { Infer, object, size, string } from 'superstruct'; -import { superstructResolver } from '..'; - -const schema = object({ - username: size(string(), 2), - password: size(string(), 6), -}); - -type FormData = Infer; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: superstructResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Superstruct", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe( - 'Expected a string with a length of `2` but received one with a length of `0`', - ); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe( - 'Expected a string with a length of `6` but received one with a length of `0`', - ); - - await user.type(screen.getByPlaceholderText(/username/i), 'jo'); - await user.type(screen.getByPlaceholderText(/password/i), 'passwo'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/superstruct/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/superstruct/src/__tests__/Form.tsx deleted file mode 100644 index 6ff8e24aa04d60c6366273639b9d42ed110b32ca..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/__tests__/Form.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { Infer, object, size, string } from 'superstruct'; -import { superstructResolver } from '..'; - -const schema = object({ - username: size(string(), 2), - password: size(string(), 6), -}); - -type FormData = Infer; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: superstructResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Superstruct and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getByText( - /Expected a string with a length of `2` but received one with a length of `0`/i, - ), - ).toBeInTheDocument(); - expect( - screen.getByText( - /Expected a string with a length of `6` but received one with a length of `0`/i, - ), - ).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/superstruct/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/superstruct/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index d5cc6e7da6b5ca352be0209e2a472fe90d35d8f2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import { - Infer, - array, - boolean, - define, - max, - min, - number, - object, - optional, - pattern, - size, - string, - union, -} from 'superstruct'; - -const Password = define( - 'Password', - (value, ctx) => value === ctx.branch[0].password, -); - -export const schema = object({ - username: size(pattern(string(), /^\w+$/), 3, 30), - password: pattern(string(), /^[a-zA-Z0-9]{3,30}/), - repeatPassword: Password, - accessToken: optional(union([string(), number()])), - birthYear: optional(max(min(number(), 1900), 2013)), - email: optional(pattern(string(), /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/)), - tags: array(string()), - enabled: boolean(), - like: optional(array(object({ id: number(), name: size(string(), 4) }))), -}); - -export const validData: Infer = { - username: 'Doe', - password: 'Password123', - repeatPassword: 'Password123', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - like: [ - { - id: 1, - name: 'name', - }, - ], -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/superstruct/src/__tests__/__snapshots__/superstruct.ts.snap b/node_modules/@hookform/resolvers/superstruct/src/__tests__/__snapshots__/superstruct.ts.snap deleted file mode 100644 index 55bbc92eea0cc8ed08fadf344a7e0e2cd381baf6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/__tests__/__snapshots__/superstruct.ts.snap +++ /dev/null @@ -1,64 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`superstructResolver > should return a single error from superstructResolver when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "Expected a number, but received: "birthYear"", - "ref": undefined, - "type": "number", - }, - "email": { - "message": "Expected a string matching \`/^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$/\` but received """, - "ref": { - "name": "email", - }, - "type": "string", - }, - "enabled": { - "message": "Expected a value of type \`boolean\`, but received: \`undefined\`", - "ref": undefined, - "type": "boolean", - }, - "like": [ - { - "id": { - "message": "Expected a number, but received: "z"", - "ref": undefined, - "type": "number", - }, - "name": { - "message": "Expected a string, but received: undefined", - "ref": undefined, - "type": "string", - }, - }, - ], - "password": { - "message": "Expected a string matching \`/^[a-zA-Z0-9]{3,30}/\` but received "___"", - "ref": { - "name": "password", - }, - "type": "string", - }, - "repeatPassword": { - "message": "Expected a value of type \`Password\`, but received: \`undefined\`", - "ref": undefined, - "type": "Password", - }, - "tags": { - "message": "Expected an array value, but received: undefined", - "ref": undefined, - "type": "array", - }, - "username": { - "message": "Expected a string, but received: undefined", - "ref": { - "name": "username", - }, - "type": "string", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/superstruct/src/__tests__/superstruct.ts b/node_modules/@hookform/resolvers/superstruct/src/__tests__/superstruct.ts deleted file mode 100644 index cf95b411494bf8309024a24b667da46a9f7fc475..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/__tests__/superstruct.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { superstructResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('superstructResolver', () => { - it('should return values from superstructResolver when validation pass', async () => { - const result = await superstructResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from superstructResolver when validation fails', async () => { - const result = await superstructResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return values from superstructResolver when validation pass & raw=true', async () => { - const result = await superstructResolver(schema, undefined, { raw: true })( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(result).toEqual({ errors: {}, values: validData }); - }); -}); diff --git a/node_modules/@hookform/resolvers/superstruct/src/index.ts b/node_modules/@hookform/resolvers/superstruct/src/index.ts deleted file mode 100644 index d45b047a1094047fa081c7acc49b3266a340ae84..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './superstruct'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/superstruct/src/superstruct.ts b/node_modules/@hookform/resolvers/superstruct/src/superstruct.ts deleted file mode 100644 index 2ee47d99e22f1ada5a34c27bf749d72353a9780b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/superstruct.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { FieldError } from 'react-hook-form'; - -import { StructError, validate } from 'superstruct'; -import { Resolver } from './types'; - -const parseErrorSchema = (error: StructError) => - error.failures().reduce>( - (previous, error) => - (previous[error.path.join('.')] = { - message: error.message, - type: error.type, - }) && previous, - {}, - ); - -export const superstructResolver: Resolver = - (schema, schemaOptions, resolverOptions = {}) => - (values, _, options) => { - const result = validate(values, schema, schemaOptions); - - if (result[0]) { - return { - values: {}, - errors: toNestErrors(parseErrorSchema(result[0]), options), - }; - } - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - values: resolverOptions.raw ? values : result[1], - errors: {}, - }; - }; diff --git a/node_modules/@hookform/resolvers/superstruct/src/types.ts b/node_modules/@hookform/resolvers/superstruct/src/types.ts deleted file mode 100644 index 5e29da919e38fd7f55e5154dce1e696f2064676b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/superstruct/src/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { Struct, validate } from 'superstruct'; - -type Options = Parameters[2]; - -export type Resolver = >( - schema: T, - options?: Options, - factoryOptions?: { - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; - }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => ResolverResult; diff --git a/node_modules/@hookform/resolvers/typanion/dist/index.d.ts b/node_modules/@hookform/resolvers/typanion/dist/index.d.ts deleted file mode 100644 index 492ec467cb5d7a846f1c47329464b2d0a45f778e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './typanion'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.d.ts b/node_modules/@hookform/resolvers/typanion/dist/typanion.d.ts deleted file mode 100644 index 6172f465dfdfee3e2f9eee4f91abdd58fbfcc151..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const typanionResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.js b/node_modules/@hookform/resolvers/typanion/dist/typanion.js deleted file mode 100644 index 059e356b0b7393eebaa051f87152688964a554d0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers");exports.typanionResolver=function(e,o){return void 0===o&&(o={}),function(s,i,t){var n=[],a=e(s,Object.assign({},{errors:n},o)),u=function(r,e){return void 0===e&&(e={}),r.reduce(function(r,e){var o=e.indexOf(":"),s=e.slice(1,o),i=e.slice(o+1).trim();return r[s]={message:i},r},e)}(n);return a?(t.shouldUseNativeValidation&&r.validateFieldsNatively(u,t),{values:s,errors:{}}):{values:{},errors:r.toNestErrors(u,t)}}}; -//# sourceMappingURL=typanion.js.map diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.js.map b/node_modules/@hookform/resolvers/typanion/dist/typanion.js.map deleted file mode 100644 index 17fd8dfbaf5833d8a9ddc7ef7602aa50a534870e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typanion.js","sources":["../src/typanion.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (errors: string[], parsedErrors: FieldErrors = {}) => {\n return errors.reduce((acc, error) => {\n const fieldIndex = error.indexOf(':');\n\n const field = error.slice(1, fieldIndex);\n const message = error.slice(fieldIndex + 1).trim();\n\n acc[field] = {\n message,\n } as FieldError;\n\n return acc;\n }, parsedErrors);\n};\n\nexport const typanionResolver: Resolver =\n (validator, validatorOptions = {}) =>\n (values, _, options) => {\n const rawErrors: string[] = [];\n const isValid = validator(\n values,\n Object.assign(\n {},\n {\n errors: rawErrors,\n },\n validatorOptions,\n ),\n );\n const parsedErrors = parseErrors(rawErrors);\n\n if (isValid) {\n options.shouldUseNativeValidation &&\n validateFieldsNatively(parsedErrors, options);\n\n return { values, errors: {} };\n }\n\n return { values: {}, errors: toNestErrors(parsedErrors, options) };\n };\n"],"names":["validator","validatorOptions","values","_","options","rawErrors","isValid","Object","assign","errors","parsedErrors","reduce","acc","error","fieldIndex","indexOf","field","slice","message","trim","parseErrors","shouldUseNativeValidation","validateFieldsNatively","toNestErrors"],"mappings":"8DAoBE,SAACA,EAAWC,eAAgB,IAAhBA,IAAAA,EAAmB,CAAE,GAChCC,SAAAA,EAAQC,EAAGC,GACV,IAAMC,EAAsB,GACtBC,EAAUN,EACdE,EACAK,OAAOC,OACL,GACA,CACEC,OAAQJ,GAEVJ,IAGES,EA7BU,SAACD,EAAkBC,GACrC,YADqCA,IAAAA,IAAAA,EAA4B,CAAE,GAC5DD,EAAOE,OAAO,SAACC,EAAKC,GACzB,IAAMC,EAAaD,EAAME,QAAQ,KAE3BC,EAAQH,EAAMI,MAAM,EAAGH,GACvBI,EAAUL,EAAMI,MAAMH,EAAa,GAAGK,OAM5C,OAJAP,EAAII,GAAS,CACXE,QAAAA,GAGKN,CACT,EAAGF,EACL,CAgByBU,CAAYf,GAEjC,OAAIC,GACFF,EAAQiB,2BACNC,yBAAuBZ,EAAcN,GAEhC,CAAEF,OAAAA,EAAQO,OAAQ,CAAA,IAGpB,CAAEP,OAAQ,GAAIO,OAAQc,EAAYA,aAACb,EAAcN,GAC1D,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.mjs b/node_modules/@hookform/resolvers/typanion/dist/typanion.mjs deleted file mode 100644 index 53b180dc44d48058a2fa7704e81a09b38e097a82..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";var o=function(o,i){return void 0===i&&(i={}),function(n,s,t){var u=[],a=o(n,Object.assign({},{errors:u},i)),v=function(r,e){return void 0===e&&(e={}),r.reduce(function(r,e){var o=e.indexOf(":"),i=e.slice(1,o),n=e.slice(o+1).trim();return r[i]={message:n},r},e)}(u);return a?(t.shouldUseNativeValidation&&r(v,t),{values:n,errors:{}}):{values:{},errors:e(v,t)}}};export{o as typanionResolver}; -//# sourceMappingURL=typanion.module.js.map diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.modern.mjs b/node_modules/@hookform/resolvers/typanion/dist/typanion.modern.mjs deleted file mode 100644 index 33309639b5a4eee3b0315386488f1899c559a504..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";const s=(s,o={})=>(t,i,n)=>{const a=[],c=s(t,Object.assign({},{errors:a},o)),l=((r,e={})=>r.reduce((r,e)=>{const s=e.indexOf(":"),o=e.slice(1,s),t=e.slice(s+1).trim();return r[o]={message:t},r},e))(a);return c?(n.shouldUseNativeValidation&&r(l,n),{values:t,errors:{}}):{values:{},errors:e(l,n)}};export{s as typanionResolver}; -//# sourceMappingURL=typanion.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.modern.mjs.map b/node_modules/@hookform/resolvers/typanion/dist/typanion.modern.mjs.map deleted file mode 100644 index cc44378ee5522a2ff8cdb1a277fa445b100455f0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typanion.modern.mjs","sources":["../src/typanion.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (errors: string[], parsedErrors: FieldErrors = {}) => {\n return errors.reduce((acc, error) => {\n const fieldIndex = error.indexOf(':');\n\n const field = error.slice(1, fieldIndex);\n const message = error.slice(fieldIndex + 1).trim();\n\n acc[field] = {\n message,\n } as FieldError;\n\n return acc;\n }, parsedErrors);\n};\n\nexport const typanionResolver: Resolver =\n (validator, validatorOptions = {}) =>\n (values, _, options) => {\n const rawErrors: string[] = [];\n const isValid = validator(\n values,\n Object.assign(\n {},\n {\n errors: rawErrors,\n },\n validatorOptions,\n ),\n );\n const parsedErrors = parseErrors(rawErrors);\n\n if (isValid) {\n options.shouldUseNativeValidation &&\n validateFieldsNatively(parsedErrors, options);\n\n return { values, errors: {} };\n }\n\n return { values: {}, errors: toNestErrors(parsedErrors, options) };\n };\n"],"names":["typanionResolver","validator","validatorOptions","values","_","options","rawErrors","isValid","Object","assign","errors","parsedErrors","parseErrors","reduce","acc","error","fieldIndex","indexOf","field","slice","message","trim","shouldUseNativeValidation","validateFieldsNatively","toNestErrors"],"mappings":"+EAIA,MAeaA,EACXA,CAACC,EAAWC,EAAmB,CAAE,IACjC,CAACC,EAAQC,EAAGC,KACV,MAAMC,EAAsB,GACtBC,EAAUN,EACdE,EACAK,OAAOC,OACL,GACA,CACEC,OAAQJ,GAEVJ,IAGES,EA7BUC,EAACF,EAAkBC,EAA4B,CAAA,IAC1DD,EAAOG,OAAO,CAACC,EAAKC,KACzB,MAAMC,EAAaD,EAAME,QAAQ,KAE3BC,EAAQH,EAAMI,MAAM,EAAGH,GACvBI,EAAUL,EAAMI,MAAMH,EAAa,GAAGK,OAM5C,OAJAP,EAAII,GAAS,CACXE,WAGKN,GACNH,GAiBoBC,CAAYN,GAEjC,OAAIC,GACFF,EAAQiB,2BACNC,EAAuBZ,EAAcN,GAEhC,CAAEF,SAAQO,OAAQ,KAGpB,CAAEP,OAAQ,CAAA,EAAIO,OAAQc,EAAab,EAAcN"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.module.js b/node_modules/@hookform/resolvers/typanion/dist/typanion.module.js deleted file mode 100644 index 53b180dc44d48058a2fa7704e81a09b38e097a82..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";var o=function(o,i){return void 0===i&&(i={}),function(n,s,t){var u=[],a=o(n,Object.assign({},{errors:u},i)),v=function(r,e){return void 0===e&&(e={}),r.reduce(function(r,e){var o=e.indexOf(":"),i=e.slice(1,o),n=e.slice(o+1).trim();return r[i]={message:n},r},e)}(u);return a?(t.shouldUseNativeValidation&&r(v,t),{values:n,errors:{}}):{values:{},errors:e(v,t)}}};export{o as typanionResolver}; -//# sourceMappingURL=typanion.module.js.map diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.module.js.map b/node_modules/@hookform/resolvers/typanion/dist/typanion.module.js.map deleted file mode 100644 index d5c7461c3b487f902f04e51f00ce590ea09f899c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typanion.module.js","sources":["../src/typanion.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (errors: string[], parsedErrors: FieldErrors = {}) => {\n return errors.reduce((acc, error) => {\n const fieldIndex = error.indexOf(':');\n\n const field = error.slice(1, fieldIndex);\n const message = error.slice(fieldIndex + 1).trim();\n\n acc[field] = {\n message,\n } as FieldError;\n\n return acc;\n }, parsedErrors);\n};\n\nexport const typanionResolver: Resolver =\n (validator, validatorOptions = {}) =>\n (values, _, options) => {\n const rawErrors: string[] = [];\n const isValid = validator(\n values,\n Object.assign(\n {},\n {\n errors: rawErrors,\n },\n validatorOptions,\n ),\n );\n const parsedErrors = parseErrors(rawErrors);\n\n if (isValid) {\n options.shouldUseNativeValidation &&\n validateFieldsNatively(parsedErrors, options);\n\n return { values, errors: {} };\n }\n\n return { values: {}, errors: toNestErrors(parsedErrors, options) };\n };\n"],"names":["typanionResolver","validator","validatorOptions","values","_","options","rawErrors","isValid","Object","assign","errors","parsedErrors","reduce","acc","error","fieldIndex","indexOf","field","slice","message","trim","parseErrors","shouldUseNativeValidation","validateFieldsNatively","toNestErrors"],"mappings":"+EAIA,IAeaA,EACX,SAACC,EAAWC,eAAgB,IAAhBA,IAAAA,EAAmB,CAAE,GAChCC,SAAAA,EAAQC,EAAGC,GACV,IAAMC,EAAsB,GACtBC,EAAUN,EACdE,EACAK,OAAOC,OACL,GACA,CACEC,OAAQJ,GAEVJ,IAGES,EA7BU,SAACD,EAAkBC,GACrC,YADqCA,IAAAA,IAAAA,EAA4B,CAAE,GAC5DD,EAAOE,OAAO,SAACC,EAAKC,GACzB,IAAMC,EAAaD,EAAME,QAAQ,KAE3BC,EAAQH,EAAMI,MAAM,EAAGH,GACvBI,EAAUL,EAAMI,MAAMH,EAAa,GAAGK,OAM5C,OAJAP,EAAII,GAAS,CACXE,QAAAA,GAGKN,CACT,EAAGF,EACL,CAgByBU,CAAYf,GAEjC,OAAIC,GACFF,EAAQiB,2BACNC,EAAuBZ,EAAcN,GAEhC,CAAEF,OAAAA,EAAQO,OAAQ,CAAA,IAGpB,CAAEP,OAAQ,GAAIO,OAAQc,EAAab,EAAcN,GAC1D,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.umd.js b/node_modules/@hookform/resolvers/typanion/dist/typanion.umd.js deleted file mode 100644 index 0ff388b44fc449fcb967269e962cbd64295d41e9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers"],o):o((e||self).hookformResolversTypanion={},e.hookformResolvers)}(this,function(e,o){e.typanionResolver=function(e,r){return void 0===r&&(r={}),function(n,s,i){var t=[],f=e(n,Object.assign({},{errors:t},r)),l=function(e,o){return void 0===o&&(o={}),e.reduce(function(e,o){var r=o.indexOf(":"),n=o.slice(1,r),s=o.slice(r+1).trim();return e[n]={message:s},e},o)}(t);return f?(i.shouldUseNativeValidation&&o.validateFieldsNatively(l,i),{values:n,errors:{}}):{values:{},errors:o.toNestErrors(l,i)}}}}); -//# sourceMappingURL=typanion.umd.js.map diff --git a/node_modules/@hookform/resolvers/typanion/dist/typanion.umd.js.map b/node_modules/@hookform/resolvers/typanion/dist/typanion.umd.js.map deleted file mode 100644 index 93438c82e3c39d192bacb4512fa724234df4c649..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/typanion.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typanion.umd.js","sources":["../src/typanion.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { FieldError, FieldErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrors = (errors: string[], parsedErrors: FieldErrors = {}) => {\n return errors.reduce((acc, error) => {\n const fieldIndex = error.indexOf(':');\n\n const field = error.slice(1, fieldIndex);\n const message = error.slice(fieldIndex + 1).trim();\n\n acc[field] = {\n message,\n } as FieldError;\n\n return acc;\n }, parsedErrors);\n};\n\nexport const typanionResolver: Resolver =\n (validator, validatorOptions = {}) =>\n (values, _, options) => {\n const rawErrors: string[] = [];\n const isValid = validator(\n values,\n Object.assign(\n {},\n {\n errors: rawErrors,\n },\n validatorOptions,\n ),\n );\n const parsedErrors = parseErrors(rawErrors);\n\n if (isValid) {\n options.shouldUseNativeValidation &&\n validateFieldsNatively(parsedErrors, options);\n\n return { values, errors: {} };\n }\n\n return { values: {}, errors: toNestErrors(parsedErrors, options) };\n };\n"],"names":["validator","validatorOptions","values","_","options","rawErrors","isValid","Object","assign","errors","parsedErrors","reduce","acc","error","fieldIndex","indexOf","field","slice","message","trim","parseErrors","shouldUseNativeValidation","validateFieldsNatively","toNestErrors"],"mappings":"iVAoBE,SAACA,EAAWC,eAAgB,IAAhBA,IAAAA,EAAmB,CAAE,GAChCC,SAAAA,EAAQC,EAAGC,GACV,IAAMC,EAAsB,GACtBC,EAAUN,EACdE,EACAK,OAAOC,OACL,GACA,CACEC,OAAQJ,GAEVJ,IAGES,EA7BU,SAACD,EAAkBC,GACrC,YADqCA,IAAAA,IAAAA,EAA4B,CAAE,GAC5DD,EAAOE,OAAO,SAACC,EAAKC,GACzB,IAAMC,EAAaD,EAAME,QAAQ,KAE3BC,EAAQH,EAAMI,MAAM,EAAGH,GACvBI,EAAUL,EAAMI,MAAMH,EAAa,GAAGK,OAM5C,OAJAP,EAAII,GAAS,CACXE,QAAAA,GAGKN,CACT,EAAGF,EACL,CAgByBU,CAAYf,GAEjC,OAAIC,GACFF,EAAQiB,2BACNC,yBAAuBZ,EAAcN,GAEhC,CAAEF,OAAAA,EAAQO,OAAQ,CAAA,IAGpB,CAAEP,OAAQ,GAAIO,OAAQc,EAAYA,aAACb,EAAcN,GAC1D,CAAC"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typanion/dist/types.d.ts b/node_modules/@hookform/resolvers/typanion/dist/types.d.ts deleted file mode 100644 index 64ac9d9e360b1cc0e55590e61818f91da7328517..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/dist/types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { AnyStrictValidator, ValidationState } from 'typanion'; -type ValidateOptions = Pick; -type RHFResolver = (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => ResolverResult; -export type Resolver = (validator: UnknownValidator, validatorOptions?: ValidateOptions, resolverOptions?: { - mode?: 'async' | 'sync'; - rawValues?: boolean; -}) => RHFResolver; -export {}; diff --git a/node_modules/@hookform/resolvers/typanion/package.json b/node_modules/@hookform/resolvers/typanion/package.json deleted file mode 100644 index 7bcb849b1722a061a72d220c615381071d1f8dac..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/typanion", - "amdName": "hookformResolversTypanion", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: typanion", - "main": "dist/typanion.js", - "module": "dist/typanion.module.js", - "umd:main": "dist/typanion.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "typanion": "^3.3.2" - } -} diff --git a/node_modules/@hookform/resolvers/typanion/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/typanion/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 1a734725fadaac5eb8545f0711ed60ab3e45da28..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as t from 'typanion'; -import { typanionResolver } from '..'; - -const ERROR_MESSAGE = - 'Expected to have a length of at least 1 elements (got 0)'; - -const schema = t.isObject({ - username: t.applyCascade(t.isString(), [t.hasMinLength(1)]), - password: t.applyCascade(t.isString(), [t.hasMinLength(1)]), -}); - -interface FormData { - unusedProperty: string; - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: typanionResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Typanion", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(ERROR_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(ERROR_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/typanion/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/typanion/src/__tests__/Form.tsx deleted file mode 100644 index 339439abc467d23c7c761341555c1c710d2ef84b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/__tests__/Form.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as t from 'typanion'; -import { typanionResolver } from '..'; - -const schema = t.isObject({ - username: t.applyCascade(t.isString(), [t.hasMinLength(1)]), - password: t.applyCascade(t.isString(), [t.hasMinLength(1)]), -}); - -interface FormData { - unusedProperty: string; - username: string; - password: string; -} - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: typanionResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Typanion and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getAllByText( - 'Expected to have a length of at least 1 elements (got 0)', - ), - ).toHaveLength(2); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/typanion/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/typanion/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index ccb6f89f029c8e7c6031604a7c24e2f9f7eb8a28..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import * as t from 'typanion'; - -export const isSchema = t.isObject({ - username: t.applyCascade(t.isString(), [ - t.matchesRegExp(/^\w+$/), - t.hasMinLength(2), - t.hasMaxLength(30), - ]), - password: t.applyCascade(t.isString(), [ - t.matchesRegExp(new RegExp('.*[A-Z].*')), // one uppercase character - t.matchesRegExp(new RegExp('.*[a-z].*')), // one lowercase character - t.matchesRegExp(new RegExp('.*\\d.*')), // one number - t.matchesRegExp( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - ), // one special character - t.hasMinLength(8), // Must be at least 8 characters in length - ]), - repeatPassword: t.applyCascade(t.isString(), [ - t.matchesRegExp(new RegExp('.*[A-Z].*')), // one uppercase character - t.matchesRegExp(new RegExp('.*[a-z].*')), // one lowercase character - t.matchesRegExp(new RegExp('.*\\d.*')), // one number - t.matchesRegExp( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - ), // one special character - t.hasMinLength(8), // Must be at least 8 characters in length - ]), - accessToken: t.isString(), - birthYear: t.applyCascade(t.isNumber(), [ - t.isInteger(), - t.isInInclusiveRange(1900, 2013), - ]), - email: t.applyCascade(t.isString(), [t.matchesRegExp(/^\S+@\S+$/)]), - tags: t.isArray(t.isString()), - enabled: t.isBoolean(), - like: t.isObject({ - id: t.applyCascade(t.isNumber(), [t.isInteger(), t.isPositive()]), - name: t.applyCascade(t.isString(), [t.hasMinLength(4)]), - }), -}); - -export const validData = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: { - id: 1, - name: 'name', - }, -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: { id: 'z' }, - tags: [1, 2, 3], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/typanion/src/__tests__/__snapshots__/typanion.ts.snap b/node_modules/@hookform/resolvers/typanion/src/__tests__/__snapshots__/typanion.ts.snap deleted file mode 100644 index a2e888e19ade603c8385b91b9998b79cfa98891e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/__tests__/__snapshots__/typanion.ts.snap +++ /dev/null @@ -1,67 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`typanionResolver > should return a single error from typanionResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Expected a string (got undefined)", - "ref": undefined, - }, - "birthYear": { - "message": "Expected a number (got "birthYear")", - "ref": undefined, - }, - "email": { - "message": "Expected to match the pattern /^\\S+@\\S+$/ (got an empty string)", - "ref": { - "name": "email", - }, - }, - "enabled": { - "message": "Expected a boolean (got undefined)", - "ref": undefined, - }, - "like": { - "id": { - "message": "Expected a number (got "z")", - "ref": undefined, - }, - "name": { - "message": "Expected a string (got undefined)", - "ref": undefined, - }, - }, - "password": { - "message": "Expected to match the pattern /.*[A-Z].*/ (got "___")", - "ref": { - "name": "password", - }, - }, - "repeatPassword": { - "message": "Expected a string (got undefined)", - "ref": undefined, - }, - "tags": [ - { - "message": "Expected a string (got 1)", - "ref": undefined, - }, - { - "message": "Expected a string (got 2)", - "ref": undefined, - }, - { - "message": "Expected a string (got 3)", - "ref": undefined, - }, - ], - "username": { - "message": "Expected a string (got undefined)", - "ref": { - "name": "username", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/typanion/src/__tests__/typanion.ts b/node_modules/@hookform/resolvers/typanion/src/__tests__/typanion.ts deleted file mode 100644 index ff55961cd850cc07c5c174ccac33c8cc3ff72b7f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/__tests__/typanion.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { typanionResolver } from '..'; -import { fields, invalidData, isSchema, validData } from './__fixtures__/data'; - -const tmpObj = { - validate: isSchema, -}; - -const shouldUseNativeValidation = false; - -describe('typanionResolver', () => { - it('should return values from typanionResolver when validation pass', async () => { - const schemaSpy = vi.spyOn(tmpObj, 'validate'); - - const result = await typanionResolver(schemaSpy as any)( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from typanionResolver when validation fails', async () => { - const result = await typanionResolver(isSchema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); -}); diff --git a/node_modules/@hookform/resolvers/typanion/src/index.ts b/node_modules/@hookform/resolvers/typanion/src/index.ts deleted file mode 100644 index 492ec467cb5d7a846f1c47329464b2d0a45f778e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './typanion'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/typanion/src/typanion.ts b/node_modules/@hookform/resolvers/typanion/src/typanion.ts deleted file mode 100644 index 129063050bd9f630d1ad9d5841bf89a5fe28d187..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/typanion.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import type { FieldError, FieldErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrors = (errors: string[], parsedErrors: FieldErrors = {}) => { - return errors.reduce((acc, error) => { - const fieldIndex = error.indexOf(':'); - - const field = error.slice(1, fieldIndex); - const message = error.slice(fieldIndex + 1).trim(); - - acc[field] = { - message, - } as FieldError; - - return acc; - }, parsedErrors); -}; - -export const typanionResolver: Resolver = - (validator, validatorOptions = {}) => - (values, _, options) => { - const rawErrors: string[] = []; - const isValid = validator( - values, - Object.assign( - {}, - { - errors: rawErrors, - }, - validatorOptions, - ), - ); - const parsedErrors = parseErrors(rawErrors); - - if (isValid) { - options.shouldUseNativeValidation && - validateFieldsNatively(parsedErrors, options); - - return { values, errors: {} }; - } - - return { values: {}, errors: toNestErrors(parsedErrors, options) }; - }; diff --git a/node_modules/@hookform/resolvers/typanion/src/types.ts b/node_modules/@hookform/resolvers/typanion/src/types.ts deleted file mode 100644 index f767586f535c1e8eeb708a9de77ca65c639deeb8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typanion/src/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { - FieldValues, - ResolverOptions, - ResolverResult, -} from 'react-hook-form'; -import { AnyStrictValidator, ValidationState } from 'typanion'; - -type ValidateOptions = Pick; - -type RHFResolver = ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => ResolverResult; - -export type Resolver = ( - validator: UnknownValidator, - validatorOptions?: ValidateOptions, - resolverOptions?: { mode?: 'async' | 'sync'; rawValues?: boolean }, -) => RHFResolver; diff --git a/node_modules/@hookform/resolvers/typebox/dist/index.d.ts b/node_modules/@hookform/resolvers/typebox/dist/index.d.ts deleted file mode 100644 index 7e3350ad45c0f4aab809ef7dd531d259308cdd26..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './typebox'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.d.ts b/node_modules/@hookform/resolvers/typebox/dist/typebox.d.ts deleted file mode 100644 index 1a5cdf63c06907e06f03ee3b3de1f1182f4854ee..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const typeboxResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.js b/node_modules/@hookform/resolvers/typebox/dist/typebox.js deleted file mode 100644 index 85c9198732f580330a020e1d20550265729a5a34..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("@sinclair/typebox/compiler"),s=require("@sinclair/typebox/value"),o=require("react-hook-form"),a=function(e,r){for(var s={};e.length;){var a=e[0],t=a.type,i=a.message,l=a.path.substring(1).replace(/\//g,".");if(s[l]||(s[l]={message:i,type:""+t}),r){var n=s[l].types,u=n&&n[""+t];s[l]=o.appendErrors(l,r,s,""+t,u?[].concat(u,a.message):a.message)}e.shift()}return s};exports.typeboxResolver=function(o){return function(t,i,l){try{var n=Array.from(o instanceof r.TypeCheck?o.Errors(t):s.Value.Errors(o,t));return l.shouldUseNativeValidation&&e.validateFieldsNatively({},l),Promise.resolve(n.length?{values:{},errors:e.toNestErrors(a(n,!l.shouldUseNativeValidation&&"all"===l.criteriaMode),l)}:{errors:{},values:t})}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=typebox.js.map diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.js.map b/node_modules/@hookform/resolvers/typebox/dist/typebox.js.map deleted file mode 100644 index 1aeea301be0fc1cc22358027155b7f8669ae166b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typebox.js","sources":["../src/typebox.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { TypeCheck } from '@sinclair/typebox/compiler';\nimport { Value, type ValueError } from '@sinclair/typebox/value';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n _errors: ValueError[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; _errors.length; ) {\n const error = _errors[0];\n const { type, message, path } = error;\n const _path = path.substring(1).replace(/\\//g, '.');\n\n if (!errors[_path]) {\n errors[_path] = { message, type: '' + type };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types['' + type];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '' + type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n _errors.shift();\n }\n\n return errors;\n};\n\nexport const typeboxResolver: Resolver =\n (schema) => async (values, _, options) => {\n const errors = Array.from(\n schema instanceof TypeCheck\n ? schema.Errors(values)\n : Value.Errors(schema, values),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (!errors.length) {\n return {\n errors: {} as FieldErrors,\n values,\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n errors,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","_errors","validateAllFieldCriteria","errors","length","error","type","message","_path","path","substring","replace","types","messages","appendErrors","concat","shift","schema","values","_","options","Array","from","TypeCheck","Errors","Value","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","toNestErrors","criteriaMode","e","reject"],"mappings":"+IAMMA,EAAmB,SACvBC,EACAC,GAGA,IADA,IAAMC,EAAqC,GACpCF,EAAQG,QAAU,CACvB,IAAMC,EAAQJ,EAAQ,GACdK,EAAwBD,EAAxBC,KAAMC,EAAkBF,EAAlBE,QACRC,EAD0BH,EAATI,KACJC,UAAU,GAAGC,QAAQ,MAAO,KAM/C,GAJKR,EAAOK,KACVL,EAAOK,GAAS,CAAED,QAAAA,EAASD,KAAM,GAAKA,IAGpCJ,EAA0B,CAC5B,IAAMU,EAAQT,EAAOK,GAAOI,MACtBC,EAAWD,GAASA,EAAM,GAAKN,GAErCH,EAAOK,GAASM,EAAAA,aACdN,EACAN,EACAC,EACA,GAAKG,EACLO,EACK,GAAgBE,OAAOF,EAAsBR,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAQe,OACV,CAEA,OAAOb,CACT,0BAGE,SAACc,GAAkBC,OAAAA,SAAAA,EAAQC,EAAGC,GAAO,IACnC,IAAMjB,EAASkB,MAAMC,KACnBL,aAAkBM,EAASA,UACvBN,EAAOO,OAAON,GACdO,EAAKA,MAACD,OAAOP,EAAQC,IAK3B,OAFAE,EAAQM,2BAA6BC,EAAsBA,uBAAC,GAAIP,GAShEQ,QAAAC,QAPK1B,EAAOC,OAOL,CACLc,OAAQ,CAAA,EACRf,OAAQ2B,EAAYA,aAClB9B,EACEG,GACCiB,EAAQM,2BAAsD,QAAzBN,EAAQW,cAEhDX,IAbK,CACLjB,OAAQ,CAAA,EACRe,OAAAA,GAcN,CAAC,MAAAc,GAAA,OAAAJ,QAAAK,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.mjs b/node_modules/@hookform/resolvers/typebox/dist/typebox.mjs deleted file mode 100644 index 8fcef954e3220c43fe1963e7c0615e595e957cf4..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{TypeCheck as o}from"@sinclair/typebox/compiler";import{Value as t}from"@sinclair/typebox/value";import{appendErrors as s}from"react-hook-form";var a=function(r,e){for(var o={};r.length;){var t=r[0],a=t.type,i=t.message,n=t.path.substring(1).replace(/\//g,".");if(o[n]||(o[n]={message:i,type:""+a}),e){var m=o[n].types,l=m&&m[""+a];o[n]=s(n,e,o,""+a,l?[].concat(l,t.message):t.message)}r.shift()}return o},i=function(s){return function(i,n,m){try{var l=Array.from(s instanceof o?s.Errors(i):t.Errors(s,i));return m.shouldUseNativeValidation&&r({},m),Promise.resolve(l.length?{values:{},errors:e(a(l,!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)}:{errors:{},values:i})}catch(r){return Promise.reject(r)}}};export{i as typeboxResolver}; -//# sourceMappingURL=typebox.module.js.map diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.modern.mjs b/node_modules/@hookform/resolvers/typebox/dist/typebox.modern.mjs deleted file mode 100644 index e8dda295a85ae58aa40411caf4ab217c56210ef2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as o}from"@hookform/resolvers";import{TypeCheck as e}from"@sinclair/typebox/compiler";import{Value as s}from"@sinclair/typebox/value";import{appendErrors as t}from"react-hook-form";const a=(r,o)=>{const e={};for(;r.length;){const s=r[0],{type:a,message:i,path:n}=s,l=n.substring(1).replace(/\//g,".");if(e[l]||(e[l]={message:i,type:""+a}),o){const r=e[l].types,i=r&&r[""+a];e[l]=t(l,o,e,""+a,i?[].concat(i,s.message):s.message)}r.shift()}return e},i=t=>async(i,n,l)=>{const m=Array.from(t instanceof e?t.Errors(i):s.Errors(t,i));return l.shouldUseNativeValidation&&r({},l),m.length?{values:{},errors:o(a(m,!l.shouldUseNativeValidation&&"all"===l.criteriaMode),l)}:{errors:{},values:i}};export{i as typeboxResolver}; -//# sourceMappingURL=typebox.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.modern.mjs.map b/node_modules/@hookform/resolvers/typebox/dist/typebox.modern.mjs.map deleted file mode 100644 index a01e978cc42fa37843694a1166b16dbb5df34da7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typebox.modern.mjs","sources":["../src/typebox.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { TypeCheck } from '@sinclair/typebox/compiler';\nimport { Value, type ValueError } from '@sinclair/typebox/value';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n _errors: ValueError[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; _errors.length; ) {\n const error = _errors[0];\n const { type, message, path } = error;\n const _path = path.substring(1).replace(/\\//g, '.');\n\n if (!errors[_path]) {\n errors[_path] = { message, type: '' + type };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types['' + type];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '' + type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n _errors.shift();\n }\n\n return errors;\n};\n\nexport const typeboxResolver: Resolver =\n (schema) => async (values, _, options) => {\n const errors = Array.from(\n schema instanceof TypeCheck\n ? schema.Errors(values)\n : Value.Errors(schema, values),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (!errors.length) {\n return {\n errors: {} as FieldErrors,\n values,\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n errors,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","_errors","validateAllFieldCriteria","errors","length","error","type","message","path","_path","substring","replace","types","messages","appendErrors","concat","shift","typeboxResolver","schema","async","values","_","options","Array","from","TypeCheck","Errors","Value","shouldUseNativeValidation","validateFieldsNatively","toNestErrors","criteriaMode"],"mappings":"qOAMA,MAAMA,EAAmBA,CACvBC,EACAC,KAEA,MAAMC,EAAqC,CAAE,EAC7C,KAAOF,EAAQG,QAAU,CACvB,MAAMC,EAAQJ,EAAQ,IAChBK,KAAEA,EAAIC,QAAEA,EAAOC,KAAEA,GAASH,EAC1BI,EAAQD,EAAKE,UAAU,GAAGC,QAAQ,MAAO,KAM/C,GAJKR,EAAOM,KACVN,EAAOM,GAAS,CAAEF,UAASD,KAAM,GAAKA,IAGpCJ,EAA0B,CAC5B,MAAMU,EAAQT,EAAOM,GAAOG,MACtBC,EAAWD,GAASA,EAAM,GAAKN,GAErCH,EAAOM,GAASK,EACdL,EACAP,EACAC,EACA,GAAKG,EACLO,EACK,GAAgBE,OAAOF,EAAsBR,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAQe,OACV,CAEA,OAAOb,GAGIc,EACVC,GAAWC,MAAOC,EAAQC,EAAGC,KAC5B,MAAMnB,EAASoB,MAAMC,KACnBN,aAAkBO,EACdP,EAAOQ,OAAON,GACdO,EAAMD,OAAOR,EAAQE,IAK3B,OAFAE,EAAQM,2BAA6BC,EAAuB,CAAE,EAAEP,GAE3DnB,EAAOC,OAOL,CACLgB,OAAQ,CAAE,EACVjB,OAAQ2B,EACN9B,EACEG,GACCmB,EAAQM,2BAAsD,QAAzBN,EAAQS,cAEhDT,IAbK,CACLnB,OAAQ,CAAiB,EACzBiB"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.module.js b/node_modules/@hookform/resolvers/typebox/dist/typebox.module.js deleted file mode 100644 index 8fcef954e3220c43fe1963e7c0615e595e957cf4..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{TypeCheck as o}from"@sinclair/typebox/compiler";import{Value as t}from"@sinclair/typebox/value";import{appendErrors as s}from"react-hook-form";var a=function(r,e){for(var o={};r.length;){var t=r[0],a=t.type,i=t.message,n=t.path.substring(1).replace(/\//g,".");if(o[n]||(o[n]={message:i,type:""+a}),e){var m=o[n].types,l=m&&m[""+a];o[n]=s(n,e,o,""+a,l?[].concat(l,t.message):t.message)}r.shift()}return o},i=function(s){return function(i,n,m){try{var l=Array.from(s instanceof o?s.Errors(i):t.Errors(s,i));return m.shouldUseNativeValidation&&r({},m),Promise.resolve(l.length?{values:{},errors:e(a(l,!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)}:{errors:{},values:i})}catch(r){return Promise.reject(r)}}};export{i as typeboxResolver}; -//# sourceMappingURL=typebox.module.js.map diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.module.js.map b/node_modules/@hookform/resolvers/typebox/dist/typebox.module.js.map deleted file mode 100644 index 8ffb2f4bf99de101ca5fc50804a396720ef739a3..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typebox.module.js","sources":["../src/typebox.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { TypeCheck } from '@sinclair/typebox/compiler';\nimport { Value, type ValueError } from '@sinclair/typebox/value';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n _errors: ValueError[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; _errors.length; ) {\n const error = _errors[0];\n const { type, message, path } = error;\n const _path = path.substring(1).replace(/\\//g, '.');\n\n if (!errors[_path]) {\n errors[_path] = { message, type: '' + type };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types['' + type];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '' + type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n _errors.shift();\n }\n\n return errors;\n};\n\nexport const typeboxResolver: Resolver =\n (schema) => async (values, _, options) => {\n const errors = Array.from(\n schema instanceof TypeCheck\n ? schema.Errors(values)\n : Value.Errors(schema, values),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (!errors.length) {\n return {\n errors: {} as FieldErrors,\n values,\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n errors,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","_errors","validateAllFieldCriteria","errors","length","error","type","message","_path","path","substring","replace","types","messages","appendErrors","concat","shift","typeboxResolver","schema","values","_","options","Array","from","TypeCheck","Errors","Value","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","toNestErrors","criteriaMode","e","reject"],"mappings":"qOAMA,IAAMA,EAAmB,SACvBC,EACAC,GAGA,IADA,IAAMC,EAAqC,GACpCF,EAAQG,QAAU,CACvB,IAAMC,EAAQJ,EAAQ,GACdK,EAAwBD,EAAxBC,KAAMC,EAAkBF,EAAlBE,QACRC,EAD0BH,EAATI,KACJC,UAAU,GAAGC,QAAQ,MAAO,KAM/C,GAJKR,EAAOK,KACVL,EAAOK,GAAS,CAAED,QAAAA,EAASD,KAAM,GAAKA,IAGpCJ,EAA0B,CAC5B,IAAMU,EAAQT,EAAOK,GAAOI,MACtBC,EAAWD,GAASA,EAAM,GAAKN,GAErCH,EAAOK,GAASM,EACdN,EACAN,EACAC,EACA,GAAKG,EACLO,EACK,GAAgBE,OAAOF,EAAsBR,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAQe,OACV,CAEA,OAAOb,CACT,EAEac,EACX,SAACC,GAAkBC,OAAAA,SAAAA,EAAQC,EAAGC,GAAO,IACnC,IAAMlB,EAASmB,MAAMC,KACnBL,aAAkBM,EACdN,EAAOO,OAAON,GACdO,EAAMD,OAAOP,EAAQC,IAK3B,OAFAE,EAAQM,2BAA6BC,EAAuB,GAAIP,GAShEQ,QAAAC,QAPK3B,EAAOC,OAOL,CACLe,OAAQ,CAAA,EACRhB,OAAQ4B,EACN/B,EACEG,GACCkB,EAAQM,2BAAsD,QAAzBN,EAAQW,cAEhDX,IAbK,CACLlB,OAAQ,CAAA,EACRgB,OAAAA,GAcN,CAAC,MAAAc,GAAA,OAAAJ,QAAAK,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.umd.js b/node_modules/@hookform/resolvers/typebox/dist/typebox.umd.js deleted file mode 100644 index 8ba95fb9301907a81222910e8ecd98dc74663cad..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("@sinclair/typebox/compiler"),require("@sinclair/typebox/value"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","@sinclair/typebox/compiler","@sinclair/typebox/value","react-hook-form"],r):r((e||self).hookformResolversTypebox={},e.hookformResolvers,e.compiler,e.value,e.ReactHookForm)}(this,function(e,r,o,s,t){var i=function(e,r){for(var o={};e.length;){var s=e[0],i=s.type,a=s.message,l=s.path.substring(1).replace(/\//g,".");if(o[l]||(o[l]={message:a,type:""+i}),r){var n=o[l].types,f=n&&n[""+i];o[l]=t.appendErrors(l,r,o,""+i,f?[].concat(f,s.message):s.message)}e.shift()}return o};e.typeboxResolver=function(e){return function(t,a,l){try{var n=Array.from(e instanceof o.TypeCheck?e.Errors(t):s.Value.Errors(e,t));return l.shouldUseNativeValidation&&r.validateFieldsNatively({},l),Promise.resolve(n.length?{values:{},errors:r.toNestErrors(i(n,!l.shouldUseNativeValidation&&"all"===l.criteriaMode),l)}:{errors:{},values:t})}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=typebox.umd.js.map diff --git a/node_modules/@hookform/resolvers/typebox/dist/typebox.umd.js.map b/node_modules/@hookform/resolvers/typebox/dist/typebox.umd.js.map deleted file mode 100644 index af857704fed4f1419206fd5440d14772b839eadd..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/typebox.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typebox.umd.js","sources":["../src/typebox.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { TypeCheck } from '@sinclair/typebox/compiler';\nimport { Value, type ValueError } from '@sinclair/typebox/value';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n _errors: ValueError[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; _errors.length; ) {\n const error = _errors[0];\n const { type, message, path } = error;\n const _path = path.substring(1).replace(/\\//g, '.');\n\n if (!errors[_path]) {\n errors[_path] = { message, type: '' + type };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types['' + type];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '' + type,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n _errors.shift();\n }\n\n return errors;\n};\n\nexport const typeboxResolver: Resolver =\n (schema) => async (values, _, options) => {\n const errors = Array.from(\n schema instanceof TypeCheck\n ? schema.Errors(values)\n : Value.Errors(schema, values),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (!errors.length) {\n return {\n errors: {} as FieldErrors,\n values,\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n errors,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","_errors","validateAllFieldCriteria","errors","length","error","type","message","_path","path","substring","replace","types","messages","appendErrors","concat","shift","schema","values","_","options","Array","from","TypeCheck","Errors","Value","shouldUseNativeValidation","validateFieldsNatively","Promise","resolve","toNestErrors","criteriaMode","e","reject"],"mappings":"mhBAMA,IAAMA,EAAmB,SACvBC,EACAC,GAGA,IADA,IAAMC,EAAqC,GACpCF,EAAQG,QAAU,CACvB,IAAMC,EAAQJ,EAAQ,GACdK,EAAwBD,EAAxBC,KAAMC,EAAkBF,EAAlBE,QACRC,EAD0BH,EAATI,KACJC,UAAU,GAAGC,QAAQ,MAAO,KAM/C,GAJKR,EAAOK,KACVL,EAAOK,GAAS,CAAED,QAAAA,EAASD,KAAM,GAAKA,IAGpCJ,EAA0B,CAC5B,IAAMU,EAAQT,EAAOK,GAAOI,MACtBC,EAAWD,GAASA,EAAM,GAAKN,GAErCH,EAAOK,GAASM,EAAAA,aACdN,EACAN,EACAC,EACA,GAAKG,EACLO,EACK,GAAgBE,OAAOF,EAAsBR,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAQe,OACV,CAEA,OAAOb,CACT,oBAGE,SAACc,GAAkBC,OAAAA,SAAAA,EAAQC,EAAGC,GAAO,IACnC,IAAMjB,EAASkB,MAAMC,KACnBL,aAAkBM,EAASA,UACvBN,EAAOO,OAAON,GACdO,EAAKA,MAACD,OAAOP,EAAQC,IAK3B,OAFAE,EAAQM,2BAA6BC,EAAsBA,uBAAC,GAAIP,GAShEQ,QAAAC,QAPK1B,EAAOC,OAOL,CACLc,OAAQ,CAAA,EACRf,OAAQ2B,EAAYA,aAClB9B,EACEG,GACCiB,EAAQM,2BAAsD,QAAzBN,EAAQW,cAEhDX,IAbK,CACLjB,OAAQ,CAAA,EACRe,OAAAA,GAcN,CAAC,MAAAc,GAAA,OAAAJ,QAAAK,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typebox/dist/types.d.ts b/node_modules/@hookform/resolvers/typebox/dist/types.d.ts deleted file mode 100644 index 7d56cd4dd7738086308f3d531e37964121157bbc..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/dist/types.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Type } from '@sinclair/typebox'; -import type { TypeCheck } from '@sinclair/typebox/compiler'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = >(schema: T | TypeCheck) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/typebox/package.json b/node_modules/@hookform/resolvers/typebox/package.json deleted file mode 100644 index 96ddb250b59257a8094c7a4e87cb6ac5df27606b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/typebox", - "amdName": "hookformResolversTypebox", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: typebox", - "main": "dist/typebox.js", - "module": "dist/typebox.module.js", - "umd:main": "dist/typebox.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "@sinclair/typebox": "^0.25.24" - } -} diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-compiler.tsx b/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-compiler.tsx deleted file mode 100644 index 15363831d4d0d48432c16983db861382b030d9d0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-compiler.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { Static, Type } from '@sinclair/typebox'; -import { TypeCompiler } from '@sinclair/typebox/compiler'; -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { typeboxResolver } from '..'; - -const schema = Type.Object({ - username: Type.String({ minLength: 1 }), - password: Type.String({ minLength: 1 }), -}); - -const typecheck = TypeCompiler.Compile(schema); - -type FormData = Static & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: typeboxResolver(typecheck), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Typebox (with compiler) and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getAllByText(/Expected string length greater or equal to 1/i), - ).toHaveLength(2); - - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-native-validation-compiler.tsx b/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-native-validation-compiler.tsx deleted file mode 100644 index 2b2895fa50743b12ca253ad849c015fa1c1415ac..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-native-validation-compiler.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { typeboxResolver } from '..'; - -import { Static, Type } from '@sinclair/typebox'; -import { TypeCompiler } from '@sinclair/typebox/compiler'; - -const schema = Type.Object({ - username: Type.String({ minLength: 1 }), - password: Type.String({ minLength: 1 }), -}); - -const typecheck = TypeCompiler.Compile(schema); - -type FormData = Static; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: typeboxResolver(typecheck), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Typebox (with compiler)", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe( - 'Expected string length greater or equal to 1', - ); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe( - 'Expected string length greater or equal to 1', - ); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index b0d4de6d7875fbedde277c90570cfb98c8a47c17..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { typeboxResolver } from '..'; - -import { Static, Type } from '@sinclair/typebox'; - -const schema = Type.Object({ - username: Type.String({ minLength: 1 }), - password: Type.String({ minLength: 1 }), -}); - -type FormData = Static; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: typeboxResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Typebox", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe( - 'Expected string length greater or equal to 1', - ); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe( - 'Expected string length greater or equal to 1', - ); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/typebox/src/__tests__/Form.tsx deleted file mode 100644 index c4919aa864bcc2263c7e33c1e8413ad92468dee7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/Form.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Static, Type } from '@sinclair/typebox'; -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { typeboxResolver } from '..'; - -const schema = Type.Object({ - username: Type.String({ minLength: 1 }), - password: Type.String({ minLength: 1 }), -}); - -type FormData = Static & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: typeboxResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Typebox and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getAllByText(/Expected string length greater or equal to 1/i), - ).toHaveLength(2); - - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/typebox/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 113c80642b5035e4751408bdcd93e01f5c03afde..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Static, Type } from '@sinclair/typebox'; -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = Type.Object({ - username: Type.String({ - minLength: 3, - maxLength: 30, - pattern: '^[a-zA-Z0-9]+$', - }), - password: Type.String({ - minLength: 8, - pattern: '^(.*[A-Za-z\\d].*)$', - }), - repeatPassword: Type.String(), - accessToken: Type.Union([Type.String(), Type.Number()]), - birthYear: Type.Optional( - Type.Number({ - minimum: 1900, - maximum: 2013, - }), - ), - email: Type.Optional( - Type.RegExp( - /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, - ), - ), - tags: Type.Array(Type.String()), - enabled: Type.Boolean(), - like: Type.Optional( - Type.Array( - Type.Object({ - id: Type.Number(), - name: Type.String({ minLength: 4, maxLength: 4 }), - }), - ), - ), - dateStr: Type.Date(), -}); - -export const validData: Static = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'google@gmail.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: [ - { - id: 1, - name: 'name', - }, - ], - dateStr: new Date(), -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - url: 'abc', -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/__snapshots__/typebox-compiler.ts.snap b/node_modules/@hookform/resolvers/typebox/src/__tests__/__snapshots__/typebox-compiler.ts.snap deleted file mode 100644 index c5f60cd5be2c6ce950cfbfafb532542bc197b7b9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/__snapshots__/typebox-compiler.ts.snap +++ /dev/null @@ -1,188 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`typeboxResolver (with compiler) > should return a single error from typeboxResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "birthYear": { - "message": "Expected number", - "ref": undefined, - "type": "41", - }, - "dateStr": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "email": { - "message": "Expected string to match regular expression", - "ref": { - "name": "email", - }, - "type": "48", - }, - "enabled": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "like": [ - { - "id": { - "message": "Expected number", - "ref": undefined, - "type": "41", - }, - "name": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - }, - ], - "password": { - "message": "Expected string length greater or equal to 8", - "ref": { - "name": "password", - }, - "type": "52", - }, - "repeatPassword": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "tags": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "username": { - "message": "Required property", - "ref": { - "name": "username", - }, - "type": "45", - }, - }, - "values": {}, -} -`; - -exports[`typeboxResolver (with compiler) > should return all the errors from typeboxResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "62": "Expected union value", - }, - }, - "birthYear": { - "message": "Expected number", - "ref": undefined, - "type": "41", - "types": { - "41": "Expected number", - }, - }, - "dateStr": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "20": "Expected Date", - "45": "Required property", - }, - }, - "email": { - "message": "Expected string to match regular expression", - "ref": { - "name": "email", - }, - "type": "48", - "types": { - "48": "Expected string to match regular expression", - }, - }, - "enabled": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "14": "Expected boolean", - "45": "Required property", - }, - }, - "like": [ - { - "id": { - "message": "Expected number", - "ref": undefined, - "type": "41", - "types": { - "41": "Expected number", - }, - }, - "name": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "54": "Expected string", - }, - }, - }, - ], - "password": { - "message": "Expected string length greater or equal to 8", - "ref": { - "name": "password", - }, - "type": "52", - "types": { - "52": "Expected string length greater or equal to 8", - "53": "Expected string to match '^(.*[A-Za-z\\d].*)$'", - }, - }, - "repeatPassword": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "54": "Expected string", - }, - }, - "tags": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "6": "Expected array", - }, - }, - "username": { - "message": "Required property", - "ref": { - "name": "username", - }, - "type": "45", - "types": { - "45": "Required property", - "54": "Expected string", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/__snapshots__/typebox.ts.snap b/node_modules/@hookform/resolvers/typebox/src/__tests__/__snapshots__/typebox.ts.snap deleted file mode 100644 index 7addc74a393afea9300c00c0ab2a36682216ffb3..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/__snapshots__/typebox.ts.snap +++ /dev/null @@ -1,188 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`typeboxResolver > should return a single error from typeboxResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "birthYear": { - "message": "Expected number", - "ref": undefined, - "type": "41", - }, - "dateStr": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "email": { - "message": "Expected string to match regular expression", - "ref": { - "name": "email", - }, - "type": "48", - }, - "enabled": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "like": [ - { - "id": { - "message": "Expected number", - "ref": undefined, - "type": "41", - }, - "name": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - }, - ], - "password": { - "message": "Expected string length greater or equal to 8", - "ref": { - "name": "password", - }, - "type": "52", - }, - "repeatPassword": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "tags": { - "message": "Required property", - "ref": undefined, - "type": "45", - }, - "username": { - "message": "Required property", - "ref": { - "name": "username", - }, - "type": "45", - }, - }, - "values": {}, -} -`; - -exports[`typeboxResolver > should return all the errors from typeboxResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "62": "Expected union value", - }, - }, - "birthYear": { - "message": "Expected number", - "ref": undefined, - "type": "41", - "types": { - "41": "Expected number", - }, - }, - "dateStr": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "20": "Expected Date", - "45": "Required property", - }, - }, - "email": { - "message": "Expected string to match regular expression", - "ref": { - "name": "email", - }, - "type": "48", - "types": { - "48": "Expected string to match regular expression", - }, - }, - "enabled": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "14": "Expected boolean", - "45": "Required property", - }, - }, - "like": [ - { - "id": { - "message": "Expected number", - "ref": undefined, - "type": "41", - "types": { - "41": "Expected number", - }, - }, - "name": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "54": "Expected string", - }, - }, - }, - ], - "password": { - "message": "Expected string length greater or equal to 8", - "ref": { - "name": "password", - }, - "type": "52", - "types": { - "52": "Expected string length greater or equal to 8", - "53": "Expected string to match '^(.*[A-Za-z\\d].*)$'", - }, - }, - "repeatPassword": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "54": "Expected string", - }, - }, - "tags": { - "message": "Required property", - "ref": undefined, - "type": "45", - "types": { - "45": "Required property", - "6": "Expected array", - }, - }, - "username": { - "message": "Required property", - "ref": { - "name": "username", - }, - "type": "45", - "types": { - "45": "Required property", - "54": "Expected string", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/typebox-compiler.ts b/node_modules/@hookform/resolvers/typebox/src/__tests__/typebox-compiler.ts deleted file mode 100644 index fce2c1b4d5923497bdd7abddbdd72b84bf9e42de..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/typebox-compiler.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { TypeCompiler } from '@sinclair/typebox/compiler'; -import { typeboxResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('typeboxResolver (with compiler)', () => { - const typecheck = TypeCompiler.Compile(schema); - - it('should return a single error from typeboxResolver when validation fails', async () => { - const result = await typeboxResolver(typecheck)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from typeboxResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await typeboxResolver(typecheck)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should validate with success', async () => { - const result = await typeboxResolver(typecheck)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); -}); diff --git a/node_modules/@hookform/resolvers/typebox/src/__tests__/typebox.ts b/node_modules/@hookform/resolvers/typebox/src/__tests__/typebox.ts deleted file mode 100644 index be1c4ea571c358694023072a26eb7f88aa889e6d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/__tests__/typebox.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { typeboxResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('typeboxResolver', () => { - it('should return a single error from typeboxResolver when validation fails', async () => { - const result = await typeboxResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from typeboxResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await typeboxResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should validate with success', async () => { - const result = await typeboxResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); -}); diff --git a/node_modules/@hookform/resolvers/typebox/src/index.ts b/node_modules/@hookform/resolvers/typebox/src/index.ts deleted file mode 100644 index 7e3350ad45c0f4aab809ef7dd531d259308cdd26..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './typebox'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/typebox/src/typebox.ts b/node_modules/@hookform/resolvers/typebox/src/typebox.ts deleted file mode 100644 index 367b2e6576ee7194d91115d04aa24b1967bc43ae..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/typebox.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { TypeCheck } from '@sinclair/typebox/compiler'; -import { Value, type ValueError } from '@sinclair/typebox/value'; -import { FieldError, FieldErrors, appendErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrorSchema = ( - _errors: ValueError[], - validateAllFieldCriteria: boolean, -) => { - const errors: Record = {}; - for (; _errors.length; ) { - const error = _errors[0]; - const { type, message, path } = error; - const _path = path.substring(1).replace(/\//g, '.'); - - if (!errors[_path]) { - errors[_path] = { message, type: '' + type }; - } - - if (validateAllFieldCriteria) { - const types = errors[_path].types; - const messages = types && types['' + type]; - - errors[_path] = appendErrors( - _path, - validateAllFieldCriteria, - errors, - '' + type, - messages - ? ([] as string[]).concat(messages as string[], error.message) - : error.message, - ) as FieldError; - } - - _errors.shift(); - } - - return errors; -}; - -export const typeboxResolver: Resolver = - (schema) => async (values, _, options) => { - const errors = Array.from( - schema instanceof TypeCheck - ? schema.Errors(values) - : Value.Errors(schema, values), - ); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - if (!errors.length) { - return { - errors: {} as FieldErrors, - values, - }; - } - - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - errors, - !options.shouldUseNativeValidation && options.criteriaMode === 'all', - ), - options, - ), - }; - }; diff --git a/node_modules/@hookform/resolvers/typebox/src/types.ts b/node_modules/@hookform/resolvers/typebox/src/types.ts deleted file mode 100644 index 8bb580b6b960b33631b57874545f4a903f15321c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typebox/src/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Type } from '@sinclair/typebox'; -import type { TypeCheck } from '@sinclair/typebox/compiler'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = >( - schema: T | TypeCheck, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/typeschema/dist/index.d.ts b/node_modules/@hookform/resolvers/typeschema/dist/index.d.ts deleted file mode 100644 index a58fd09c5b7d0f570ec4b0f8b3ca4769bb18f796..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './typeschema'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/typeschema/dist/types.d.ts b/node_modules/@hookform/resolvers/typeschema/dist/types.d.ts deleted file mode 100644 index c35043f7182f0dca8fd8e392d7ef479103169c10..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Schema } from '@typeschema/main'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = (schema: T, schemaOptions?: never, factoryOptions?: { - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.d.ts b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.d.ts deleted file mode 100644 index 80b253bb74fa3731d78b60c98b2c75c9044875ae..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const typeschemaResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.js b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.js deleted file mode 100644 index 01ed8f0d1e28b6ddd3c18a3fb675149e1c93d49b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("@typeschema/main"),s=require("react-hook-form"),a=function(e,r){for(var a={};e.length;){var t=e[0];if(t.path){var o=t.path.join(".");if(a[o]||(a[o]={message:t.message,type:""}),r){var i=a[o].types,n=i&&i[""];a[o]=s.appendErrors(o,r,a,"",n?[].concat(n,t.message):t.message)}e.shift()}}return a};exports.typeschemaResolver=function(s,t,o){return void 0===o&&(o={}),function(t,i,n){try{return Promise.resolve(r.validate(s,t)).then(function(r){return n.shouldUseNativeValidation&&e.validateFieldsNatively({},n),r.success?{errors:{},values:o.raw?t:r.data}:{values:{},errors:e.toNestErrors(a(r.issues,!n.shouldUseNativeValidation&&"all"===n.criteriaMode),n)}})}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=typeschema.js.map diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.js.map b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.js.map deleted file mode 100644 index b7ba2eaa3e5e5f0d2f4828f1a84bf1598566bfee..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typeschema.js","sources":["../src/typeschema.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationIssue } from '@typeschema/core';\nimport { validate } from '@typeschema/main';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n typeschemaErrors: ValidationIssue[],\n validateAllFieldCriteria: boolean,\n): FieldErrors => {\n const errors: Record = {};\n\n for (; typeschemaErrors.length; ) {\n const error = typeschemaErrors[0];\n\n if (!error.path) {\n continue;\n }\n const _path = error.path.join('.');\n\n if (!errors[_path]) {\n errors[_path] = { message: error.message, type: '' };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[''];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '',\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n typeschemaErrors.shift();\n }\n\n return errors;\n};\n\nexport const typeschemaResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, _, options) => {\n const result = await validate(schema, values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (result.success) {\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : (result.data as any),\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.issues,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","typeschemaErrors","validateAllFieldCriteria","errors","length","error","path","_path","join","message","type","types","messages","appendErrors","concat","shift","schema","_","resolverOptions","values","options","Promise","resolve","validate","then","result","shouldUseNativeValidation","validateFieldsNatively","success","raw","data","toNestErrors","issues","criteriaMode","e","reject"],"mappings":"gGAMMA,EAAmB,SACvBC,EACAC,GAIA,IAFA,IAAMC,EAAqC,CAAE,EAEtCF,EAAiBG,QAAU,CAChC,IAAMC,EAAQJ,EAAiB,GAE/B,GAAKI,EAAMC,KAAX,CAGA,IAAMC,EAAQF,EAAMC,KAAKE,KAAK,KAM9B,GAJKL,EAAOI,KACVJ,EAAOI,GAAS,CAAEE,QAASJ,EAAMI,QAASC,KAAM,KAG9CR,EAA0B,CAC5B,IAAMS,EAAQR,EAAOI,GAAOI,MACtBC,EAAWD,GAASA,EAAM,IAEhCR,EAAOI,GAASM,EAAYA,aAC1BN,EACAL,EACAC,EACA,GACAS,EACK,GAAgBE,OAAOF,EAAsBP,EAAMI,SACpDJ,EAAMI,QAEd,CAEAR,EAAiBc,OAtBjB,CAuBF,CAEA,OAAOZ,CACT,6BAGE,SAACa,EAAQC,EAAGC,GACLC,YADKD,IAAAA,IAAAA,EAAkB,CAAA,GACvBC,SAAAA,EAAQF,EAAGG,OAAWC,OAAAA,QAAAC,QACNC,EAAQA,SAACP,EAAQG,IAAOK,cAAvCC,GAEmE,OAAzEL,EAAQM,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEP,GAE5DK,EAAOG,QACF,CACLzB,OAAQ,CAAiB,EACzBgB,OAAQD,EAAgBW,IAAMV,EAAUM,EAAOK,MAI5C,CACLX,OAAQ,CAAE,EACVhB,OAAQ4B,EAAYA,aAClB/B,EACEyB,EAAOO,QACNZ,EAAQM,2BAAsD,QAAzBN,EAAQa,cAEhDb,GAEH,EACH,CAAC,MAAAc,GAAAb,OAAAA,QAAAc,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.mjs b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.mjs deleted file mode 100644 index 63de3a9570701b4f41f498db8e933f5ca1f4a4ad..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{validate as o}from"@typeschema/main";import{appendErrors as t}from"react-hook-form";var s=function(r,e){for(var o={};r.length;){var s=r[0];if(s.path){var a=s.path.join(".");if(o[a]||(o[a]={message:s.message,type:""}),e){var i=o[a].types,n=i&&i[""];o[a]=t(a,e,o,"",n?[].concat(n,s.message):s.message)}r.shift()}}return o},a=function(t,a,i){return void 0===i&&(i={}),function(a,n,m){try{return Promise.resolve(o(t,a)).then(function(o){return m.shouldUseNativeValidation&&r({},m),o.success?{errors:{},values:i.raw?a:o.data}:{values:{},errors:e(s(o.issues,!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)}})}catch(r){return Promise.reject(r)}}};export{a as typeschemaResolver}; -//# sourceMappingURL=typeschema.module.js.map diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.modern.mjs b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.modern.mjs deleted file mode 100644 index 9d47022093b9ca7b1401bee587bc20a7b6559102..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as s,toNestErrors as e}from"@hookform/resolvers";import{validate as o}from"@typeschema/main";import{appendErrors as t}from"react-hook-form";const a=(s,e)=>{const o={};for(;s.length;){const a=s[0];if(!a.path)continue;const r=a.path.join(".");if(o[r]||(o[r]={message:a.message,type:""}),e){const s=o[r].types,i=s&&s[""];o[r]=t(r,e,o,"",i?[].concat(i,a.message):a.message)}s.shift()}return o},r=(t,r,i={})=>async(r,n,c)=>{const m=await o(t,r);return c.shouldUseNativeValidation&&s({},c),m.success?{errors:{},values:i.raw?r:m.data}:{values:{},errors:e(a(m.issues,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)}};export{r as typeschemaResolver}; -//# sourceMappingURL=typeschema.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.modern.mjs.map b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.modern.mjs.map deleted file mode 100644 index 1f57f5c43093867694ab0c61da28cb9939cd9a60..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typeschema.modern.mjs","sources":["../src/typeschema.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationIssue } from '@typeschema/core';\nimport { validate } from '@typeschema/main';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n typeschemaErrors: ValidationIssue[],\n validateAllFieldCriteria: boolean,\n): FieldErrors => {\n const errors: Record = {};\n\n for (; typeschemaErrors.length; ) {\n const error = typeschemaErrors[0];\n\n if (!error.path) {\n continue;\n }\n const _path = error.path.join('.');\n\n if (!errors[_path]) {\n errors[_path] = { message: error.message, type: '' };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[''];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '',\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n typeschemaErrors.shift();\n }\n\n return errors;\n};\n\nexport const typeschemaResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, _, options) => {\n const result = await validate(schema, values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (result.success) {\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : (result.data as any),\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.issues,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","typeschemaErrors","validateAllFieldCriteria","errors","length","error","path","_path","join","message","type","types","messages","appendErrors","concat","shift","typeschemaResolver","schema","_","resolverOptions","async","values","options","result","validate","shouldUseNativeValidation","validateFieldsNatively","success","raw","data","toNestErrors","issues","criteriaMode"],"mappings":"0KAMA,MAAMA,EAAmBA,CACvBC,EACAC,KAEA,MAAMC,EAAqC,CAAE,EAE7C,KAAOF,EAAiBG,QAAU,CAChC,MAAMC,EAAQJ,EAAiB,GAE/B,IAAKI,EAAMC,KACT,SAEF,MAAMC,EAAQF,EAAMC,KAAKE,KAAK,KAM9B,GAJKL,EAAOI,KACVJ,EAAOI,GAAS,CAAEE,QAASJ,EAAMI,QAASC,KAAM,KAG9CR,EAA0B,CAC5B,MAAMS,EAAQR,EAAOI,GAAOI,MACtBC,EAAWD,GAASA,EAAM,IAEhCR,EAAOI,GAASM,EACdN,EACAL,EACAC,EACA,GACAS,EACK,GAAgBE,OAAOF,EAAsBP,EAAMI,SACpDJ,EAAMI,QAEd,CAEAR,EAAiBc,OACnB,CAEA,OAAOZ,GAGIa,EACXA,CAACC,EAAQC,EAAGC,EAAkB,CAAE,IAChCC,MAAOC,EAAQH,EAAGI,KAChB,MAAMC,QAAeC,EAASP,EAAQI,GAItC,OAFAC,EAAQG,2BAA6BC,EAAuB,CAAE,EAAEJ,GAE5DC,EAAOI,QACF,CACLxB,OAAQ,CAAiB,EACzBkB,OAAQF,EAAgBS,IAAMP,EAAUE,EAAOM,MAI5C,CACLR,OAAQ,CAAA,EACRlB,OAAQ2B,EACN9B,EACEuB,EAAOQ,QACNT,EAAQG,2BAAsD,QAAzBH,EAAQU,cAEhDV"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.module.js b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.module.js deleted file mode 100644 index 63de3a9570701b4f41f498db8e933f5ca1f4a4ad..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{validate as o}from"@typeschema/main";import{appendErrors as t}from"react-hook-form";var s=function(r,e){for(var o={};r.length;){var s=r[0];if(s.path){var a=s.path.join(".");if(o[a]||(o[a]={message:s.message,type:""}),e){var i=o[a].types,n=i&&i[""];o[a]=t(a,e,o,"",n?[].concat(n,s.message):s.message)}r.shift()}}return o},a=function(t,a,i){return void 0===i&&(i={}),function(a,n,m){try{return Promise.resolve(o(t,a)).then(function(o){return m.shouldUseNativeValidation&&r({},m),o.success?{errors:{},values:i.raw?a:o.data}:{values:{},errors:e(s(o.issues,!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)}})}catch(r){return Promise.reject(r)}}};export{a as typeschemaResolver}; -//# sourceMappingURL=typeschema.module.js.map diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.module.js.map b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.module.js.map deleted file mode 100644 index 400f5a4aa355b501b368c75d028f707e3c469fd2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typeschema.module.js","sources":["../src/typeschema.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationIssue } from '@typeschema/core';\nimport { validate } from '@typeschema/main';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n typeschemaErrors: ValidationIssue[],\n validateAllFieldCriteria: boolean,\n): FieldErrors => {\n const errors: Record = {};\n\n for (; typeschemaErrors.length; ) {\n const error = typeschemaErrors[0];\n\n if (!error.path) {\n continue;\n }\n const _path = error.path.join('.');\n\n if (!errors[_path]) {\n errors[_path] = { message: error.message, type: '' };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[''];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '',\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n typeschemaErrors.shift();\n }\n\n return errors;\n};\n\nexport const typeschemaResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, _, options) => {\n const result = await validate(schema, values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (result.success) {\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : (result.data as any),\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.issues,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","typeschemaErrors","validateAllFieldCriteria","errors","length","error","path","_path","join","message","type","types","messages","appendErrors","concat","shift","typeschemaResolver","schema","_","resolverOptions","values","options","Promise","resolve","validate","then","result","shouldUseNativeValidation","validateFieldsNatively","success","raw","data","toNestErrors","issues","criteriaMode","e","reject"],"mappings":"0KAMA,IAAMA,EAAmB,SACvBC,EACAC,GAIA,IAFA,IAAMC,EAAqC,CAAE,EAEtCF,EAAiBG,QAAU,CAChC,IAAMC,EAAQJ,EAAiB,GAE/B,GAAKI,EAAMC,KAAX,CAGA,IAAMC,EAAQF,EAAMC,KAAKE,KAAK,KAM9B,GAJKL,EAAOI,KACVJ,EAAOI,GAAS,CAAEE,QAASJ,EAAMI,QAASC,KAAM,KAG9CR,EAA0B,CAC5B,IAAMS,EAAQR,EAAOI,GAAOI,MACtBC,EAAWD,GAASA,EAAM,IAEhCR,EAAOI,GAASM,EACdN,EACAL,EACAC,EACA,GACAS,EACK,GAAgBE,OAAOF,EAAsBP,EAAMI,SACpDJ,EAAMI,QAEd,CAEAR,EAAiBc,OAtBjB,CAuBF,CAEA,OAAOZ,CACT,EAEaa,EACX,SAACC,EAAQC,EAAGC,GACLC,YADKD,IAAAA,IAAAA,EAAkB,CAAA,GACvBC,SAAAA,EAAQF,EAAGG,OAAWC,OAAAA,QAAAC,QACNC,EAASP,EAAQG,IAAOK,cAAvCC,GAEmE,OAAzEL,EAAQM,2BAA6BC,EAAuB,CAAE,EAAEP,GAE5DK,EAAOG,QACF,CACL1B,OAAQ,CAAiB,EACzBiB,OAAQD,EAAgBW,IAAMV,EAAUM,EAAOK,MAI5C,CACLX,OAAQ,CAAE,EACVjB,OAAQ6B,EACNhC,EACE0B,EAAOO,QACNZ,EAAQM,2BAAsD,QAAzBN,EAAQa,cAEhDb,GAEH,EACH,CAAC,MAAAc,GAAAb,OAAAA,QAAAc,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.umd.js b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.umd.js deleted file mode 100644 index be948d4f54ed02cab371821f3657666eea6c27eb..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers"),require("@typeschema/main"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","@typeschema/main","react-hook-form"],o):o((e||self).hookformResolversTypeschema={},e.hookformResolvers,e.main,e.ReactHookForm)}(this,function(e,o,r,s){var t=function(e,o){for(var r={};e.length;){var t=e[0];if(t.path){var a=t.path.join(".");if(r[a]||(r[a]={message:t.message,type:""}),o){var i=r[a].types,n=i&&i[""];r[a]=s.appendErrors(a,o,r,"",n?[].concat(n,t.message):t.message)}e.shift()}}return r};e.typeschemaResolver=function(e,s,a){return void 0===a&&(a={}),function(s,i,n){try{return Promise.resolve(r.validate(e,s)).then(function(e){return n.shouldUseNativeValidation&&o.validateFieldsNatively({},n),e.success?{errors:{},values:a.raw?s:e.data}:{values:{},errors:o.toNestErrors(t(e.issues,!n.shouldUseNativeValidation&&"all"===n.criteriaMode),n)}})}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=typeschema.umd.js.map diff --git a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.umd.js.map b/node_modules/@hookform/resolvers/typeschema/dist/typeschema.umd.js.map deleted file mode 100644 index 4df61f32f809aabb586041e53697efff28af8209..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/dist/typeschema.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typeschema.umd.js","sources":["../src/typeschema.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport type { ValidationIssue } from '@typeschema/core';\nimport { validate } from '@typeschema/main';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n typeschemaErrors: ValidationIssue[],\n validateAllFieldCriteria: boolean,\n): FieldErrors => {\n const errors: Record = {};\n\n for (; typeschemaErrors.length; ) {\n const error = typeschemaErrors[0];\n\n if (!error.path) {\n continue;\n }\n const _path = error.path.join('.');\n\n if (!errors[_path]) {\n errors[_path] = { message: error.message, type: '' };\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[''];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n '',\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n typeschemaErrors.shift();\n }\n\n return errors;\n};\n\nexport const typeschemaResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, _, options) => {\n const result = await validate(schema, values);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n if (result.success) {\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : (result.data as any),\n };\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.issues,\n !options.shouldUseNativeValidation && options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n };\n"],"names":["parseErrorSchema","typeschemaErrors","validateAllFieldCriteria","errors","length","error","path","_path","join","message","type","types","messages","appendErrors","concat","shift","schema","_","resolverOptions","values","options","Promise","resolve","validate","then","result","shouldUseNativeValidation","validateFieldsNatively","success","raw","data","toNestErrors","issues","criteriaMode","e","reject"],"mappings":"ubAMA,IAAMA,EAAmB,SACvBC,EACAC,GAIA,IAFA,IAAMC,EAAqC,CAAE,EAEtCF,EAAiBG,QAAU,CAChC,IAAMC,EAAQJ,EAAiB,GAE/B,GAAKI,EAAMC,KAAX,CAGA,IAAMC,EAAQF,EAAMC,KAAKE,KAAK,KAM9B,GAJKL,EAAOI,KACVJ,EAAOI,GAAS,CAAEE,QAASJ,EAAMI,QAASC,KAAM,KAG9CR,EAA0B,CAC5B,IAAMS,EAAQR,EAAOI,GAAOI,MACtBC,EAAWD,GAASA,EAAM,IAEhCR,EAAOI,GAASM,EAAYA,aAC1BN,EACAL,EACAC,EACA,GACAS,EACK,GAAgBE,OAAOF,EAAsBP,EAAMI,SACpDJ,EAAMI,QAEd,CAEAR,EAAiBc,OAtBjB,CAuBF,CAEA,OAAOZ,CACT,uBAGE,SAACa,EAAQC,EAAGC,GACLC,YADKD,IAAAA,IAAAA,EAAkB,CAAA,GACvBC,SAAAA,EAAQF,EAAGG,OAAWC,OAAAA,QAAAC,QACNC,EAAQA,SAACP,EAAQG,IAAOK,cAAvCC,GAEmE,OAAzEL,EAAQM,2BAA6BC,EAAsBA,uBAAC,CAAE,EAAEP,GAE5DK,EAAOG,QACF,CACLzB,OAAQ,CAAiB,EACzBgB,OAAQD,EAAgBW,IAAMV,EAAUM,EAAOK,MAI5C,CACLX,OAAQ,CAAE,EACVhB,OAAQ4B,EAAYA,aAClB/B,EACEyB,EAAOO,QACNZ,EAAQM,2BAAsD,QAAzBN,EAAQa,cAEhDb,GAEH,EACH,CAAC,MAAAc,GAAAb,OAAAA,QAAAc,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/typeschema/package.json b/node_modules/@hookform/resolvers/typeschema/package.json deleted file mode 100644 index 4885a9615746a71627a442a63e888e194a62b660..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/typeschema", - "amdName": "hookformResolversTypeschema", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: typeschema", - "main": "dist/typeschema.js", - "module": "dist/typeschema.module.js", - "umd:main": "dist/typeschema.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "@typeschema/main": "^0.13.7" - } -} diff --git a/node_modules/@hookform/resolvers/typeschema/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/typeschema/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index a1b8732725bda64cc12533aa8c37559dba81ee98..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import type { Infer } from '@typeschema/main'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { z } from 'zod'; -import { typeschemaResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = z.object({ - username: z.string().min(1, { message: USERNAME_REQUIRED_MESSAGE }), - password: z.string().min(1, { message: PASSWORD_REQUIRED_MESSAGE }), -}); - -type FormData = Infer; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: typeschemaResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with TypeSchema", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/typeschema/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/typeschema/src/__tests__/Form.tsx deleted file mode 100644 index e6a83839f31e907b8e80f77344ece1ac021fdbf4..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/__tests__/Form.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import type { Infer } from '@typeschema/main'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { z } from 'zod'; -import { typeschemaResolver } from '..'; - -const schema = z.object({ - username: z.string().min(1, { message: 'username field is required' }), - password: z.string().min(1, { message: 'password field is required' }), -}); - -type FormData = Infer & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: typeschemaResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with TypeSchema and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/password field is required/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/typeschema/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/typeschema/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 01923b40e19cd3c2e7e590da3de20c825f9a82a6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import { z } from 'zod'; - -export const schema = z - .object({ - username: z.string().regex(/^\w+$/).min(3).max(30), - password: z - .string() - .regex(new RegExp('.*[A-Z].*'), 'One uppercase character') - .regex(new RegExp('.*[a-z].*'), 'One lowercase character') - .regex(new RegExp('.*\\d.*'), 'One number') - .regex( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ) - .min(8, 'Must be at least 8 characters in length'), - repeatPassword: z.string(), - accessToken: z.union([z.string(), z.number()]), - birthYear: z.number().min(1900).max(2013).optional(), - email: z.string().email().optional(), - tags: z.array(z.string()), - enabled: z.boolean(), - url: z.string().url('Custom error url').or(z.literal('')), - like: z - .array( - z.object({ - id: z.number(), - name: z.string().length(4), - }), - ) - .optional(), - dateStr: z - .string() - .transform((value) => new Date(value)) - .refine((value) => !isNaN(value.getTime()), { - message: 'Invalid date', - }), - }) - .refine((obj) => obj.password === obj.repeatPassword, { - message: 'Passwords do not match', - path: ['confirm'], - }); - -export const validData: z.input = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - url: 'https://react-hook-form.com/', - like: [ - { - id: 1, - name: 'name', - }, - ], - dateStr: '2020-01-01', -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - url: 'abc', -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/typeschema/src/__tests__/__snapshots__/typeschema.ts.snap b/node_modules/@hookform/resolvers/typeschema/src/__tests__/__snapshots__/typeschema.ts.snap deleted file mode 100644 index 143a3fcd04e86b984560ec63b995473464b8226f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/__tests__/__snapshots__/typeschema.ts.snap +++ /dev/null @@ -1,225 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`typeschemaResolver > should return a single error from typeschemaResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Invalid input", - "ref": undefined, - "type": "", - }, - "birthYear": { - "message": "Expected number, received string", - "ref": undefined, - "type": "", - }, - "dateStr": { - "message": "Required", - "ref": undefined, - "type": "", - }, - "email": { - "message": "Invalid email", - "ref": { - "name": "email", - }, - "type": "", - }, - "enabled": { - "message": "Required", - "ref": undefined, - "type": "", - }, - "like": [ - { - "id": { - "message": "Expected number, received string", - "ref": undefined, - "type": "", - }, - "name": { - "message": "Required", - "ref": undefined, - "type": "", - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "", - }, - "repeatPassword": { - "message": "Required", - "ref": undefined, - "type": "", - }, - "tags": { - "message": "Required", - "ref": undefined, - "type": "", - }, - "url": { - "message": "Custom error url", - "ref": undefined, - "type": "", - }, - "username": { - "message": "Required", - "ref": { - "name": "username", - }, - "type": "", - }, - }, - "values": {}, -} -`; - -exports[`typeschemaResolver > should return all the errors from typeschemaResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Invalid input", - "ref": undefined, - "type": "", - "types": { - "": "Invalid input", - }, - }, - "birthYear": { - "message": "Expected number, received string", - "ref": undefined, - "type": "", - "types": { - "": "Expected number, received string", - }, - }, - "dateStr": { - "message": "Required", - "ref": undefined, - "type": "", - "types": { - "": "Required", - }, - }, - "email": { - "message": "Invalid email", - "ref": { - "name": "email", - }, - "type": "", - "types": { - "": "Invalid email", - }, - }, - "enabled": { - "message": "Required", - "ref": undefined, - "type": "", - "types": { - "": "Required", - }, - }, - "like": [ - { - "id": { - "message": "Expected number, received string", - "ref": undefined, - "type": "", - "types": { - "": "Expected number, received string", - }, - }, - "name": { - "message": "Required", - "ref": undefined, - "type": "", - "types": { - "": "Required", - }, - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "", - "types": { - "": [ - "One uppercase character", - "One lowercase character", - "One number", - "Must be at least 8 characters in length", - ], - }, - }, - "repeatPassword": { - "message": "Required", - "ref": undefined, - "type": "", - "types": { - "": "Required", - }, - }, - "tags": { - "message": "Required", - "ref": undefined, - "type": "", - "types": { - "": "Required", - }, - }, - "url": { - "message": "Custom error url", - "ref": undefined, - "type": "", - "types": { - "": "Custom error url", - }, - }, - "username": { - "message": "Required", - "ref": { - "name": "username", - }, - "type": "", - "types": { - "": "Required", - }, - }, - }, - "values": {}, -} -`; - -exports[`typeschemaResolver > should return parsed values from typeschemaResolver when validation pass 1`] = ` -{ - "errors": {}, - "values": { - "accessToken": "accessToken", - "birthYear": 2000, - "dateStr": 2020-01-01T00:00:00.000Z, - "email": "john@doe.com", - "enabled": true, - "like": [ - { - "id": 1, - "name": "name", - }, - ], - "password": "Password123_", - "repeatPassword": "Password123_", - "tags": [ - "tag1", - "tag2", - ], - "url": "https://react-hook-form.com/", - "username": "Doe", - }, -} -`; diff --git a/node_modules/@hookform/resolvers/typeschema/src/__tests__/typeschema.ts b/node_modules/@hookform/resolvers/typeschema/src/__tests__/typeschema.ts deleted file mode 100644 index dc31f77862d182cb0d25c6f51b589ea37e175000..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/__tests__/typeschema.ts +++ /dev/null @@ -1,70 +0,0 @@ -import * as typeschema from '@typeschema/main'; -import { typeschemaResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -vi.mock('@typeschema/main', async (importOriginal) => { - const module: object = await importOriginal(); - return { ...module }; -}); - -describe('typeschemaResolver', () => { - it('should return values from typeschemaResolver when validation pass & raw=true', async () => { - const validateSpy = vi.spyOn(typeschema, 'validate'); - - const result = await typeschemaResolver(schema, undefined, { raw: true })( - validData, - undefined, - { fields, shouldUseNativeValidation }, - ); - - expect(validateSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return parsed values from typeschemaResolver when validation pass', async () => { - const validateSpy = vi.spyOn(typeschema, 'validate'); - - const result = await typeschemaResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(validateSpy).toHaveBeenCalledTimes(1); - expect(result.errors).toEqual({}); - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from typeschemaResolver when validation fails', async () => { - const result = await typeschemaResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from typeschemaResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await typeschemaResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should throw any error unrelated to TypeSchema', async () => { - const schemaWithCustomError = schema.refine(() => { - throw Error('custom error'); - }); - const promise = typeschemaResolver(schemaWithCustomError)( - validData, - undefined, - { fields, shouldUseNativeValidation }, - ); - - await expect(promise).rejects.toThrow('custom error'); - }); -}); diff --git a/node_modules/@hookform/resolvers/typeschema/src/index.ts b/node_modules/@hookform/resolvers/typeschema/src/index.ts deleted file mode 100644 index a58fd09c5b7d0f570ec4b0f8b3ca4769bb18f796..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './typeschema'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/typeschema/src/types.ts b/node_modules/@hookform/resolvers/typeschema/src/types.ts deleted file mode 100644 index 4f1288f9ce530edde83593f3cb3c5da6975522df..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Schema } from '@typeschema/main'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = ( - schema: T, - schemaOptions?: never, - factoryOptions?: { - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; - }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/typeschema/src/typeschema.ts b/node_modules/@hookform/resolvers/typeschema/src/typeschema.ts deleted file mode 100644 index e0a92d672781567fb8685a8435feb5868d1c3af6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/typeschema/src/typeschema.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import type { ValidationIssue } from '@typeschema/core'; -import { validate } from '@typeschema/main'; -import { FieldError, FieldErrors, appendErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrorSchema = ( - typeschemaErrors: ValidationIssue[], - validateAllFieldCriteria: boolean, -): FieldErrors => { - const errors: Record = {}; - - for (; typeschemaErrors.length; ) { - const error = typeschemaErrors[0]; - - if (!error.path) { - continue; - } - const _path = error.path.join('.'); - - if (!errors[_path]) { - errors[_path] = { message: error.message, type: '' }; - } - - if (validateAllFieldCriteria) { - const types = errors[_path].types; - const messages = types && types['']; - - errors[_path] = appendErrors( - _path, - validateAllFieldCriteria, - errors, - '', - messages - ? ([] as string[]).concat(messages as string[], error.message) - : error.message, - ) as FieldError; - } - - typeschemaErrors.shift(); - } - - return errors; -}; - -export const typeschemaResolver: Resolver = - (schema, _, resolverOptions = {}) => - async (values, _, options) => { - const result = await validate(schema, values); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - if (result.success) { - return { - errors: {} as FieldErrors, - values: resolverOptions.raw ? values : (result.data as any), - }; - } - - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - result.issues, - !options.shouldUseNativeValidation && options.criteriaMode === 'all', - ), - options, - ), - }; - }; diff --git a/node_modules/@hookform/resolvers/valibot/dist/index.d.ts b/node_modules/@hookform/resolvers/valibot/dist/index.d.ts deleted file mode 100644 index ce0aecaecbde987dd058c48d5baf1bf9dcaa0b8d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './valibot'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/valibot/dist/types.d.ts b/node_modules/@hookform/resolvers/valibot/dist/types.d.ts deleted file mode 100644 index dbbaf946a4691af60e166dadff1bb478a66a2ab6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { BaseIssue, BaseSchema, BaseSchemaAsync, Config, InferIssue } from 'valibot'; -export type Resolver = > | BaseSchemaAsync>>(schema: T, schemaOptions?: Partial>, 'abortPipeEarly' | 'skipPipe'>>, resolverOptions?: { - /** - * @default async - */ - mode?: 'sync' | 'async'; - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.d.ts b/node_modules/@hookform/resolvers/valibot/dist/valibot.d.ts deleted file mode 100644 index 4ffe37b69038215895b35d80e11acc7729742eea..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const valibotResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.js b/node_modules/@hookform/resolvers/valibot/dist/valibot.js deleted file mode 100644 index e2a5c5d6ef939171df28a0401f4239fd8c10331c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("react-hook-form"),s=require("valibot");exports.valibotResolver=function(t,o,a){return void 0===a&&(a={}),function(i,u,n){try{var v=!n.shouldUseNativeValidation&&"all"===n.criteriaMode;return Promise.resolve(s.safeParseAsync(t,i,Object.assign({},o,{abortPipeEarly:!v}))).then(function(t){if(t.issues){for(var o={};t.issues.length;){var u=t.issues[0],l=s.getDotPath(u);if(l&&(o[l]||(o[l]={message:u.message,type:u.type}),v)){var c=o[l].types,f=c&&c[u.type];o[l]=r.appendErrors(l,v,o,u.type,f?[].concat(f,u.message):u.message)}t.issues.shift()}return{values:{},errors:e.toNestErrors(o,n)}}return{values:a.raw?i:t.output,errors:{}}})}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=valibot.js.map diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.js.map b/node_modules/@hookform/resolvers/valibot/dist/valibot.js.map deleted file mode 100644 index 0fbbcf0cbd6b227943a11bfc4e0f33f27e761d80..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"valibot.js","sources":["../src/valibot.ts"],"sourcesContent":["import { toNestErrors } from '@hookform/resolvers';\nimport { FieldError, FieldValues, appendErrors } from 'react-hook-form';\nimport { getDotPath, safeParseAsync } from 'valibot';\nimport type { Resolver } from './types';\n\nexport const valibotResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n // Check if we should validate all field criteria\n const validateAllFieldCriteria =\n !options.shouldUseNativeValidation && options.criteriaMode === 'all';\n\n // Parse values with Valibot schema\n const result = await safeParseAsync(\n schema,\n values,\n Object.assign({}, schemaOptions, {\n abortPipeEarly: !validateAllFieldCriteria,\n }),\n );\n\n // If there are issues, return them as errors\n if (result.issues) {\n // Create errors object\n const errors: Record = {};\n\n // Iterate over issues to add them to errors object\n for (; result.issues.length; ) {\n const issue = result.issues[0];\n // Create dot path from issue\n const path = getDotPath(issue);\n\n if (path) {\n // Add first error of path to errors object\n if (!errors[path]) {\n errors[path] = { message: issue.message, type: issue.type };\n }\n\n // If configured, add all errors of path to errors object\n if (validateAllFieldCriteria) {\n const types = errors[path].types;\n const messages = types && types[issue.type];\n errors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n errors,\n issue.type,\n messages\n ? ([] as string[]).concat(\n messages as string | string[],\n issue.message,\n )\n : issue.message,\n ) as FieldError;\n }\n }\n\n result.issues.shift();\n }\n\n // Return resolver result with errors\n return {\n values: {},\n errors: toNestErrors(errors, options),\n } as const;\n }\n\n // Otherwise, return resolver result with values\n return {\n values: resolverOptions.raw ? values : (result.output as FieldValues),\n errors: {},\n };\n };\n"],"names":["schema","schemaOptions","resolverOptions","values","_","options","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","Promise","resolve","safeParseAsync","Object","assign","abortPipeEarly","then","result","issues","errors","length","issue","path","getDotPath","message","type","types","messages","appendErrors","concat","shift","toNestErrors","raw","output","e","reject"],"mappings":"+GAME,SAACA,EAAQC,EAAeC,GACjBC,YADgC,IAAfD,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAO,IAEvB,IAAMC,GACHD,EAAQE,2BAAsD,QAAzBF,EAAQG,aAAuB,OAAAC,QAAAC,QAGlDC,EAAcA,eACjCX,EACAG,EACAS,OAAOC,OAAO,GAAIZ,EAAe,CAC/Ba,gBAAiBR,MAEpBS,KAAA,SANKC,GASN,GAAIA,EAAOC,OAAQ,CAKjB,IAHA,IAAMC,EAAqC,CAAA,EAGpCF,EAAOC,OAAOE,QAAU,CAC7B,IAAMC,EAAQJ,EAAOC,OAAO,GAEtBI,EAAOC,EAAUA,WAACF,GAExB,GAAIC,IAEGH,EAAOG,KACVH,EAAOG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMI,OAInDlB,GAA0B,CAC5B,IAAMmB,EAAQP,EAAOG,GAAMI,MACrBC,EAAWD,GAASA,EAAML,EAAMI,MACtCN,EAAOG,GAAQM,eACbN,EACAf,EACAY,EACAE,EAAMI,KACNE,EACK,GAAgBE,OACfF,EACAN,EAAMG,SAERH,EAAMG,QAEd,CAGFP,EAAOC,OAAOY,OAChB,CAGA,MAAO,CACL1B,OAAQ,CAAA,EACRe,OAAQY,EAAAA,aAAaZ,EAAQb,GAEjC,CAGA,MAAO,CACLF,OAAQD,EAAgB6B,IAAM5B,EAAUa,EAAOgB,OAC/Cd,OAAQ,CAAA,EACR,EACJ,CAAC,MAAAe,GAAAxB,OAAAA,QAAAyB,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.mjs b/node_modules/@hookform/resolvers/valibot/dist/valibot.mjs deleted file mode 100644 index 7bdbe77725b17f5feba8816bd8709aac872f2cd8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as e}from"@hookform/resolvers";import{appendErrors as r}from"react-hook-form";import{safeParseAsync as s,getDotPath as t}from"valibot";var o=function(o,a,i){return void 0===i&&(i={}),function(u,n,m){try{var f=!m.shouldUseNativeValidation&&"all"===m.criteriaMode;return Promise.resolve(s(o,u,Object.assign({},a,{abortPipeEarly:!f}))).then(function(s){if(s.issues){for(var o={};s.issues.length;){var a=s.issues[0],n=t(a);if(n&&(o[n]||(o[n]={message:a.message,type:a.type}),f)){var v=o[n].types,c=v&&v[a.type];o[n]=r(n,f,o,a.type,c?[].concat(c,a.message):a.message)}s.issues.shift()}return{values:{},errors:e(o,m)}}return{values:i.raw?u:s.output,errors:{}}})}catch(e){return Promise.reject(e)}}};export{o as valibotResolver}; -//# sourceMappingURL=valibot.module.js.map diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.modern.mjs b/node_modules/@hookform/resolvers/valibot/dist/valibot.modern.mjs deleted file mode 100644 index 97307a76861a8c45bde5a8a9054e4b0a97afc358..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as s}from"@hookform/resolvers";import{appendErrors as e}from"react-hook-form";import{safeParseAsync as o,getDotPath as t}from"valibot";const r=(r,a,i={})=>async(m,n,c)=>{const p=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,u=await o(r,m,Object.assign({},a,{abortPipeEarly:!p}));if(u.issues){const o={};for(;u.issues.length;){const s=u.issues[0],r=t(s);if(r&&(o[r]||(o[r]={message:s.message,type:s.type}),p)){const t=o[r].types,a=t&&t[s.type];o[r]=e(r,p,o,s.type,a?[].concat(a,s.message):s.message)}u.issues.shift()}return{values:{},errors:s(o,c)}}return{values:i.raw?m:u.output,errors:{}}};export{r as valibotResolver}; -//# sourceMappingURL=valibot.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.modern.mjs.map b/node_modules/@hookform/resolvers/valibot/dist/valibot.modern.mjs.map deleted file mode 100644 index 01da23055d4d3c65b2e18cb387661ea03bd23ead..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"valibot.modern.mjs","sources":["../src/valibot.ts"],"sourcesContent":["import { toNestErrors } from '@hookform/resolvers';\nimport { FieldError, FieldValues, appendErrors } from 'react-hook-form';\nimport { getDotPath, safeParseAsync } from 'valibot';\nimport type { Resolver } from './types';\n\nexport const valibotResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n // Check if we should validate all field criteria\n const validateAllFieldCriteria =\n !options.shouldUseNativeValidation && options.criteriaMode === 'all';\n\n // Parse values with Valibot schema\n const result = await safeParseAsync(\n schema,\n values,\n Object.assign({}, schemaOptions, {\n abortPipeEarly: !validateAllFieldCriteria,\n }),\n );\n\n // If there are issues, return them as errors\n if (result.issues) {\n // Create errors object\n const errors: Record = {};\n\n // Iterate over issues to add them to errors object\n for (; result.issues.length; ) {\n const issue = result.issues[0];\n // Create dot path from issue\n const path = getDotPath(issue);\n\n if (path) {\n // Add first error of path to errors object\n if (!errors[path]) {\n errors[path] = { message: issue.message, type: issue.type };\n }\n\n // If configured, add all errors of path to errors object\n if (validateAllFieldCriteria) {\n const types = errors[path].types;\n const messages = types && types[issue.type];\n errors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n errors,\n issue.type,\n messages\n ? ([] as string[]).concat(\n messages as string | string[],\n issue.message,\n )\n : issue.message,\n ) as FieldError;\n }\n }\n\n result.issues.shift();\n }\n\n // Return resolver result with errors\n return {\n values: {},\n errors: toNestErrors(errors, options),\n } as const;\n }\n\n // Otherwise, return resolver result with values\n return {\n values: resolverOptions.raw ? values : (result.output as FieldValues),\n errors: {},\n };\n };\n"],"names":["valibotResolver","schema","schemaOptions","resolverOptions","async","values","_","options","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","result","safeParseAsync","Object","assign","abortPipeEarly","issues","errors","length","issue","path","getDotPath","message","type","types","messages","appendErrors","concat","shift","toNestErrors","raw","output"],"mappings":"2JAKa,MAAAA,EACXA,CAACC,EAAQC,EAAeC,EAAkB,CAAA,IAC1CC,MAAOC,EAAQC,EAAGC,KAEhB,MAAMC,GACHD,EAAQE,2BAAsD,QAAzBF,EAAQG,aAG1CC,QAAeC,EACnBX,EACAI,EACAQ,OAAOC,OAAO,CAAA,EAAIZ,EAAe,CAC/Ba,gBAAiBP,KAKrB,GAAIG,EAAOK,OAAQ,CAEjB,MAAMC,EAAqC,CAAA,EAG3C,KAAON,EAAOK,OAAOE,QAAU,CAC7B,MAAMC,EAAQR,EAAOK,OAAO,GAEtBI,EAAOC,EAAWF,GAExB,GAAIC,IAEGH,EAAOG,KACVH,EAAOG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMI,OAInDf,GAA0B,CAC5B,MAAMgB,EAAQP,EAAOG,GAAMI,MACrBC,EAAWD,GAASA,EAAML,EAAMI,MACtCN,EAAOG,GAAQM,EACbN,EACAZ,EACAS,EACAE,EAAMI,KACNE,EACK,GAAgBE,OACfF,EACAN,EAAMG,SAERH,EAAMG,QAEd,CAGFX,EAAOK,OAAOY,OAChB,CAGA,MAAO,CACLvB,OAAQ,CAAA,EACRY,OAAQY,EAAaZ,EAAQV,GAEjC,CAGA,MAAO,CACLF,OAAQF,EAAgB2B,IAAMzB,EAAUM,EAAOoB,OAC/Cd,OAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.module.js b/node_modules/@hookform/resolvers/valibot/dist/valibot.module.js deleted file mode 100644 index 7bdbe77725b17f5feba8816bd8709aac872f2cd8..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as e}from"@hookform/resolvers";import{appendErrors as r}from"react-hook-form";import{safeParseAsync as s,getDotPath as t}from"valibot";var o=function(o,a,i){return void 0===i&&(i={}),function(u,n,m){try{var f=!m.shouldUseNativeValidation&&"all"===m.criteriaMode;return Promise.resolve(s(o,u,Object.assign({},a,{abortPipeEarly:!f}))).then(function(s){if(s.issues){for(var o={};s.issues.length;){var a=s.issues[0],n=t(a);if(n&&(o[n]||(o[n]={message:a.message,type:a.type}),f)){var v=o[n].types,c=v&&v[a.type];o[n]=r(n,f,o,a.type,c?[].concat(c,a.message):a.message)}s.issues.shift()}return{values:{},errors:e(o,m)}}return{values:i.raw?u:s.output,errors:{}}})}catch(e){return Promise.reject(e)}}};export{o as valibotResolver}; -//# sourceMappingURL=valibot.module.js.map diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.module.js.map b/node_modules/@hookform/resolvers/valibot/dist/valibot.module.js.map deleted file mode 100644 index 472111a9b4c8a9b7a5ab6a1e78d6d5a744b83822..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"valibot.module.js","sources":["../src/valibot.ts"],"sourcesContent":["import { toNestErrors } from '@hookform/resolvers';\nimport { FieldError, FieldValues, appendErrors } from 'react-hook-form';\nimport { getDotPath, safeParseAsync } from 'valibot';\nimport type { Resolver } from './types';\n\nexport const valibotResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n // Check if we should validate all field criteria\n const validateAllFieldCriteria =\n !options.shouldUseNativeValidation && options.criteriaMode === 'all';\n\n // Parse values with Valibot schema\n const result = await safeParseAsync(\n schema,\n values,\n Object.assign({}, schemaOptions, {\n abortPipeEarly: !validateAllFieldCriteria,\n }),\n );\n\n // If there are issues, return them as errors\n if (result.issues) {\n // Create errors object\n const errors: Record = {};\n\n // Iterate over issues to add them to errors object\n for (; result.issues.length; ) {\n const issue = result.issues[0];\n // Create dot path from issue\n const path = getDotPath(issue);\n\n if (path) {\n // Add first error of path to errors object\n if (!errors[path]) {\n errors[path] = { message: issue.message, type: issue.type };\n }\n\n // If configured, add all errors of path to errors object\n if (validateAllFieldCriteria) {\n const types = errors[path].types;\n const messages = types && types[issue.type];\n errors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n errors,\n issue.type,\n messages\n ? ([] as string[]).concat(\n messages as string | string[],\n issue.message,\n )\n : issue.message,\n ) as FieldError;\n }\n }\n\n result.issues.shift();\n }\n\n // Return resolver result with errors\n return {\n values: {},\n errors: toNestErrors(errors, options),\n } as const;\n }\n\n // Otherwise, return resolver result with values\n return {\n values: resolverOptions.raw ? values : (result.output as FieldValues),\n errors: {},\n };\n };\n"],"names":["valibotResolver","schema","schemaOptions","resolverOptions","values","_","options","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","Promise","resolve","safeParseAsync","Object","assign","abortPipeEarly","then","result","issues","errors","length","issue","path","getDotPath","message","type","types","messages","appendErrors","concat","shift","toNestErrors","raw","output","e","reject"],"mappings":"2JAKa,IAAAA,EACX,SAACC,EAAQC,EAAeC,GACjBC,YADgC,IAAfD,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAO,IAEvB,IAAMC,GACHD,EAAQE,2BAAsD,QAAzBF,EAAQG,aAAuB,OAAAC,QAAAC,QAGlDC,EACnBX,EACAG,EACAS,OAAOC,OAAO,GAAIZ,EAAe,CAC/Ba,gBAAiBR,MAEpBS,KAAA,SANKC,GASN,GAAIA,EAAOC,OAAQ,CAKjB,IAHA,IAAMC,EAAqC,CAAA,EAGpCF,EAAOC,OAAOE,QAAU,CAC7B,IAAMC,EAAQJ,EAAOC,OAAO,GAEtBI,EAAOC,EAAWF,GAExB,GAAIC,IAEGH,EAAOG,KACVH,EAAOG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMI,OAInDlB,GAA0B,CAC5B,IAAMmB,EAAQP,EAAOG,GAAMI,MACrBC,EAAWD,GAASA,EAAML,EAAMI,MACtCN,EAAOG,GAAQM,EACbN,EACAf,EACAY,EACAE,EAAMI,KACNE,EACK,GAAgBE,OACfF,EACAN,EAAMG,SAERH,EAAMG,QAEd,CAGFP,EAAOC,OAAOY,OAChB,CAGA,MAAO,CACL1B,OAAQ,CAAA,EACRe,OAAQY,EAAaZ,EAAQb,GAEjC,CAGA,MAAO,CACLF,OAAQD,EAAgB6B,IAAM5B,EAAUa,EAAOgB,OAC/Cd,OAAQ,CAAA,EACR,EACJ,CAAC,MAAAe,GAAAxB,OAAAA,QAAAyB,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.umd.js b/node_modules/@hookform/resolvers/valibot/dist/valibot.umd.js deleted file mode 100644 index 126ab640886582d113f0468aa0d6e7c7e2194488..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers"),require("react-hook-form"),require("valibot")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form","valibot"],o):o((e||self).hookformResolversValibot={},e.hookformResolvers,e.ReactHookForm,e.valibot)}(this,function(e,o,r,s){e.valibotResolver=function(e,t,i){return void 0===i&&(i={}),function(a,n,f){try{var u=!f.shouldUseNativeValidation&&"all"===f.criteriaMode;return Promise.resolve(s.safeParseAsync(e,a,Object.assign({},t,{abortPipeEarly:!u}))).then(function(e){if(e.issues){for(var t={};e.issues.length;){var n=e.issues[0],l=s.getDotPath(n);if(l&&(t[l]||(t[l]={message:n.message,type:n.type}),u)){var c=t[l].types,v=c&&c[n.type];t[l]=r.appendErrors(l,u,t,n.type,v?[].concat(v,n.message):n.message)}e.issues.shift()}return{values:{},errors:o.toNestErrors(t,f)}}return{values:i.raw?a:e.output,errors:{}}})}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=valibot.umd.js.map diff --git a/node_modules/@hookform/resolvers/valibot/dist/valibot.umd.js.map b/node_modules/@hookform/resolvers/valibot/dist/valibot.umd.js.map deleted file mode 100644 index 2bd9cbffca0ddc2dfc844569e41d6bd4008e2c5d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/dist/valibot.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"valibot.umd.js","sources":["../src/valibot.ts"],"sourcesContent":["import { toNestErrors } from '@hookform/resolvers';\nimport { FieldError, FieldValues, appendErrors } from 'react-hook-form';\nimport { getDotPath, safeParseAsync } from 'valibot';\nimport type { Resolver } from './types';\n\nexport const valibotResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n // Check if we should validate all field criteria\n const validateAllFieldCriteria =\n !options.shouldUseNativeValidation && options.criteriaMode === 'all';\n\n // Parse values with Valibot schema\n const result = await safeParseAsync(\n schema,\n values,\n Object.assign({}, schemaOptions, {\n abortPipeEarly: !validateAllFieldCriteria,\n }),\n );\n\n // If there are issues, return them as errors\n if (result.issues) {\n // Create errors object\n const errors: Record = {};\n\n // Iterate over issues to add them to errors object\n for (; result.issues.length; ) {\n const issue = result.issues[0];\n // Create dot path from issue\n const path = getDotPath(issue);\n\n if (path) {\n // Add first error of path to errors object\n if (!errors[path]) {\n errors[path] = { message: issue.message, type: issue.type };\n }\n\n // If configured, add all errors of path to errors object\n if (validateAllFieldCriteria) {\n const types = errors[path].types;\n const messages = types && types[issue.type];\n errors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n errors,\n issue.type,\n messages\n ? ([] as string[]).concat(\n messages as string | string[],\n issue.message,\n )\n : issue.message,\n ) as FieldError;\n }\n }\n\n result.issues.shift();\n }\n\n // Return resolver result with errors\n return {\n values: {},\n errors: toNestErrors(errors, options),\n } as const;\n }\n\n // Otherwise, return resolver result with values\n return {\n values: resolverOptions.raw ? values : (result.output as FieldValues),\n errors: {},\n };\n };\n"],"names":["schema","schemaOptions","resolverOptions","values","_","options","validateAllFieldCriteria","shouldUseNativeValidation","criteriaMode","Promise","resolve","safeParseAsync","Object","assign","abortPipeEarly","then","result","issues","errors","length","issue","path","getDotPath","message","type","types","messages","appendErrors","concat","shift","toNestErrors","raw","output","e","reject"],"mappings":"ubAME,SAACA,EAAQC,EAAeC,GACjBC,YADgC,IAAfD,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAO,IAEvB,IAAMC,GACHD,EAAQE,2BAAsD,QAAzBF,EAAQG,aAAuB,OAAAC,QAAAC,QAGlDC,EAAcA,eACjCX,EACAG,EACAS,OAAOC,OAAO,GAAIZ,EAAe,CAC/Ba,gBAAiBR,MAEpBS,KAAA,SANKC,GASN,GAAIA,EAAOC,OAAQ,CAKjB,IAHA,IAAMC,EAAqC,CAAA,EAGpCF,EAAOC,OAAOE,QAAU,CAC7B,IAAMC,EAAQJ,EAAOC,OAAO,GAEtBI,EAAOC,EAAUA,WAACF,GAExB,GAAIC,IAEGH,EAAOG,KACVH,EAAOG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMI,OAInDlB,GAA0B,CAC5B,IAAMmB,EAAQP,EAAOG,GAAMI,MACrBC,EAAWD,GAASA,EAAML,EAAMI,MACtCN,EAAOG,GAAQM,eACbN,EACAf,EACAY,EACAE,EAAMI,KACNE,EACK,GAAgBE,OACfF,EACAN,EAAMG,SAERH,EAAMG,QAEd,CAGFP,EAAOC,OAAOY,OAChB,CAGA,MAAO,CACL1B,OAAQ,CAAA,EACRe,OAAQY,EAAAA,aAAaZ,EAAQb,GAEjC,CAGA,MAAO,CACLF,OAAQD,EAAgB6B,IAAM5B,EAAUa,EAAOgB,OAC/Cd,OAAQ,CAAA,EACR,EACJ,CAAC,MAAAe,GAAAxB,OAAAA,QAAAyB,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/valibot/package.json b/node_modules/@hookform/resolvers/valibot/package.json deleted file mode 100644 index 8c36ba42e651547cfc97801162d96b8630ff69e5..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/valibot", - "amdName": "hookformResolversValibot", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: valibot", - "main": "dist/valibot.js", - "module": "dist/valibot.module.js", - "umd:main": "dist/valibot.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "@hookform/resolvers": "^2.0.0", - "react-hook-form": "^7.0.0", - "valibot": "^1.0.0 || ^1.0.0-beta || ^1.0.0-rc" - } -} diff --git a/node_modules/@hookform/resolvers/valibot/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/valibot/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index cabf71e5e328477fab1088615ce6f88c33301d32..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as v from 'valibot'; -import { valibotResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is v.required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is v.required'; - -const schema = v.object({ - username: v.pipe( - v.string(USERNAME_REQUIRED_MESSAGE), - v.minLength(2, USERNAME_REQUIRED_MESSAGE), - ), - password: v.pipe( - v.string(PASSWORD_REQUIRED_MESSAGE), - v.minLength(2, PASSWORD_REQUIRED_MESSAGE), - ), -}); - -type FormData = { username: string; password: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: valibotResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Valibot", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/valibot/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/valibot/src/__tests__/Form.tsx deleted file mode 100644 index 34dcaaae20b58bc2ff4b4bbeb22cd903b0212e45..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/__tests__/Form.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as v from 'valibot'; -import { valibotResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = v.object({ - username: v.pipe( - v.string(USERNAME_REQUIRED_MESSAGE), - v.minLength(2, USERNAME_REQUIRED_MESSAGE), - ), - password: v.pipe( - v.string(PASSWORD_REQUIRED_MESSAGE), - v.minLength(2, PASSWORD_REQUIRED_MESSAGE), - ), -}); - -type FormData = { username: string; password: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: valibotResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Valibot and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/password field is required/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/valibot/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/valibot/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 7d99d6a493e1827fe91edac25ab4c804a2c9c036..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import * as v from 'valibot'; - -export const schema = v.object({ - username: v.pipe( - v.string(), - v.minLength(2), - v.maxLength(30), - v.regex(/^\w+$/), - ), - password: v.pipe( - v.string('New Password is required'), - v.regex(new RegExp('.*[A-Z].*'), 'One uppercase character'), - v.regex(new RegExp('.*[a-z].*'), 'One lowercase character'), - v.regex(new RegExp('.*\\d.*'), 'One number'), - v.regex( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ), - v.minLength(8, 'Must be at least 8 characters in length'), - ), - repeatPassword: v.string('Repeat Password is required'), - accessToken: v.union( - [ - v.string('Access token should be a string'), - v.number('Access token should be a number'), - ], - 'access token is required', - ), - birthYear: v.pipe( - v.number('Please enter your birth year'), - v.minValue(1900), - v.maxValue(2013), - ), - email: v.pipe(v.string(), v.email('Invalid email address')), - tags: v.array(v.string('Tags should be strings')), - enabled: v.boolean(), - like: v.object({ - id: v.number('Like id is required'), - name: v.pipe( - v.string('Like name is required'), - v.minLength(4, 'Too short'), - ), - }), -}); - -export const schemaError = v.variant('type', [ - v.object({ type: v.literal('a') }), - v.object({ type: v.literal('b') }), -]); - -export const validSchemaErrorData = { type: 'a' }; -export const invalidSchemaErrorData = { type: 'c' }; - -export const validData = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: { - id: 1, - name: 'name', - }, -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: { id: 'z' }, - tags: [1, 2, 3], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/valibot/src/__tests__/__snapshots__/valibot.ts.snap b/node_modules/@hookform/resolvers/valibot/src/__tests__/__snapshots__/valibot.ts.snap deleted file mode 100644 index 2de4b784cecc27d9470508435778966158a8ea4e..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/__tests__/__snapshots__/valibot.ts.snap +++ /dev/null @@ -1,418 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`valibotResolver > should return a single error from valibotResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "access token is required", - "ref": undefined, - "type": "union", - }, - "birthYear": { - "message": "Please enter your birth year", - "ref": undefined, - "type": "number", - }, - "email": { - "message": "Invalid email address", - "ref": { - "name": "email", - }, - "type": "email", - }, - "enabled": { - "message": "Invalid type: Expected boolean but received undefined", - "ref": undefined, - "type": "boolean", - }, - "like": { - "id": { - "message": "Like id is required", - "ref": undefined, - "type": "number", - }, - "name": { - "message": "Like name is required", - "ref": undefined, - "type": "string", - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "regex", - }, - "repeatPassword": { - "message": "Repeat Password is required", - "ref": undefined, - "type": "string", - }, - "tags": [ - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - }, - ], - "username": { - "message": "Invalid type: Expected string but received undefined", - "ref": { - "name": "username", - }, - "type": "string", - }, - }, - "values": {}, -} -`; - -exports[`valibotResolver > should return a single error from valibotResolver with \`mode: sync\` when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "access token is required", - "ref": undefined, - "type": "union", - }, - "birthYear": { - "message": "Please enter your birth year", - "ref": undefined, - "type": "number", - }, - "email": { - "message": "Invalid email address", - "ref": { - "name": "email", - }, - "type": "email", - }, - "enabled": { - "message": "Invalid type: Expected boolean but received undefined", - "ref": undefined, - "type": "boolean", - }, - "like": { - "id": { - "message": "Like id is required", - "ref": undefined, - "type": "number", - }, - "name": { - "message": "Like name is required", - "ref": undefined, - "type": "string", - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "regex", - }, - "repeatPassword": { - "message": "Repeat Password is required", - "ref": undefined, - "type": "string", - }, - "tags": [ - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - }, - ], - "username": { - "message": "Invalid type: Expected string but received undefined", - "ref": { - "name": "username", - }, - "type": "string", - }, - }, - "values": {}, -} -`; - -exports[`valibotResolver > should return all the errors from valibotResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "accessToken": { - "message": "access token is required", - "ref": undefined, - "type": "union", - "types": { - "union": "access token is required", - }, - }, - "birthYear": { - "message": "Please enter your birth year", - "ref": undefined, - "type": "number", - "types": { - "number": "Please enter your birth year", - }, - }, - "email": { - "message": "Invalid email address", - "ref": { - "name": "email", - }, - "type": "email", - "types": { - "email": "Invalid email address", - }, - }, - "enabled": { - "message": "Invalid type: Expected boolean but received undefined", - "ref": undefined, - "type": "boolean", - "types": { - "boolean": "Invalid type: Expected boolean but received undefined", - }, - }, - "like": { - "id": { - "message": "Like id is required", - "ref": undefined, - "type": "number", - "types": { - "number": "Like id is required", - }, - }, - "name": { - "message": "Like name is required", - "ref": undefined, - "type": "string", - "types": { - "string": "Like name is required", - }, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "regex", - "types": { - "min_length": "Must be at least 8 characters in length", - "regex": [ - "One uppercase character", - "One lowercase character", - "One number", - ], - }, - }, - "repeatPassword": { - "message": "Repeat Password is required", - "ref": undefined, - "type": "string", - "types": { - "string": "Repeat Password is required", - }, - }, - "tags": [ - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - "types": { - "string": "Tags should be strings", - }, - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - "types": { - "string": "Tags should be strings", - }, - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - "types": { - "string": "Tags should be strings", - }, - }, - ], - "username": { - "message": "Invalid type: Expected string but received undefined", - "ref": { - "name": "username", - }, - "type": "string", - "types": { - "string": "Invalid type: Expected string but received undefined", - }, - }, - }, - "values": {}, -} -`; - -exports[`valibotResolver > should return all the errors from valibotResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "accessToken": { - "message": "access token is required", - "ref": undefined, - "type": "union", - "types": { - "union": "access token is required", - }, - }, - "birthYear": { - "message": "Please enter your birth year", - "ref": undefined, - "type": "number", - "types": { - "number": "Please enter your birth year", - }, - }, - "email": { - "message": "Invalid email address", - "ref": { - "name": "email", - }, - "type": "email", - "types": { - "email": "Invalid email address", - }, - }, - "enabled": { - "message": "Invalid type: Expected boolean but received undefined", - "ref": undefined, - "type": "boolean", - "types": { - "boolean": "Invalid type: Expected boolean but received undefined", - }, - }, - "like": { - "id": { - "message": "Like id is required", - "ref": undefined, - "type": "number", - "types": { - "number": "Like id is required", - }, - }, - "name": { - "message": "Like name is required", - "ref": undefined, - "type": "string", - "types": { - "string": "Like name is required", - }, - }, - }, - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "regex", - "types": { - "min_length": "Must be at least 8 characters in length", - "regex": [ - "One uppercase character", - "One lowercase character", - "One number", - ], - }, - }, - "repeatPassword": { - "message": "Repeat Password is required", - "ref": undefined, - "type": "string", - "types": { - "string": "Repeat Password is required", - }, - }, - "tags": [ - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - "types": { - "string": "Tags should be strings", - }, - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - "types": { - "string": "Tags should be strings", - }, - }, - { - "message": "Tags should be strings", - "ref": undefined, - "type": "string", - "types": { - "string": "Tags should be strings", - }, - }, - ], - "username": { - "message": "Invalid type: Expected string but received undefined", - "ref": { - "name": "username", - }, - "type": "string", - "types": { - "string": "Invalid type: Expected string but received undefined", - }, - }, - }, - "values": {}, -} -`; - -exports[`valibotResolver > should return parsed values from valibotResolver with \`mode: sync\` when validation pass 1`] = ` -{ - "errors": {}, - "values": { - "accessToken": "accessToken", - "birthYear": 2000, - "email": "john@doe.com", - "enabled": true, - "like": { - "id": 1, - "name": "name", - }, - "password": "Password123_", - "repeatPassword": "Password123_", - "tags": [ - "tag1", - "tag2", - ], - "username": "Doe", - }, -} -`; diff --git a/node_modules/@hookform/resolvers/valibot/src/__tests__/valibot.ts b/node_modules/@hookform/resolvers/valibot/src/__tests__/valibot.ts deleted file mode 100644 index d91beb309e6a9b7c25ae1fbfcffed64ce68d12c0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/__tests__/valibot.ts +++ /dev/null @@ -1,141 +0,0 @@ -import * as valibot from 'valibot'; -/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */ -import { valibotResolver } from '..'; -import { - fields, - invalidData, - invalidSchemaErrorData, - schema, - schemaError, - validData, - validSchemaErrorData, -} from './__fixtures__/data'; - -const shouldUseNativeValidation = false; -describe('valibotResolver', () => { - it('should return parsed values from valibotResolver with `mode: sync` when validation pass', async () => { - vi.mock('valibot', async () => { - const a = await vi.importActual('valibot'); - return { - __esModule: true, - ...a, - }; - }); - const funcSpy = vi.spyOn(valibot, 'safeParseAsync'); - - const result = await valibotResolver(schema, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }); - - expect(funcSpy).toHaveBeenCalledTimes(1); - expect(result.errors).toEqual({}); - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from valibotResolver with `mode: sync` when validation fails', async () => { - vi.mock('valibot', async () => { - const a = await vi.importActual('valibot'); - return { - __esModule: true, - ...a, - }; - }); - const funcSpy = vi.spyOn(valibot, 'safeParseAsync'); - - const result = await valibotResolver(schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }); - - expect(funcSpy).toHaveBeenCalledTimes(1); - expect(result).toMatchSnapshot(); - }); - - it('should return values from valibotResolver when validation pass', async () => { - const result = await valibotResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from valibotResolver when validation fails', async () => { - const result = await valibotResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return values from valibotResolver when validation pass & raw=true', async () => { - const result = await valibotResolver(schema, undefined, { - raw: true, - })(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return all the errors from valibotResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await valibotResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from valibotResolver when validation fails with `validateAllFieldCriteria` set to true and `mode: sync`', async () => { - const result = await valibotResolver(schema, undefined, { mode: 'sync' })( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should be able to validate variants without errors', async () => { - const result = await valibotResolver(schemaError, undefined, { - mode: 'sync', - })(validSchemaErrorData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ - errors: {}, - values: { - type: 'a', - }, - }); - }); - - it('should be able to validate variants with errors', async () => { - const result = await valibotResolver(schemaError, undefined, { - mode: 'sync', - })(invalidSchemaErrorData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toEqual({ - errors: { - type: { - message: 'Invalid type: Expected "a" | "b" but received "c"', - ref: undefined, - type: 'variant', - }, - }, - values: {}, - }); - }); -}); diff --git a/node_modules/@hookform/resolvers/valibot/src/index.ts b/node_modules/@hookform/resolvers/valibot/src/index.ts deleted file mode 100644 index ce0aecaecbde987dd058c48d5baf1bf9dcaa0b8d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './valibot'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/valibot/src/types.ts b/node_modules/@hookform/resolvers/valibot/src/types.ts deleted file mode 100644 index be1442c7fd6adb732c7e6967aa2ab7b23b8a2cc2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/types.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { - BaseIssue, - BaseSchema, - BaseSchemaAsync, - Config, - InferIssue, -} from 'valibot'; - -export type Resolver = < - T extends - | BaseSchema> - | BaseSchemaAsync>, ->( - schema: T, - schemaOptions?: Partial< - Omit>, 'abortPipeEarly' | 'skipPipe'> - >, - resolverOptions?: { - /** - * @default async - */ - mode?: 'sync' | 'async'; - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; - }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/valibot/src/valibot.ts b/node_modules/@hookform/resolvers/valibot/src/valibot.ts deleted file mode 100644 index bcd9a4107d381b06dc90236cef8a3eb8796045a7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/valibot/src/valibot.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { toNestErrors } from '@hookform/resolvers'; -import { FieldError, FieldValues, appendErrors } from 'react-hook-form'; -import { getDotPath, safeParseAsync } from 'valibot'; -import type { Resolver } from './types'; - -export const valibotResolver: Resolver = - (schema, schemaOptions, resolverOptions = {}) => - async (values, _, options) => { - // Check if we should validate all field criteria - const validateAllFieldCriteria = - !options.shouldUseNativeValidation && options.criteriaMode === 'all'; - - // Parse values with Valibot schema - const result = await safeParseAsync( - schema, - values, - Object.assign({}, schemaOptions, { - abortPipeEarly: !validateAllFieldCriteria, - }), - ); - - // If there are issues, return them as errors - if (result.issues) { - // Create errors object - const errors: Record = {}; - - // Iterate over issues to add them to errors object - for (; result.issues.length; ) { - const issue = result.issues[0]; - // Create dot path from issue - const path = getDotPath(issue); - - if (path) { - // Add first error of path to errors object - if (!errors[path]) { - errors[path] = { message: issue.message, type: issue.type }; - } - - // If configured, add all errors of path to errors object - if (validateAllFieldCriteria) { - const types = errors[path].types; - const messages = types && types[issue.type]; - errors[path] = appendErrors( - path, - validateAllFieldCriteria, - errors, - issue.type, - messages - ? ([] as string[]).concat( - messages as string | string[], - issue.message, - ) - : issue.message, - ) as FieldError; - } - } - - result.issues.shift(); - } - - // Return resolver result with errors - return { - values: {}, - errors: toNestErrors(errors, options), - } as const; - } - - // Otherwise, return resolver result with values - return { - values: resolverOptions.raw ? values : (result.output as FieldValues), - errors: {}, - }; - }; diff --git a/node_modules/@hookform/resolvers/vest/dist/index.d.ts b/node_modules/@hookform/resolvers/vest/dist/index.d.ts deleted file mode 100644 index 1b98329cb6ad76ea2db3c34ea28fcfa5a7f52525..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './vest'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/vest/dist/types.d.ts b/node_modules/@hookform/resolvers/vest/dist/types.d.ts deleted file mode 100644 index 716fcab94c4a091f6fd76c3b2773cd6d927664f0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/types.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FieldName, FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import * as Vest from 'vest'; -export type ICreateResult = ReturnType[], context?: TContext) => void>>; -export type Resolver = (schema: ICreateResult, schemaOptions?: never, factoryOptions?: { - mode?: 'async' | 'sync'; - rawValues?: boolean; -}) => (values: TValues, context: TContext | undefined, options: ResolverOptions) => Promise>; -export type VestErrors = Record; diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.d.ts b/node_modules/@hookform/resolvers/vest/dist/vest.d.ts deleted file mode 100644 index 1befa6b2a2f1e2c5e31ed82cc9f6d544f8d9037c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const vestResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.js b/node_modules/@hookform/resolvers/vest/dist/vest.js deleted file mode 100644 index b9e54b37ebe45794050a6e61d2834e6521e4577f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=/*#__PURE__*/r(require("vest/promisify")),o=function(e,r){var t={};for(var o in e)t[o]||(t[o]={message:e[o][0],type:""}),r&&(t[o].types=e[o].reduce(function(e,r,t){return(e[t]=r)&&e},{}));return t};exports.vestResolver=function(r,s,i){return void 0===i&&(i={}),function(s,n,a){try{var u=function(r){return r.hasErrors()?{values:{},errors:e.toNestErrors(o(r.getErrors(),!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)}:(a.shouldUseNativeValidation&&e.validateFieldsNatively({},a),{values:s,errors:{}})};return Promise.resolve("sync"===i.mode?u(r(s,a.names,n)):Promise.resolve(t.default(r)(s,a.names,n)).then(u))}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=vest.js.map diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.js.map b/node_modules/@hookform/resolvers/vest/dist/vest.js.map deleted file mode 100644 index 2858341f8622920a44581fa038605558d88ee79b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vest.js","sources":["../src/vest.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\nimport promisify from 'vest/promisify';\nimport type { Resolver, VestErrors } from './types';\n\nconst parseErrorSchema = (\n vestError: VestErrors,\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (const path in vestError) {\n if (!errors[path]) {\n errors[path] = { message: vestError[path][0], type: '' };\n }\n\n if (validateAllFieldCriteria) {\n errors[path].types = vestError[path].reduce>(\n (acc, message, index) => (acc[index] = message) && acc,\n {},\n );\n }\n }\n return errors;\n};\n\nexport const vestResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, context, options) => {\n const result =\n resolverOptions.mode === 'sync'\n ? schema(values, options.names, context)\n : await promisify(schema)(values, options.names, context);\n\n if (result.hasErrors()) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.getErrors(),\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrorSchema","vestError","validateAllFieldCriteria","errors","path","message","type","types","reduce","acc","index","schema","_","resolverOptions","values","context","options","_temp2","result","hasErrors","toNestErrors","getErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","Promise","resolve","mode","names","promisify","then","e","reject"],"mappings":"6JAKMA,EAAmB,SACvBC,EACAC,GAEA,IAAMC,EAAqC,CAAE,EAC7C,IAAK,IAAMC,KAAQH,EACZE,EAAOC,KACVD,EAAOC,GAAQ,CAAEC,QAASJ,EAAUG,GAAM,GAAIE,KAAM,KAGlDJ,IACFC,EAAOC,GAAMG,MAAQN,EAAUG,GAAMI,OACnC,SAACC,EAAKJ,EAASK,GAAU,OAACD,EAAIC,GAASL,IAAYI,CAAG,EACtD,CAAE,IAIR,OAAON,CACT,uBAGE,SAACQ,EAAQC,EAAGC,GACLC,YADKD,IAAAA,IAAAA,EAAkB,CAAE,GACzBC,SAAAA,EAAQC,EAASC,GAAW,IAAA,IAAAC,EAAA,SAC3BC,GAKN,OAAIA,EAAOC,YACF,CACLL,OAAQ,CAAE,EACVX,OAAQiB,EAAYA,aAClBpB,EACEkB,EAAOG,aACNL,EAAQM,2BACkB,QAAzBN,EAAQO,cAEZP,KAKNA,EAAQM,2BAA6BE,EAAAA,uBAAuB,CAAA,EAAIR,GAEzD,CAAEF,OAAAA,EAAQX,OAAQ,CAAA,GAAK,EApBG,OAAAsB,QAAAC,QAAN,SAAzBb,EAAgBc,KAAeV,EAC3BN,EAAOG,EAAQE,EAAQY,MAAOb,IAAQU,QAAAC,QAChCG,EAAS,QAAClB,EAAVkB,CAAkBf,EAAQE,EAAQY,MAAOb,IAAQe,KAAAb,GAmB/D,CAAC,MAAAc,GAAAN,OAAAA,QAAAO,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.mjs b/node_modules/@hookform/resolvers/vest/dist/vest.mjs deleted file mode 100644 index 0cf282061a0ddcfdd1209312c98e2955fa5b2e17..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import o from"vest/promisify";var t=function(r,e){var o={};for(var t in r)o[t]||(o[t]={message:r[t][0],type:""}),e&&(o[t].types=r[t].reduce(function(r,e,o){return(r[o]=e)&&r},{}));return o},s=function(s,n,i){return void 0===i&&(i={}),function(n,a,u){try{var m=function(o){return o.hasErrors()?{values:{},errors:r(t(o.getErrors(),!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)}:(u.shouldUseNativeValidation&&e({},u),{values:n,errors:{}})};return Promise.resolve("sync"===i.mode?m(s(n,u.names,a)):Promise.resolve(o(s)(n,u.names,a)).then(m))}catch(r){return Promise.reject(r)}}};export{s as vestResolver}; -//# sourceMappingURL=vest.module.js.map diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.modern.mjs b/node_modules/@hookform/resolvers/vest/dist/vest.modern.mjs deleted file mode 100644 index 5d40a3ef949276ed744a7f0fa02774bc133777ee..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import s from"vest/promisify";const o=(r,e)=>{const s={};for(const o in r)s[o]||(s[o]={message:r[o][0],type:""}),e&&(s[o].types=r[o].reduce((r,e,s)=>(r[s]=e)&&r,{}));return s},t=(t,a,i={})=>async(a,n,m)=>{const l="sync"===i.mode?t(a,m.names,n):await s(t)(a,m.names,n);return l.hasErrors()?{values:{},errors:r(o(l.getErrors(),!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)}:(m.shouldUseNativeValidation&&e({},m),{values:a,errors:{}})};export{t as vestResolver}; -//# sourceMappingURL=vest.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.modern.mjs.map b/node_modules/@hookform/resolvers/vest/dist/vest.modern.mjs.map deleted file mode 100644 index 3c955770667bd4961314069ba0af82828a7cd230..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vest.modern.mjs","sources":["../src/vest.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\nimport promisify from 'vest/promisify';\nimport type { Resolver, VestErrors } from './types';\n\nconst parseErrorSchema = (\n vestError: VestErrors,\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (const path in vestError) {\n if (!errors[path]) {\n errors[path] = { message: vestError[path][0], type: '' };\n }\n\n if (validateAllFieldCriteria) {\n errors[path].types = vestError[path].reduce>(\n (acc, message, index) => (acc[index] = message) && acc,\n {},\n );\n }\n }\n return errors;\n};\n\nexport const vestResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, context, options) => {\n const result =\n resolverOptions.mode === 'sync'\n ? schema(values, options.names, context)\n : await promisify(schema)(values, options.names, context);\n\n if (result.hasErrors()) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.getErrors(),\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrorSchema","vestError","validateAllFieldCriteria","errors","path","message","type","types","reduce","acc","index","vestResolver","schema","_","resolverOptions","async","values","context","options","result","mode","names","promisify","hasErrors","toNestErrors","getErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively"],"mappings":"6GAKA,MAAMA,EAAmBA,CACvBC,EACAC,KAEA,MAAMC,EAAqC,GAC3C,IAAK,MAAMC,KAAQH,EACZE,EAAOC,KACVD,EAAOC,GAAQ,CAAEC,QAASJ,EAAUG,GAAM,GAAIE,KAAM,KAGlDJ,IACFC,EAAOC,GAAMG,MAAQN,EAAUG,GAAMI,OACnC,CAACC,EAAKJ,EAASK,KAAWD,EAAIC,GAASL,IAAYI,EACnD,CAAA,IAIN,OAAON,GAGIQ,EACXA,CAACC,EAAQC,EAAGC,EAAkB,KAC9BC,MAAOC,EAAQC,EAASC,KACtB,MAAMC,EACqB,SAAzBL,EAAgBM,KACZR,EAAOI,EAAQE,EAAQG,MAAOJ,SACxBK,EAAUV,EAAVU,CAAkBN,EAAQE,EAAQG,MAAOJ,GAErD,OAAIE,EAAOI,YACF,CACLP,OAAQ,CAAE,EACVb,OAAQqB,EACNxB,EACEmB,EAAOM,aACNP,EAAQQ,2BACkB,QAAzBR,EAAQS,cAEZT,KAKNA,EAAQQ,2BAA6BE,EAAuB,GAAIV,GAEzD,CAAEF,SAAQb,OAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.module.js b/node_modules/@hookform/resolvers/vest/dist/vest.module.js deleted file mode 100644 index 0cf282061a0ddcfdd1209312c98e2955fa5b2e17..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import o from"vest/promisify";var t=function(r,e){var o={};for(var t in r)o[t]||(o[t]={message:r[t][0],type:""}),e&&(o[t].types=r[t].reduce(function(r,e,o){return(r[o]=e)&&r},{}));return o},s=function(s,n,i){return void 0===i&&(i={}),function(n,a,u){try{var m=function(o){return o.hasErrors()?{values:{},errors:r(t(o.getErrors(),!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)}:(u.shouldUseNativeValidation&&e({},u),{values:n,errors:{}})};return Promise.resolve("sync"===i.mode?m(s(n,u.names,a)):Promise.resolve(o(s)(n,u.names,a)).then(m))}catch(r){return Promise.reject(r)}}};export{s as vestResolver}; -//# sourceMappingURL=vest.module.js.map diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.module.js.map b/node_modules/@hookform/resolvers/vest/dist/vest.module.js.map deleted file mode 100644 index e6a0d0375486f156a10c5cc29fec7fbfd2611018..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vest.module.js","sources":["../src/vest.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\nimport promisify from 'vest/promisify';\nimport type { Resolver, VestErrors } from './types';\n\nconst parseErrorSchema = (\n vestError: VestErrors,\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (const path in vestError) {\n if (!errors[path]) {\n errors[path] = { message: vestError[path][0], type: '' };\n }\n\n if (validateAllFieldCriteria) {\n errors[path].types = vestError[path].reduce>(\n (acc, message, index) => (acc[index] = message) && acc,\n {},\n );\n }\n }\n return errors;\n};\n\nexport const vestResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, context, options) => {\n const result =\n resolverOptions.mode === 'sync'\n ? schema(values, options.names, context)\n : await promisify(schema)(values, options.names, context);\n\n if (result.hasErrors()) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.getErrors(),\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrorSchema","vestError","validateAllFieldCriteria","errors","path","message","type","types","reduce","acc","index","vestResolver","schema","_","resolverOptions","values","context","options","_temp2","result","hasErrors","toNestErrors","getErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","Promise","resolve","mode","names","promisify","then","e","reject"],"mappings":"6GAKA,IAAMA,EAAmB,SACvBC,EACAC,GAEA,IAAMC,EAAqC,CAAE,EAC7C,IAAK,IAAMC,KAAQH,EACZE,EAAOC,KACVD,EAAOC,GAAQ,CAAEC,QAASJ,EAAUG,GAAM,GAAIE,KAAM,KAGlDJ,IACFC,EAAOC,GAAMG,MAAQN,EAAUG,GAAMI,OACnC,SAACC,EAAKJ,EAASK,GAAU,OAACD,EAAIC,GAASL,IAAYI,CAAG,EACtD,CAAE,IAIR,OAAON,CACT,EAEaQ,EACX,SAACC,EAAQC,EAAGC,GACLC,YADKD,IAAAA,IAAAA,EAAkB,CAAE,GACzBC,SAAAA,EAAQC,EAASC,GAAW,IAAA,IAAAC,EAAA,SAC3BC,GAKN,OAAIA,EAAOC,YACF,CACLL,OAAQ,CAAE,EACVZ,OAAQkB,EACNrB,EACEmB,EAAOG,aACNL,EAAQM,2BACkB,QAAzBN,EAAQO,cAEZP,KAKNA,EAAQM,2BAA6BE,EAAuB,CAAA,EAAIR,GAEzD,CAAEF,OAAAA,EAAQZ,OAAQ,CAAA,GAAK,EApBG,OAAAuB,QAAAC,QAAN,SAAzBb,EAAgBc,KAAeV,EAC3BN,EAAOG,EAAQE,EAAQY,MAAOb,IAAQU,QAAAC,QAChCG,EAAUlB,EAAVkB,CAAkBf,EAAQE,EAAQY,MAAOb,IAAQe,KAAAb,GAmB/D,CAAC,MAAAc,GAAAN,OAAAA,QAAAO,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.umd.js b/node_modules/@hookform/resolvers/vest/dist/vest.umd.js deleted file mode 100644 index 0d2ea2165eae4c8b4cf0e0a5faa5cf182153427b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("vest/promisify")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","vest/promisify"],r):r((e||self).hookformResolversVest={},e.hookformResolvers,e.promisify)}(this,function(e,r,o){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/t(o),i=function(e,r){var o={};for(var t in e)o[t]||(o[t]={message:e[t][0],type:""}),r&&(o[t].types=e[t].reduce(function(e,r,o){return(e[o]=r)&&e},{}));return o};e.vestResolver=function(e,o,t){return void 0===t&&(t={}),function(o,n,f){try{var u=function(e){return e.hasErrors()?{values:{},errors:r.toNestErrors(i(e.getErrors(),!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)}:(f.shouldUseNativeValidation&&r.validateFieldsNatively({},f),{values:o,errors:{}})};return Promise.resolve("sync"===t.mode?u(e(o,f.names,n)):Promise.resolve(s.default(e)(o,f.names,n)).then(u))}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=vest.umd.js.map diff --git a/node_modules/@hookform/resolvers/vest/dist/vest.umd.js.map b/node_modules/@hookform/resolvers/vest/dist/vest.umd.js.map deleted file mode 100644 index 4bb2b096147acdc523391a0f2f18d2595dccb287..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/dist/vest.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vest.umd.js","sources":["../src/vest.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError } from 'react-hook-form';\nimport promisify from 'vest/promisify';\nimport type { Resolver, VestErrors } from './types';\n\nconst parseErrorSchema = (\n vestError: VestErrors,\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (const path in vestError) {\n if (!errors[path]) {\n errors[path] = { message: vestError[path][0], type: '' };\n }\n\n if (validateAllFieldCriteria) {\n errors[path].types = vestError[path].reduce>(\n (acc, message, index) => (acc[index] = message) && acc,\n {},\n );\n }\n }\n return errors;\n};\n\nexport const vestResolver: Resolver =\n (schema, _, resolverOptions = {}) =>\n async (values, context, options) => {\n const result =\n resolverOptions.mode === 'sync'\n ? schema(values, options.names, context)\n : await promisify(schema)(values, options.names, context);\n\n if (result.hasErrors()) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n result.getErrors(),\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return { values, errors: {} };\n };\n"],"names":["parseErrorSchema","vestError","validateAllFieldCriteria","errors","path","message","type","types","reduce","acc","index","schema","_","resolverOptions","values","context","options","_temp2","result","hasErrors","toNestErrors","getErrors","shouldUseNativeValidation","criteriaMode","validateFieldsNatively","Promise","resolve","mode","names","promisify","then","e","reject"],"mappings":"mdAKMA,EAAmB,SACvBC,EACAC,GAEA,IAAMC,EAAqC,CAAE,EAC7C,IAAK,IAAMC,KAAQH,EACZE,EAAOC,KACVD,EAAOC,GAAQ,CAAEC,QAASJ,EAAUG,GAAM,GAAIE,KAAM,KAGlDJ,IACFC,EAAOC,GAAMG,MAAQN,EAAUG,GAAMI,OACnC,SAACC,EAAKJ,EAASK,GAAU,OAACD,EAAIC,GAASL,IAAYI,CAAG,EACtD,CAAE,IAIR,OAAON,CACT,iBAGE,SAACQ,EAAQC,EAAGC,GACLC,YADKD,IAAAA,IAAAA,EAAkB,CAAE,GACzBC,SAAAA,EAAQC,EAASC,GAAW,IAAA,IAAAC,EAAA,SAC3BC,GAKN,OAAIA,EAAOC,YACF,CACLL,OAAQ,CAAE,EACVX,OAAQiB,EAAYA,aAClBpB,EACEkB,EAAOG,aACNL,EAAQM,2BACkB,QAAzBN,EAAQO,cAEZP,KAKNA,EAAQM,2BAA6BE,EAAAA,uBAAuB,CAAA,EAAIR,GAEzD,CAAEF,OAAAA,EAAQX,OAAQ,CAAA,GAAK,EApBG,OAAAsB,QAAAC,QAAN,SAAzBb,EAAgBc,KAAeV,EAC3BN,EAAOG,EAAQE,EAAQY,MAAOb,IAAQU,QAAAC,QAChCG,EAAS,QAAClB,EAAVkB,CAAkBf,EAAQE,EAAQY,MAAOb,IAAQe,KAAAb,GAmB/D,CAAC,MAAAc,GAAAN,OAAAA,QAAAO,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vest/package.json b/node_modules/@hookform/resolvers/vest/package.json deleted file mode 100644 index 40fbc31e6b14f7cb323831a23b2134c46988d11c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/vest", - "amdName": "hookformResolversVest", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: vest", - "main": "dist/vest.js", - "module": "dist/vest.module.js", - "umd:main": "dist/vest.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "vest": ">=3.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/vest/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/vest/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index d00b6ba9f24da41d06b2c289dc6e0740d665f598..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as vest from 'vest'; -import { vestResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_SYMBOL_MESSAGE = 'password must contain a symbol'; - -interface FormData { - username: string; - password: string; -} - -const validationSuite = vest.create('form', (data: FormData) => { - vest.test('username', USERNAME_REQUIRED_MESSAGE, () => { - vest.enforce(data.username).isNotEmpty(); - }); - - vest.test('password', PASSWORD_SYMBOL_MESSAGE, () => { - vest.enforce(data.password).isNotEmpty(); - }); -}); - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: vestResolver(validationSuite), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Vest", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_SYMBOL_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/vest/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/vest/src/__tests__/Form.tsx deleted file mode 100644 index 44372e01c2aff82feea6f59635938712d305fd34..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/__tests__/Form.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as vest from 'vest'; -import { vestResolver } from '..'; - -interface FormData { - username: string; - password: string; -} - -const validationSuite = vest.create('form', (data: FormData) => { - vest.test('username', 'Username is required', () => { - vest.enforce(data.username).isNotEmpty(); - }); - - vest.test('password', 'Password must contain a symbol', () => { - vest.enforce(data.password).matches(/[^A-Za-z0-9]/); - }); -}); - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: vestResolver(validationSuite), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Vest and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/Username is required/i)).toBeVisible(); - expect(screen.getByText(/Password must contain a symbol/i)).toBeVisible(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/vest/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/vest/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index c0e3f686918a6d37968717150cae3ef2664c6a44..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import * as vest from 'vest'; - -export const validationSuite = vest.create('form', (data: any = {}) => { - vest.test('username', 'Username is required', () => { - vest.enforce(data.username).isNotEmpty(); - }); - - vest.test('username', 'Must be longer than 3 chars', () => { - vest.enforce(data.username).longerThan(3); - }); - - vest.test('deepObject.data', 'deepObject.data is required', () => { - vest.enforce(data.deepObject.data).isNotEmpty(); - }); - - vest.test('password', 'Password is required', () => { - vest.enforce(data.password).isNotEmpty(); - }); - - vest.test('password', 'Password must be at least 5 chars', () => { - vest.enforce(data.password).longerThanOrEquals(5); - }); - - vest.test('password', 'Password must contain a digit', () => { - vest.enforce(data.password).matches(/[0-9]/); - }); - - vest.test('password', 'Password must contain a symbol', () => { - vest.enforce(data.password).matches(/[^A-Za-z0-9]/); - }); -}); - -export const validData = { - username: 'asdda', - password: 'asddfg123!', - deepObject: { - data: 'test', - }, -}; - -export const invalidData = { - username: '', - password: 'a', - deepObject: { - data: '', - }, -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/vest/src/__tests__/__snapshots__/vest.ts.snap b/node_modules/@hookform/resolvers/vest/src/__tests__/__snapshots__/vest.ts.snap deleted file mode 100644 index 110992ffb7896a30d25cd2e21f7000428f9cbc56..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/__tests__/__snapshots__/vest.ts.snap +++ /dev/null @@ -1,135 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`vestResolver > should return all the error messages from vestResolver when validation fails and validateAllFieldCriteria set to true 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "deepObject.data is required", - "ref": undefined, - "type": "", - "types": { - "0": "deepObject.data is required", - }, - }, - }, - "password": { - "message": "Password must be at least 5 chars", - "ref": { - "name": "password", - }, - "type": "", - "types": { - "0": "Password must be at least 5 chars", - }, - }, - "username": { - "message": "Username is required", - "ref": { - "name": "username", - }, - "type": "", - "types": { - "0": "Username is required", - }, - }, - }, - "values": {}, -} -`; - -exports[`vestResolver > should return all the error messages from vestResolver when validation fails and validateAllFieldCriteria set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "deepObject.data is required", - "ref": undefined, - "type": "", - "types": { - "0": "deepObject.data is required", - }, - }, - }, - "password": { - "message": "Password must be at least 5 chars", - "ref": { - "name": "password", - }, - "type": "", - "types": { - "0": "Password must be at least 5 chars", - }, - }, - "username": { - "message": "Username is required", - "ref": { - "name": "username", - }, - "type": "", - "types": { - "0": "Username is required", - }, - }, - }, - "values": {}, -} -`; - -exports[`vestResolver > should return single error message from vestResolver when validation fails and validateAllFieldCriteria set to false 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "deepObject.data is required", - "ref": undefined, - "type": "", - }, - }, - "password": { - "message": "Password must be at least 5 chars", - "ref": { - "name": "password", - }, - "type": "", - }, - "username": { - "message": "Username is required", - "ref": { - "name": "username", - }, - "type": "", - }, - }, - "values": {}, -} -`; - -exports[`vestResolver > should return single error message from vestResolver when validation fails and validateAllFieldCriteria set to false and \`mode: sync\` 1`] = ` -{ - "errors": { - "deepObject": { - "data": { - "message": "deepObject.data is required", - "ref": undefined, - "type": "", - }, - }, - "password": { - "message": "Password must be at least 5 chars", - "ref": { - "name": "password", - }, - "type": "", - }, - "username": { - "message": "Username is required", - "ref": { - "name": "username", - }, - "type": "", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/vest/src/__tests__/vest.ts b/node_modules/@hookform/resolvers/vest/src/__tests__/vest.ts deleted file mode 100644 index 36cbcfeab8d3e90b84da75a8ea0afcf109b096ed..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/__tests__/vest.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { vestResolver } from '..'; -import { - fields, - invalidData, - validData, - validationSuite, -} from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('vestResolver', () => { - it('should return values from vestResolver when validation pass', async () => { - expect( - await vestResolver(validationSuite)(validData, undefined, { - fields, - shouldUseNativeValidation, - }), - ).toEqual({ - values: validData, - errors: {}, - }); - }); - - it('should return values from vestResolver with `mode: sync` when validation pass', async () => { - expect( - await vestResolver(validationSuite, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }), - ).toEqual({ - values: validData, - errors: {}, - }); - }); - - it('should return single error message from vestResolver when validation fails and validateAllFieldCriteria set to false', async () => { - expect( - await vestResolver(validationSuite)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }), - ).toMatchSnapshot(); - }); - - it('should return single error message from vestResolver when validation fails and validateAllFieldCriteria set to false and `mode: sync`', async () => { - expect( - await vestResolver(validationSuite, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from vestResolver when validation fails and validateAllFieldCriteria set to true', async () => { - expect( - await vestResolver(validationSuite)( - invalidData, - {}, - { fields, criteriaMode: 'all', shouldUseNativeValidation }, - ), - ).toMatchSnapshot(); - }); - - it('should return all the error messages from vestResolver when validation fails and validateAllFieldCriteria set to true and `mode: sync`', async () => { - expect( - await vestResolver(validationSuite, undefined, { mode: 'sync' })( - invalidData, - {}, - { fields, criteriaMode: 'all', shouldUseNativeValidation }, - ), - ).toMatchSnapshot(); - }); - - it('should call a suite with values, validated field names and a context as arguments', async () => { - const suite = vi.fn(validationSuite) as any as typeof validationSuite; - - await vestResolver(suite)( - validData, - { some: 'context' }, - { - fields: { username: fields.username }, - names: ['username'], - shouldUseNativeValidation, - }, - ); - - expect(suite).toHaveBeenCalledTimes(1); - expect(suite).toHaveBeenCalledWith(validData, ['username'], { - some: 'context', - }); - }); -}); diff --git a/node_modules/@hookform/resolvers/vest/src/index.ts b/node_modules/@hookform/resolvers/vest/src/index.ts deleted file mode 100644 index 1b98329cb6ad76ea2db3c34ea28fcfa5a7f52525..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './vest'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/vest/src/types.ts b/node_modules/@hookform/resolvers/vest/src/types.ts deleted file mode 100644 index 91084bac1670e9185dc3ed2a80dd3920d375b071..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - FieldName, - FieldValues, - ResolverOptions, - ResolverResult, -} from 'react-hook-form'; -import * as Vest from 'vest'; - -export type ICreateResult< - TValues extends FieldValues = FieldValues, - TContext = any, -> = ReturnType< - typeof Vest.create< - any, - any, - (values: TValues, names?: FieldName[], context?: TContext) => void - > ->; - -export type Resolver = ( - schema: ICreateResult, - schemaOptions?: never, - factoryOptions?: { mode?: 'async' | 'sync'; rawValues?: boolean }, -) => ( - values: TValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; - -export type VestErrors = Record; diff --git a/node_modules/@hookform/resolvers/vest/src/vest.ts b/node_modules/@hookform/resolvers/vest/src/vest.ts deleted file mode 100644 index 58e64a437847fc58dad23d65caae51f41d631b74..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vest/src/vest.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { FieldError } from 'react-hook-form'; -import promisify from 'vest/promisify'; -import type { Resolver, VestErrors } from './types'; - -const parseErrorSchema = ( - vestError: VestErrors, - validateAllFieldCriteria: boolean, -) => { - const errors: Record = {}; - for (const path in vestError) { - if (!errors[path]) { - errors[path] = { message: vestError[path][0], type: '' }; - } - - if (validateAllFieldCriteria) { - errors[path].types = vestError[path].reduce>( - (acc, message, index) => (acc[index] = message) && acc, - {}, - ); - } - } - return errors; -}; - -export const vestResolver: Resolver = - (schema, _, resolverOptions = {}) => - async (values, context, options) => { - const result = - resolverOptions.mode === 'sync' - ? schema(values, options.names, context) - : await promisify(schema)(values, options.names, context); - - if (result.hasErrors()) { - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - result.getErrors(), - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - } - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { values, errors: {} }; - }; diff --git a/node_modules/@hookform/resolvers/vine/dist/index.d.ts b/node_modules/@hookform/resolvers/vine/dist/index.d.ts deleted file mode 100644 index 6266c98eb87b1a2007c918d390d9bd3ee0caee21..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './vine'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/vine/dist/types.d.ts b/node_modules/@hookform/resolvers/vine/dist/types.d.ts deleted file mode 100644 index 98f59971939821b681174c01e1f2b5fae0dde077..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { VineValidator } from '@vinejs/vine'; -import { ValidationOptions } from '@vinejs/vine/build/src/types'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -export type Resolver = >(schema: T, schemaOptions?: ValidationOptions, resolverOptions?: { - raw?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.d.ts b/node_modules/@hookform/resolvers/vine/dist/vine.d.ts deleted file mode 100644 index c0ee6ee0e2c63d002bc0b9cf62bc8e3cceb4e0d9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const vineResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.js b/node_modules/@hookform/resolvers/vine/dist/vine.js deleted file mode 100644 index d2139e90ffdd14adea8795e809bd2f55aaa6d6ae..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),r=require("@vinejs/vine"),t=require("react-hook-form"),o=function(e,r){for(var o={};e.length;){var s=e[0],i=s.field;if(i in o||(o[i]={message:s.message,type:s.rule}),r){var n=o[i].types,a=n&&n[s.rule];o[i]=t.appendErrors(i,r,o,s.rule,a?[].concat(a,[s.message]):s.message)}e.shift()}return o};exports.vineResolver=function(t,s,i){return void 0===i&&(i={}),function(n,a,u){try{return Promise.resolve(function(r,o){try{var a=Promise.resolve(t.validate(n,s)).then(function(r){return u.shouldUseNativeValidation&&e.validateFieldsNatively({},u),{errors:{},values:i.raw?n:r}})}catch(e){return o(e)}return a&&a.then?a.then(void 0,o):a}(0,function(t){if(t instanceof r.errors.E_VALIDATION_ERROR)return{values:{},errors:e.toNestErrors(o(t.messages,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw t}))}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=vine.js.map diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.js.map b/node_modules/@hookform/resolvers/vine/dist/vine.js.map deleted file mode 100644 index d765849932f72adec56054d60effe9ae225d83f1..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vine.js","sources":["../src/vine.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { SimpleErrorReporter, errors } from '@vinejs/vine';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n vineErrors: SimpleErrorReporter['errors'],\n validateAllFieldCriteria: boolean,\n) => {\n const schemaErrors: Record = {};\n\n for (; vineErrors.length; ) {\n const error = vineErrors[0];\n const path = error.field;\n\n if (!(path in schemaErrors)) {\n schemaErrors[path] = { message: error.message, type: error.rule };\n }\n\n if (validateAllFieldCriteria) {\n const { types } = schemaErrors[path];\n const messages = types && types[error.rule];\n\n schemaErrors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n schemaErrors,\n error.rule,\n messages ? [...(messages as string[]), error.message] : error.message,\n ) as FieldError;\n }\n\n vineErrors.shift();\n }\n\n return schemaErrors;\n};\n\nexport const vineResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema.validate(values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (error instanceof errors.E_VALIDATION_ERROR) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.messages,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","vineErrors","validateAllFieldCriteria","schemaErrors","length","error","path","field","message","type","rule","types","messages","appendErrors","concat","shift","schema","schemaOptions","resolverOptions","values","_","options","Promise","resolve","validate","then","data","shouldUseNativeValidation","validateFieldsNatively","errors","raw","_catch","E_VALIDATION_ERROR","toNestErrors","criteriaMode","e","reject"],"mappings":"4FAKMA,EAAmB,SACvBC,EACAC,GAIA,IAFA,IAAMC,EAA2C,CAAA,EAE1CF,EAAWG,QAAU,CAC1B,IAAMC,EAAQJ,EAAW,GACnBK,EAAOD,EAAME,MAMnB,GAJMD,KAAQH,IACZA,EAAaG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMK,OAGzDR,EAA0B,CAC5B,IAAQS,EAAUR,EAAaG,GAAvBK,MACFC,EAAWD,GAASA,EAAMN,EAAMK,MAEtCP,EAAaG,GAAQO,eACnBP,EACAJ,EACAC,EACAE,EAAMK,KACNE,EAAQ,GAAAE,OAAQF,EAAuBP,CAAAA,EAAMG,UAAWH,EAAMG,QAElE,CAEAP,EAAWc,OACb,CAEA,OAAOZ,CACT,uBAGE,SAACa,EAAQC,EAAeC,GACjBC,YADiBD,IAAAA,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACvBD,QAAAC,QACiBP,EAAOQ,SAASL,EAAQF,IAAcQ,KAAnDC,SAAAA,GAIN,OAFAL,EAAQM,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEP,GAEzD,CACLQ,OAAQ,GACRV,OAAQD,EAAgBY,IAAMX,EAASO,EACvC,4DATuBK,GAU1B,SAAQ1B,GACP,GAAIA,aAAiBwB,EAAMA,OAACG,mBAC1B,MAAO,CACLb,OAAQ,CAAA,EACRU,OAAQI,EAAYA,aAClBjC,EACEK,EAAMO,UACLS,EAAQM,2BACkB,QAAzBN,EAAQa,cAEZb,IAKN,MAAMhB,CACR,GACF,CAAC,MAAA8B,GAAA,OAAAb,QAAAc,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.mjs b/node_modules/@hookform/resolvers/vine/dist/vine.mjs deleted file mode 100644 index bb211e76f76075e1b5babc8b0c39566fa1b9d485..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as r}from"@hookform/resolvers";import{errors as t}from"@vinejs/vine";import{appendErrors as o}from"react-hook-form";var n=function(e,r){for(var t={};e.length;){var n=e[0],i=n.field;if(i in t||(t[i]={message:n.message,type:n.rule}),r){var s=t[i].types,a=s&&s[n.rule];t[i]=o(i,r,t,n.rule,a?[].concat(a,[n.message]):n.message)}e.shift()}return t},i=function(o,i,s){return void 0===s&&(s={}),function(a,u,f){try{return Promise.resolve(function(r,t){try{var n=Promise.resolve(o.validate(a,i)).then(function(r){return f.shouldUseNativeValidation&&e({},f),{errors:{},values:s.raw?a:r}})}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(0,function(e){if(e instanceof t.E_VALIDATION_ERROR)return{values:{},errors:r(n(e.messages,!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)};throw e}))}catch(e){return Promise.reject(e)}}};export{i as vineResolver}; -//# sourceMappingURL=vine.module.js.map diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.modern.mjs b/node_modules/@hookform/resolvers/vine/dist/vine.modern.mjs deleted file mode 100644 index 021fb867b3e248a8ba383253a37ff56e8fa1ecb0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as r}from"@hookform/resolvers";import{errors as s}from"@vinejs/vine";import{appendErrors as o}from"react-hook-form";const t=(e,r)=>{const s={};for(;e.length;){const t=e[0],a=t.field;if(a in s||(s[a]={message:t.message,type:t.rule}),r){const{types:e}=s[a],i=e&&e[t.rule];s[a]=o(a,r,s,t.rule,i?[...i,t.message]:t.message)}e.shift()}return s},a=(o,a,i={})=>async(n,l,m)=>{try{const r=await o.validate(n,a);return m.shouldUseNativeValidation&&e({},m),{errors:{},values:i.raw?n:r}}catch(e){if(e instanceof s.E_VALIDATION_ERROR)return{values:{},errors:r(t(e.messages,!m.shouldUseNativeValidation&&"all"===m.criteriaMode),m)};throw e}};export{a as vineResolver}; -//# sourceMappingURL=vine.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.modern.mjs.map b/node_modules/@hookform/resolvers/vine/dist/vine.modern.mjs.map deleted file mode 100644 index 7f2bef28fe8521e355e7320b2453a3fc3a9696bb..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vine.modern.mjs","sources":["../src/vine.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { SimpleErrorReporter, errors } from '@vinejs/vine';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n vineErrors: SimpleErrorReporter['errors'],\n validateAllFieldCriteria: boolean,\n) => {\n const schemaErrors: Record = {};\n\n for (; vineErrors.length; ) {\n const error = vineErrors[0];\n const path = error.field;\n\n if (!(path in schemaErrors)) {\n schemaErrors[path] = { message: error.message, type: error.rule };\n }\n\n if (validateAllFieldCriteria) {\n const { types } = schemaErrors[path];\n const messages = types && types[error.rule];\n\n schemaErrors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n schemaErrors,\n error.rule,\n messages ? [...(messages as string[]), error.message] : error.message,\n ) as FieldError;\n }\n\n vineErrors.shift();\n }\n\n return schemaErrors;\n};\n\nexport const vineResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema.validate(values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (error instanceof errors.E_VALIDATION_ERROR) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.messages,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","vineErrors","validateAllFieldCriteria","schemaErrors","length","error","path","field","message","type","rule","types","messages","appendErrors","shift","vineResolver","schema","schemaOptions","resolverOptions","async","values","_","options","data","validate","shouldUseNativeValidation","validateFieldsNatively","errors","raw","E_VALIDATION_ERROR","toNestErrors","criteriaMode"],"mappings":"oKAKA,MAAMA,EAAmBA,CACvBC,EACAC,KAEA,MAAMC,EAA2C,CAAE,EAEnD,KAAOF,EAAWG,QAAU,CAC1B,MAAMC,EAAQJ,EAAW,GACnBK,EAAOD,EAAME,MAMnB,GAJMD,KAAQH,IACZA,EAAaG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMK,OAGzDR,EAA0B,CAC5B,MAAMS,MAAEA,GAAUR,EAAaG,GACzBM,EAAWD,GAASA,EAAMN,EAAMK,MAEtCP,EAAaG,GAAQO,EACnBP,EACAJ,EACAC,EACAE,EAAMK,KACNE,EAAW,IAAKA,EAAuBP,EAAMG,SAAWH,EAAMG,QAElE,CAEAP,EAAWa,OACb,CAEA,OAAOX,GAGIY,EACXA,CAACC,EAAQC,EAAeC,EAAkB,CAAE,IAC5CC,MAAOC,EAAQC,EAAGC,KAChB,IACE,MAAMC,QAAaP,EAAOQ,SAASJ,EAAQH,GAI3C,OAFAK,EAAQG,2BAA6BC,EAAuB,CAAA,EAAIJ,GAEzD,CACLK,OAAQ,GACRP,OAAQF,EAAgBU,IAAMR,EAASG,EAE3C,CAAE,MAAOlB,GACP,GAAIA,aAAiBsB,EAAOE,mBAC1B,MAAO,CACLT,OAAQ,CAAA,EACRO,OAAQG,EACN9B,EACEK,EAAMO,UACLU,EAAQG,2BACkB,QAAzBH,EAAQS,cAEZT,IAKN,MAAMjB,CACR"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.module.js b/node_modules/@hookform/resolvers/vine/dist/vine.module.js deleted file mode 100644 index bb211e76f76075e1b5babc8b0c39566fa1b9d485..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as r}from"@hookform/resolvers";import{errors as t}from"@vinejs/vine";import{appendErrors as o}from"react-hook-form";var n=function(e,r){for(var t={};e.length;){var n=e[0],i=n.field;if(i in t||(t[i]={message:n.message,type:n.rule}),r){var s=t[i].types,a=s&&s[n.rule];t[i]=o(i,r,t,n.rule,a?[].concat(a,[n.message]):n.message)}e.shift()}return t},i=function(o,i,s){return void 0===s&&(s={}),function(a,u,f){try{return Promise.resolve(function(r,t){try{var n=Promise.resolve(o.validate(a,i)).then(function(r){return f.shouldUseNativeValidation&&e({},f),{errors:{},values:s.raw?a:r}})}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(0,function(e){if(e instanceof t.E_VALIDATION_ERROR)return{values:{},errors:r(n(e.messages,!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)};throw e}))}catch(e){return Promise.reject(e)}}};export{i as vineResolver}; -//# sourceMappingURL=vine.module.js.map diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.module.js.map b/node_modules/@hookform/resolvers/vine/dist/vine.module.js.map deleted file mode 100644 index 3f13c03c7260d6e9d5099c82bc64e6e81ab1f43a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vine.module.js","sources":["../src/vine.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { SimpleErrorReporter, errors } from '@vinejs/vine';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n vineErrors: SimpleErrorReporter['errors'],\n validateAllFieldCriteria: boolean,\n) => {\n const schemaErrors: Record = {};\n\n for (; vineErrors.length; ) {\n const error = vineErrors[0];\n const path = error.field;\n\n if (!(path in schemaErrors)) {\n schemaErrors[path] = { message: error.message, type: error.rule };\n }\n\n if (validateAllFieldCriteria) {\n const { types } = schemaErrors[path];\n const messages = types && types[error.rule];\n\n schemaErrors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n schemaErrors,\n error.rule,\n messages ? [...(messages as string[]), error.message] : error.message,\n ) as FieldError;\n }\n\n vineErrors.shift();\n }\n\n return schemaErrors;\n};\n\nexport const vineResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema.validate(values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (error instanceof errors.E_VALIDATION_ERROR) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.messages,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","vineErrors","validateAllFieldCriteria","schemaErrors","length","error","path","field","message","type","rule","types","messages","appendErrors","concat","shift","vineResolver","schema","schemaOptions","resolverOptions","values","_","options","Promise","resolve","validate","then","data","shouldUseNativeValidation","validateFieldsNatively","errors","raw","_catch","E_VALIDATION_ERROR","toNestErrors","criteriaMode","e","reject"],"mappings":"oKAKA,IAAMA,EAAmB,SACvBC,EACAC,GAIA,IAFA,IAAMC,EAA2C,CAAA,EAE1CF,EAAWG,QAAU,CAC1B,IAAMC,EAAQJ,EAAW,GACnBK,EAAOD,EAAME,MAMnB,GAJMD,KAAQH,IACZA,EAAaG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMK,OAGzDR,EAA0B,CAC5B,IAAQS,EAAUR,EAAaG,GAAvBK,MACFC,EAAWD,GAASA,EAAMN,EAAMK,MAEtCP,EAAaG,GAAQO,EACnBP,EACAJ,EACAC,EACAE,EAAMK,KACNE,EAAQ,GAAAE,OAAQF,EAAuBP,CAAAA,EAAMG,UAAWH,EAAMG,QAElE,CAEAP,EAAWc,OACb,CAEA,OAAOZ,CACT,EAEaa,EACX,SAACC,EAAQC,EAAeC,GACjBC,YADiBD,IAAAA,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACvBD,QAAAC,QACiBP,EAAOQ,SAASL,EAAQF,IAAcQ,KAAnDC,SAAAA,GAIN,OAFAL,EAAQM,2BAA6BC,EAAuB,CAAE,EAAEP,GAEzD,CACLQ,OAAQ,GACRV,OAAQD,EAAgBY,IAAMX,EAASO,EACvC,4DATuBK,GAU1B,SAAQ3B,GACP,GAAIA,aAAiByB,EAAOG,mBAC1B,MAAO,CACLb,OAAQ,CAAA,EACRU,OAAQI,EACNlC,EACEK,EAAMO,UACLU,EAAQM,2BACkB,QAAzBN,EAAQa,cAEZb,IAKN,MAAMjB,CACR,GACF,CAAC,MAAA+B,GAAA,OAAAb,QAAAc,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.umd.js b/node_modules/@hookform/resolvers/vine/dist/vine.umd.js deleted file mode 100644 index ced8ca9eed753ff8f4b7bfe01b48e1d76078b847..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@hookform/resolvers"),require("@vinejs/vine"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","@vinejs/vine","react-hook-form"],r):r((e||self).hookformResolversVine={},e.hookformResolvers,e.vine,e.ReactHookForm)}(this,function(e,r,o,t){var n=function(e,r){for(var o={};e.length;){var n=e[0],i=n.field;if(i in o||(o[i]={message:n.message,type:n.rule}),r){var s=o[i].types,a=s&&s[n.rule];o[i]=t.appendErrors(i,r,o,n.rule,a?[].concat(a,[n.message]):n.message)}e.shift()}return o};e.vineResolver=function(e,t,i){return void 0===i&&(i={}),function(s,a,f){try{return Promise.resolve(function(o,n){try{var a=Promise.resolve(e.validate(s,t)).then(function(e){return f.shouldUseNativeValidation&&r.validateFieldsNatively({},f),{errors:{},values:i.raw?s:e}})}catch(e){return n(e)}return a&&a.then?a.then(void 0,n):a}(0,function(e){if(e instanceof o.errors.E_VALIDATION_ERROR)return{values:{},errors:r.toNestErrors(n(e.messages,!f.shouldUseNativeValidation&&"all"===f.criteriaMode),f)};throw e}))}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=vine.umd.js.map diff --git a/node_modules/@hookform/resolvers/vine/dist/vine.umd.js.map b/node_modules/@hookform/resolvers/vine/dist/vine.umd.js.map deleted file mode 100644 index 653240e45174cb91a1bbc12730670be4d1a108ab..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/dist/vine.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vine.umd.js","sources":["../src/vine.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { SimpleErrorReporter, errors } from '@vinejs/vine';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport type { Resolver } from './types';\n\nconst parseErrorSchema = (\n vineErrors: SimpleErrorReporter['errors'],\n validateAllFieldCriteria: boolean,\n) => {\n const schemaErrors: Record = {};\n\n for (; vineErrors.length; ) {\n const error = vineErrors[0];\n const path = error.field;\n\n if (!(path in schemaErrors)) {\n schemaErrors[path] = { message: error.message, type: error.rule };\n }\n\n if (validateAllFieldCriteria) {\n const { types } = schemaErrors[path];\n const messages = types && types[error.rule];\n\n schemaErrors[path] = appendErrors(\n path,\n validateAllFieldCriteria,\n schemaErrors,\n error.rule,\n messages ? [...(messages as string[]), error.message] : error.message,\n ) as FieldError;\n }\n\n vineErrors.shift();\n }\n\n return schemaErrors;\n};\n\nexport const vineResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema.validate(values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (error instanceof errors.E_VALIDATION_ERROR) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.messages,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","vineErrors","validateAllFieldCriteria","schemaErrors","length","error","path","field","message","type","rule","types","messages","appendErrors","concat","shift","schema","schemaOptions","resolverOptions","values","_","options","Promise","resolve","validate","then","data","shouldUseNativeValidation","validateFieldsNatively","errors","raw","_catch","E_VALIDATION_ERROR","toNestErrors","criteriaMode","e","reject"],"mappings":"yaAKA,IAAMA,EAAmB,SACvBC,EACAC,GAIA,IAFA,IAAMC,EAA2C,CAAA,EAE1CF,EAAWG,QAAU,CAC1B,IAAMC,EAAQJ,EAAW,GACnBK,EAAOD,EAAME,MAMnB,GAJMD,KAAQH,IACZA,EAAaG,GAAQ,CAAEE,QAASH,EAAMG,QAASC,KAAMJ,EAAMK,OAGzDR,EAA0B,CAC5B,IAAQS,EAAUR,EAAaG,GAAvBK,MACFC,EAAWD,GAASA,EAAMN,EAAMK,MAEtCP,EAAaG,GAAQO,eACnBP,EACAJ,EACAC,EACAE,EAAMK,KACNE,EAAQ,GAAAE,OAAQF,EAAuBP,CAAAA,EAAMG,UAAWH,EAAMG,QAElE,CAEAP,EAAWc,OACb,CAEA,OAAOZ,CACT,iBAGE,SAACa,EAAQC,EAAeC,GACjBC,YADiBD,IAAAA,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACvBD,QAAAC,QACiBP,EAAOQ,SAASL,EAAQF,IAAcQ,KAAnDC,SAAAA,GAIN,OAFAL,EAAQM,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEP,GAEzD,CACLQ,OAAQ,GACRV,OAAQD,EAAgBY,IAAMX,EAASO,EACvC,4DATuBK,GAU1B,SAAQ1B,GACP,GAAIA,aAAiBwB,EAAMA,OAACG,mBAC1B,MAAO,CACLb,OAAQ,CAAA,EACRU,OAAQI,EAAYA,aAClBjC,EACEK,EAAMO,UACLS,EAAQM,2BACkB,QAAzBN,EAAQa,cAEZb,IAKN,MAAMhB,CACR,GACF,CAAC,MAAA8B,GAAA,OAAAb,QAAAc,OAAAD,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/vine/package.json b/node_modules/@hookform/resolvers/vine/package.json deleted file mode 100644 index 473737df0981835b2ca75a901fcdb0ce9bb9baef..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@hookform/resolvers/vine", - "amdName": "hookformResolversVine", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: vine", - "main": "dist/vine.js", - "module": "dist/vine.module.js", - "umd:main": "dist/vine.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0", - "@vinejs/vine": "^2.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/vine/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/vine/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 999ce7354ba2804025065074a74fae119c3c7d7f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import vine from '@vinejs/vine'; -import { Infer } from '@vinejs/vine/build/src/types'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { vineResolver } from '..'; - -const schema = vine.compile( - vine.object({ - username: vine.string().minLength(1), - password: vine.string().minLength(1), - }), -); - -type FormData = Infer & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: vineResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Zod", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe( - 'The username field must have at least 1 characters', - ); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe( - 'The password field must have at least 1 characters', - ); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/vine/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/vine/src/__tests__/Form.tsx deleted file mode 100644 index de664beba420a5810094df0630d7ae3d628a8561..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/__tests__/Form.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import vine from '@vinejs/vine'; -import { Infer } from '@vinejs/vine/build/src/types'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { vineResolver } from '..'; - -const schema = vine.compile( - vine.object({ - username: vine.string().minLength(1), - password: vine.string().minLength(1), - }), -); - -type FormData = Infer & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: vineResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Vine and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect( - screen.getByText(/The username field must have at least 1 characters/i), - ).toBeInTheDocument(); - expect( - screen.getByText(/The password field must have at least 1 characters/i), - ).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/vine/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/vine/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index f40785744d8ab538b46d8e29a9bfab80cc864afe..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,76 +0,0 @@ -import vine from '@vinejs/vine'; -import { Infer } from '@vinejs/vine/build/src/types'; -import { Field, InternalFieldName } from 'react-hook-form'; - -export const schema = vine.compile( - vine.object({ - username: vine.string().regex(/^\w+$/).minLength(3).maxLength(30), - password: vine - .string() - .regex(new RegExp('.*[A-Z].*')) - .regex(new RegExp('.*[a-z].*')) - .regex(new RegExp('.*\\d.*')) - .regex(new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*')) - .minLength(8) - .confirmed({ confirmationField: 'repeatPassword' }), - repeatPassword: vine.string().sameAs('password'), - accessToken: vine.unionOfTypes([vine.string(), vine.number()]), - birthYear: vine.number().min(1900).max(2013), - email: vine.string().email().optional(), - tags: vine.array(vine.string()), - enabled: vine.boolean(), - like: vine.array( - vine.object({ - id: vine.number(), - name: vine.string().fixedLength(4), - }), - ), - dateStr: vine - .string() - .transform((value: string) => new Date(value).toISOString()), - }), -); - -export const validData: Infer = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: [ - { - id: 1, - name: 'name', - }, - ], - dateStr: '2020-01-01T00:00:00.000Z', -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/vine/src/__tests__/__snapshots__/vine.ts.snap b/node_modules/@hookform/resolvers/vine/src/__tests__/__snapshots__/vine.ts.snap deleted file mode 100644 index b139736b1c1eebfe161397c6073b5b989fcf6b62..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/__tests__/__snapshots__/vine.ts.snap +++ /dev/null @@ -1,180 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`vineResolver > should return a single error from vineResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Invalid value provided for accessToken field", - "ref": undefined, - "type": "unionOfTypes", - }, - "birthYear": { - "message": "The birthYear field must be a number", - "ref": undefined, - "type": "number", - }, - "dateStr": { - "message": "The dateStr field must be defined", - "ref": undefined, - "type": "required", - }, - "email": { - "message": "The email field must be a valid email address", - "ref": { - "name": "email", - }, - "type": "email", - }, - "enabled": { - "message": "The enabled field must be defined", - "ref": undefined, - "type": "required", - }, - "like": [ - { - "id": { - "message": "The id field must be a number", - "ref": undefined, - "type": "number", - }, - "name": { - "message": "The name field must be defined", - "ref": undefined, - "type": "required", - }, - }, - ], - "password": { - "message": "The password field format is invalid", - "ref": { - "name": "password", - }, - "type": "regex", - }, - "repeatPassword": { - "message": "The repeatPassword field must be defined", - "ref": undefined, - "type": "required", - }, - "tags": { - "message": "The tags field must be defined", - "ref": undefined, - "type": "required", - }, - "username": { - "message": "The username field must be defined", - "ref": { - "name": "username", - }, - "type": "required", - }, - }, - "values": {}, -} -`; - -exports[`vineResolver > should return all the errors from vineResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Invalid value provided for accessToken field", - "ref": undefined, - "type": "unionOfTypes", - "types": { - "unionOfTypes": "Invalid value provided for accessToken field", - }, - }, - "birthYear": { - "message": "The birthYear field must be a number", - "ref": undefined, - "type": "number", - "types": { - "number": "The birthYear field must be a number", - }, - }, - "dateStr": { - "message": "The dateStr field must be defined", - "ref": undefined, - "type": "required", - "types": { - "required": "The dateStr field must be defined", - }, - }, - "email": { - "message": "The email field must be a valid email address", - "ref": { - "name": "email", - }, - "type": "email", - "types": { - "email": "The email field must be a valid email address", - }, - }, - "enabled": { - "message": "The enabled field must be defined", - "ref": undefined, - "type": "required", - "types": { - "required": "The enabled field must be defined", - }, - }, - "like": [ - { - "id": { - "message": "The id field must be a number", - "ref": undefined, - "type": "number", - "types": { - "number": "The id field must be a number", - }, - }, - "name": { - "message": "The name field must be defined", - "ref": undefined, - "type": "required", - "types": { - "required": "The name field must be defined", - }, - }, - }, - ], - "password": { - "message": "The password field format is invalid", - "ref": { - "name": "password", - }, - "type": "regex", - "types": { - "regex": "The password field format is invalid", - }, - }, - "repeatPassword": { - "message": "The repeatPassword field must be defined", - "ref": undefined, - "type": "required", - "types": { - "required": "The repeatPassword field must be defined", - }, - }, - "tags": { - "message": "The tags field must be defined", - "ref": undefined, - "type": "required", - "types": { - "required": "The tags field must be defined", - }, - }, - "username": { - "message": "The username field must be defined", - "ref": { - "name": "username", - }, - "type": "required", - "types": { - "required": "The username field must be defined", - }, - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/vine/src/__tests__/vine.ts b/node_modules/@hookform/resolvers/vine/src/__tests__/vine.ts deleted file mode 100644 index f1f35433f713d7370bf562bc1b472714e9be332a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/__tests__/vine.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { vineResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('vineResolver', () => { - it('should return values from vineResolver when validation pass', async () => { - const schemaSpy = vi.spyOn(schema, 'validate'); - - const result = await vineResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from vineResolver when validation fails', async () => { - const result = await vineResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from vineResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await vineResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return values from vineResolver when validation pass & raw=true', async () => { - const schemaSpy = vi.spyOn(schema, 'validate'); - - const result = await vineResolver(schema, undefined, { raw: true })( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); -}); diff --git a/node_modules/@hookform/resolvers/vine/src/index.ts b/node_modules/@hookform/resolvers/vine/src/index.ts deleted file mode 100644 index 6266c98eb87b1a2007c918d390d9bd3ee0caee21..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './vine'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/vine/src/types.ts b/node_modules/@hookform/resolvers/vine/src/types.ts deleted file mode 100644 index 59ed349d8a8d519056cf69ac11ae7853f63934b5..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { VineValidator } from '@vinejs/vine'; -import { ValidationOptions } from '@vinejs/vine/build/src/types'; -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; - -export type Resolver = >( - schema: T, - schemaOptions?: ValidationOptions, - resolverOptions?: { raw?: boolean }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/vine/src/vine.ts b/node_modules/@hookform/resolvers/vine/src/vine.ts deleted file mode 100644 index b59f4feb213eebb7152a5d48dfbeb4b5033b23c7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/vine/src/vine.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { SimpleErrorReporter, errors } from '@vinejs/vine'; -import { FieldError, FieldErrors, appendErrors } from 'react-hook-form'; -import type { Resolver } from './types'; - -const parseErrorSchema = ( - vineErrors: SimpleErrorReporter['errors'], - validateAllFieldCriteria: boolean, -) => { - const schemaErrors: Record = {}; - - for (; vineErrors.length; ) { - const error = vineErrors[0]; - const path = error.field; - - if (!(path in schemaErrors)) { - schemaErrors[path] = { message: error.message, type: error.rule }; - } - - if (validateAllFieldCriteria) { - const { types } = schemaErrors[path]; - const messages = types && types[error.rule]; - - schemaErrors[path] = appendErrors( - path, - validateAllFieldCriteria, - schemaErrors, - error.rule, - messages ? [...(messages as string[]), error.message] : error.message, - ) as FieldError; - } - - vineErrors.shift(); - } - - return schemaErrors; -}; - -export const vineResolver: Resolver = - (schema, schemaOptions, resolverOptions = {}) => - async (values, _, options) => { - try { - const data = await schema.validate(values, schemaOptions); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - errors: {} as FieldErrors, - values: resolverOptions.raw ? values : data, - }; - } catch (error: any) { - if (error instanceof errors.E_VALIDATION_ERROR) { - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - error.messages, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - } - - throw error; - } - }; diff --git a/node_modules/@hookform/resolvers/yup/dist/index.d.ts b/node_modules/@hookform/resolvers/yup/dist/index.d.ts deleted file mode 100644 index 13c89e6eb059648677c90cb9e787079bb2038828..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './yup'; diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.d.ts b/node_modules/@hookform/resolvers/yup/dist/yup.d.ts deleted file mode 100644 index 41d52f7a5d805d47f1b7446d39a10be4124306e9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FieldValues, Resolver } from 'react-hook-form'; -import * as Yup from 'yup'; -export declare function yupResolver(schema: Yup.ObjectSchema | ReturnType>>, schemaOptions?: Parameters<(typeof schema)['validate']>[1], resolverOptions?: { - /** - * @default async - */ - mode?: 'async' | 'sync'; - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; -}): Resolver>; diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.js b/node_modules/@hookform/resolvers/yup/dist/yup.js deleted file mode 100644 index 75eeccef1e3d667d9df0542dfa9b00b98b0f3bac..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=require("@hookform/resolvers"),t=require("react-hook-form");exports.yupResolver=function(r,o,n){return void 0===o&&(o={}),void 0===n&&(n={}),function(s,a,i){try{return Promise.resolve(function(t,u){try{var c=(o.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(r["sync"===n.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},o,{context:a}))).then(function(t){return i.shouldUseNativeValidation&&e.validateFieldsNatively({},i),{values:n.raw?s:t,errors:{}}}))}catch(e){return u(e)}return c&&c.then?c.then(void 0,u):c}(0,function(r){if(!r.inner)throw r;return{values:{},errors:e.toNestErrors((o=r,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(o.inner||[]).reduce(function(e,r){if(e[r.path]||(e[r.path]={message:r.message,type:r.type}),n){var o=e[r.path].types,s=o&&o[r.type];e[r.path]=t.appendErrors(r.path,n,e,r.type,s?[].concat(s,r.message):r.message)}return e},{})),i)};var o,n}))}catch(e){return Promise.reject(e)}}}; -//# sourceMappingURL=yup.js.map diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.js.map b/node_modules/@hookform/resolvers/yup/dist/yup.js.map deleted file mode 100644 index 4c8dc0fa251df084b3a6b0577f184b741dee37b1..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"yup.js","sources":["../src/yup.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nconst parseErrorSchema = (\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) => {\n return (error.inner || []).reduce>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n};\n\nexport function yupResolver(\n schema:\n | Yup.ObjectSchema\n | ReturnType>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n /**\n * @default async\n */\n mode?: 'async' | 'sync';\n /**\n * Return the raw input values rather than the parsed values.\n * @default false\n */\n raw?: boolean;\n } = {},\n): Resolver> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n"],"names":["schema","schemaOptions","resolverOptions","values","context","options","Promise","resolve","process","env","NODE_ENV","console","warn","mode","Object","assign","abortEarly","then","result","shouldUseNativeValidation","validateFieldsNatively","raw","errors","_catch","e","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","reject"],"mappings":"sFA4CgB,SACdA,EAGAC,EACAC,GAYA,YAbAD,IAAAA,IAAAA,EAA4D,CAAE,QAC9DC,IAAAA,IAAAA,EAUI,IAEUC,SAAAA,EAAQC,EAASC,GAAW,IAAA,OAAAC,QAAAC,iCAElCN,EAAcG,SAAoC,gBAAzBI,QAAQC,IAAIC,UAEvCC,QAAQC,KACN,iGAEHN,QAAAC,QAEoBP,EACM,SAAzBE,EAAgBW,KAAkB,eAAiB,YAEnDV,EACAW,OAAOC,OAAO,CAAEC,YAAY,GAASf,EAAe,CAAEG,QAAAA,MACvDa,cALKC,GASN,OAFAb,EAAQc,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEf,GAEzD,CACLF,OAAQD,EAAgBmB,IAAMlB,EAASe,EACvCI,OAAQ,CAAA,EACR,6DArBoCC,CAAA,WAsB/BC,GACP,IAAKA,EAAEC,MACL,MAAMD,EAGR,MAAO,CACLrB,OAAQ,CAAE,EACVmB,OAAQI,EAAAA,cA5EdC,EA8EUH,EA7EVI,GA8EWvB,EAAQc,2BACkB,QAAzBd,EAAQwB,cA7EZF,EAAMF,OAAS,IAAIK,OACzB,SAACC,EAAUJ,GAKT,GAJKI,EAASJ,EAAMK,QAClBD,EAASJ,EAAMK,MAAS,CAAEC,QAASN,EAAMM,QAASC,KAAMP,EAAMO,OAG5DN,EAA0B,CAC5B,IAAMO,EAAQJ,EAASJ,EAAMK,MAAOG,MAC9BC,EAAWD,GAASA,EAAMR,EAAMO,MAEtCH,EAASJ,EAAMK,MAASK,EAAAA,aACtBV,EAAMK,KACNJ,EACAG,EACAJ,EAAMO,KACNE,EACK,GAAgBE,OAAOF,EAAsBT,EAAMM,SACpDN,EAAMM,QAEd,CAEA,OAAOF,CACT,EACA,KAwDM1B,IAnFe,IACvBsB,EACAC,CAoFE,GACF,CAAC,MAAAJ,GAAA,OAAAlB,QAAAiC,OAAAf,EACH,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.mjs b/node_modules/@hookform/resolvers/yup/dist/yup.mjs deleted file mode 100644 index 57ab20aa53d5088360d4b43444864670dcb12a5a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as t}from"@hookform/resolvers";import{appendErrors as r}from"react-hook-form";function o(o,n,a){return void 0===n&&(n={}),void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(n.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(o["sync"===a.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?s:t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},{})),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver}; -//# sourceMappingURL=yup.module.js.map diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.modern.mjs b/node_modules/@hookform/resolvers/yup/dist/yup.modern.mjs deleted file mode 100644 index 5c6c1167e2f17458dfe433ab0182f71562350a21..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as t}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";function r(r,a={},s={}){return async(n,c,i)=>{try{a.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead");const t=await r["sync"===s.mode?"validateSync":"validate"](n,Object.assign({abortEarly:!1},a,{context:c}));return i.shouldUseNativeValidation&&e({},i),{values:s.raw?n:t,errors:{}}}catch(e){if(!e.inner)throw e;return{values:{},errors:t((p=e,l=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(p.inner||[]).reduce((e,t)=>{if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),l){const r=e[t.path].types,a=r&&r[t.type];e[t.path]=o(t.path,l,e,t.type,a?[].concat(a,t.message):t.message)}return e},{})),i)}}var p,l}}export{r as yupResolver}; -//# sourceMappingURL=yup.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.modern.mjs.map b/node_modules/@hookform/resolvers/yup/dist/yup.modern.mjs.map deleted file mode 100644 index 13cfb83a21c15db77adbd7c37006e527223d80d7..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"yup.modern.mjs","sources":["../src/yup.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nconst parseErrorSchema = (\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) => {\n return (error.inner || []).reduce>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n};\n\nexport function yupResolver(\n schema:\n | Yup.ObjectSchema\n | ReturnType>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n /**\n * @default async\n */\n mode?: 'async' | 'sync';\n /**\n * Return the raw input values rather than the parsed values.\n * @default false\n */\n raw?: boolean;\n } = {},\n): Resolver> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n"],"names":["yupResolver","schema","schemaOptions","resolverOptions","async","values","context","options","process","env","NODE_ENV","console","warn","result","mode","Object","assign","abortEarly","shouldUseNativeValidation","validateFieldsNatively","raw","errors","e","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","parseErrorSchema"],"mappings":"uIA4CgBA,EACdC,EAGAC,EAA4D,CAAE,EAC9DC,EAUI,CAAA,GAEJ,OAAOC,MAAOC,EAAQC,EAASC,KAC7B,IACML,EAAcI,SAAoC,gBAAzBE,QAAQC,IAAIC,UAEvCC,QAAQC,KACN,iGAIJ,MAAMC,QAAeZ,EACM,SAAzBE,EAAgBW,KAAkB,eAAiB,YAEnDT,EACAU,OAAOC,OAAO,CAAEC,YAAY,GAASf,EAAe,CAAEI,aAKxD,OAFAC,EAAQW,2BAA6BC,EAAuB,CAAA,EAAIZ,GAEzD,CACLF,OAAQF,EAAgBiB,IAAMf,EAASQ,EACvCQ,OAAQ,GAEZ,CAAE,MAAOC,GACP,IAAKA,EAAEC,MACL,MAAMD,EAGR,MAAO,CACLjB,OAAQ,CAAE,EACVgB,OAAQG,GA5EdC,EA8EUH,EA7EVI,GA8EWnB,EAAQW,2BACkB,QAAzBX,EAAQoB,cA7EZF,EAAMF,OAAS,IAAIK,OACzB,CAACC,EAAUJ,KAKT,GAJKI,EAASJ,EAAMK,QAClBD,EAASJ,EAAMK,MAAS,CAAEC,QAASN,EAAMM,QAASC,KAAMP,EAAMO,OAG5DN,EAA0B,CAC5B,MAAMO,EAAQJ,EAASJ,EAAMK,MAAOG,MAC9BC,EAAWD,GAASA,EAAMR,EAAMO,MAEtCH,EAASJ,EAAMK,MAASK,EACtBV,EAAMK,KACNJ,EACAG,EACAJ,EAAMO,KACNE,EACK,GAAgBE,OAAOF,EAAsBT,EAAMM,SACpDN,EAAMM,QAEd,CAEA,OAAOF,GAET,CAAE,IAwDItB,GAGN,CAtFqB8B,IACvBZ,EACAC,CAoFE,CAEJ"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.module.js b/node_modules/@hookform/resolvers/yup/dist/yup.module.js deleted file mode 100644 index 57ab20aa53d5088360d4b43444864670dcb12a5a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as e,toNestErrors as t}from"@hookform/resolvers";import{appendErrors as r}from"react-hook-form";function o(o,n,a){return void 0===n&&(n={}),void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(n.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(o["sync"===a.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?s:t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},{})),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver}; -//# sourceMappingURL=yup.module.js.map diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.module.js.map b/node_modules/@hookform/resolvers/yup/dist/yup.module.js.map deleted file mode 100644 index d63304c79ebbbe6a9426d84c465d0f0f618c6035..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"yup.module.js","sources":["../src/yup.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nconst parseErrorSchema = (\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) => {\n return (error.inner || []).reduce>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n};\n\nexport function yupResolver(\n schema:\n | Yup.ObjectSchema\n | ReturnType>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n /**\n * @default async\n */\n mode?: 'async' | 'sync';\n /**\n * Return the raw input values rather than the parsed values.\n * @default false\n */\n raw?: boolean;\n } = {},\n): Resolver> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n"],"names":["yupResolver","schema","schemaOptions","resolverOptions","values","context","options","Promise","resolve","process","env","NODE_ENV","console","warn","mode","Object","assign","abortEarly","then","result","shouldUseNativeValidation","validateFieldsNatively","raw","errors","_catch","e","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","reject"],"mappings":"8HA4CgB,SAAAA,EACdC,EAGAC,EACAC,GAYA,YAbAD,IAAAA,IAAAA,EAA4D,CAAE,QAC9DC,IAAAA,IAAAA,EAUI,IAEUC,SAAAA,EAAQC,EAASC,GAAW,IAAA,OAAAC,QAAAC,iCAElCN,EAAcG,SAAoC,gBAAzBI,QAAQC,IAAIC,UAEvCC,QAAQC,KACN,iGAEHN,QAAAC,QAEoBP,EACM,SAAzBE,EAAgBW,KAAkB,eAAiB,YAEnDV,EACAW,OAAOC,OAAO,CAAEC,YAAY,GAASf,EAAe,CAAEG,QAAAA,MACvDa,cALKC,GASN,OAFAb,EAAQc,2BAA6BC,EAAuB,CAAE,EAAEf,GAEzD,CACLF,OAAQD,EAAgBmB,IAAMlB,EAASe,EACvCI,OAAQ,CAAA,EACR,6DArBoCC,CAAA,WAsB/BC,GACP,IAAKA,EAAEC,MACL,MAAMD,EAGR,MAAO,CACLrB,OAAQ,CAAE,EACVmB,OAAQI,GA5EdC,EA8EUH,EA7EVI,GA8EWvB,EAAQc,2BACkB,QAAzBd,EAAQwB,cA7EZF,EAAMF,OAAS,IAAIK,OACzB,SAACC,EAAUJ,GAKT,GAJKI,EAASJ,EAAMK,QAClBD,EAASJ,EAAMK,MAAS,CAAEC,QAASN,EAAMM,QAASC,KAAMP,EAAMO,OAG5DN,EAA0B,CAC5B,IAAMO,EAAQJ,EAASJ,EAAMK,MAAOG,MAC9BC,EAAWD,GAASA,EAAMR,EAAMO,MAEtCH,EAASJ,EAAMK,MAASK,EACtBV,EAAMK,KACNJ,EACAG,EACAJ,EAAMO,KACNE,EACK,GAAgBE,OAAOF,EAAsBT,EAAMM,SACpDN,EAAMM,QAEd,CAEA,OAAOF,CACT,EACA,KAwDM1B,IAnFe,IACvBsB,EACAC,CAoFE,GACF,CAAC,MAAAJ,GAAA,OAAAlB,QAAAiC,OAAAf,EACH,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.umd.js b/node_modules/@hookform/resolvers/yup/dist/yup.umd.js deleted file mode 100644 index 2391b647b6b37bc57a46121ef0a12eb0dcecf758..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],o):o((e||self).hookformResolversYup={},e.hookformResolvers,e.ReactHookForm)}(this,function(e,o,t){e.yupResolver=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),function(s,a,i){try{return Promise.resolve(function(t,u){try{var c=(r.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},r,{context:a}))).then(function(e){return i.shouldUseNativeValidation&&o.validateFieldsNatively({},i),{values:n.raw?s:e,errors:{}}}))}catch(e){return u(e)}return c&&c.then?c.then(void 0,u):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:o.toNestErrors((r=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(r.inner||[]).reduce(function(e,o){if(e[o.path]||(e[o.path]={message:o.message,type:o.type}),n){var r=e[o.path].types,s=r&&r[o.type];e[o.path]=t.appendErrors(o.path,n,e,o.type,s?[].concat(s,o.message):o.message)}return e},{})),i)};var r,n}))}catch(e){return Promise.reject(e)}}}}); -//# sourceMappingURL=yup.umd.js.map diff --git a/node_modules/@hookform/resolvers/yup/dist/yup.umd.js.map b/node_modules/@hookform/resolvers/yup/dist/yup.umd.js.map deleted file mode 100644 index acc60ffd0ce1296ea752e1db7148c3f12ade3f0f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/dist/yup.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"yup.umd.js","sources":["../src/yup.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nconst parseErrorSchema = (\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) => {\n return (error.inner || []).reduce>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n};\n\nexport function yupResolver(\n schema:\n | Yup.ObjectSchema\n | ReturnType>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n /**\n * @default async\n */\n mode?: 'async' | 'sync';\n /**\n * Return the raw input values rather than the parsed values.\n * @default false\n */\n raw?: boolean;\n } = {},\n): Resolver> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n"],"names":["schema","schemaOptions","resolverOptions","values","context","options","Promise","resolve","process","env","NODE_ENV","console","warn","mode","Object","assign","abortEarly","then","result","shouldUseNativeValidation","validateFieldsNatively","raw","errors","_catch","e","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","reject"],"mappings":"sYA4CgB,SACdA,EAGAC,EACAC,GAYA,YAbAD,IAAAA,IAAAA,EAA4D,CAAE,QAC9DC,IAAAA,IAAAA,EAUI,IAEUC,SAAAA,EAAQC,EAASC,GAAW,IAAA,OAAAC,QAAAC,iCAElCN,EAAcG,SAAoC,gBAAzBI,QAAQC,IAAIC,UAEvCC,QAAQC,KACN,iGAEHN,QAAAC,QAEoBP,EACM,SAAzBE,EAAgBW,KAAkB,eAAiB,YAEnDV,EACAW,OAAOC,OAAO,CAAEC,YAAY,GAASf,EAAe,CAAEG,QAAAA,MACvDa,cALKC,GASN,OAFAb,EAAQc,2BAA6BC,EAAAA,uBAAuB,CAAE,EAAEf,GAEzD,CACLF,OAAQD,EAAgBmB,IAAMlB,EAASe,EACvCI,OAAQ,CAAA,EACR,6DArBoCC,CAAA,WAsB/BC,GACP,IAAKA,EAAEC,MACL,MAAMD,EAGR,MAAO,CACLrB,OAAQ,CAAE,EACVmB,OAAQI,EAAAA,cA5EdC,EA8EUH,EA7EVI,GA8EWvB,EAAQc,2BACkB,QAAzBd,EAAQwB,cA7EZF,EAAMF,OAAS,IAAIK,OACzB,SAACC,EAAUJ,GAKT,GAJKI,EAASJ,EAAMK,QAClBD,EAASJ,EAAMK,MAAS,CAAEC,QAASN,EAAMM,QAASC,KAAMP,EAAMO,OAG5DN,EAA0B,CAC5B,IAAMO,EAAQJ,EAASJ,EAAMK,MAAOG,MAC9BC,EAAWD,GAASA,EAAMR,EAAMO,MAEtCH,EAASJ,EAAMK,MAASK,EAAAA,aACtBV,EAAMK,KACNJ,EACAG,EACAJ,EAAMO,KACNE,EACK,GAAgBE,OAAOF,EAAsBT,EAAMM,SACpDN,EAAMM,QAEd,CAEA,OAAOF,CACT,EACA,KAwDM1B,IAnFe,IACvBsB,EACAC,CAoFE,GACF,CAAC,MAAAJ,GAAA,OAAAlB,QAAAiC,OAAAf,EACH,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/yup/package.json b/node_modules/@hookform/resolvers/yup/package.json deleted file mode 100644 index 482780de56f22d285db20556361df90c89f432ad..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@hookform/resolvers/yup", - "amdName": "hookformResolversYup", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: yup", - "main": "dist/yup.js", - "module": "dist/yup.module.js", - "umd:main": "dist/yup.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/yup/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/yup/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index a479e9b6d560f9ff05d4601fc9f6c4e7c256a741..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import * as Yup from 'yup'; -import { yupResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = Yup.object({ - username: Yup.string().required(USERNAME_REQUIRED_MESSAGE), - password: Yup.string().required(PASSWORD_REQUIRED_MESSAGE), -}); - -type FormData = Yup.InferType; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: yupResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Yup", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/yup/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/yup/src/__tests__/Form.tsx deleted file mode 100644 index 75f82d9fadb2598d4ec6c15f2d3c18c77e1a748b..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/__tests__/Form.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { SubmitHandler, useForm } from 'react-hook-form'; -import * as Yup from 'yup'; -import { yupResolver } from '..'; - -const schema = Yup.object({ - username: Yup.string().required(), - password: Yup.string().required(), -}); - -type FormData = Yup.InferType; - -interface Props { - onSubmit: SubmitHandler; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: yupResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Yup and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username is a required field/i)).toBeInTheDocument(); - expect(screen.getByText(/password is a required field/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/yup/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/yup/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 90348fecd237c73aeb3928f0ae6fd54a0bc2d866..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import * as yup from 'yup'; - -export const schema = yup.object({ - username: yup.string().matches(/^\w+$/).min(3).max(30).required(), - password: yup - .string() - .matches(new RegExp('.*[A-Z].*'), 'One uppercase character') - .matches(new RegExp('.*[a-z].*'), 'One lowercase character') - .matches(new RegExp('.*\\d.*'), 'One number') - .matches( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ) - .min(8, 'Must be at least 8 characters in length') - .required('New Password is required'), - repeatPassword: yup.ref('password'), - accessToken: yup.string(), - birthYear: yup.number().min(1900).max(2013), - email: yup.string().email(), - tags: yup.array(yup.string()), - enabled: yup.boolean(), - like: yup.array().of( - yup.object({ - id: yup.number().required(), - name: yup.string().length(4).required(), - }), - ), -}); - -export const schemaWithWhen = yup.object({ - name: yup.string().required(), - value: yup.string().when('name', ([name], schema) => { - return name === 'test' ? yup.number().required() : schema; - }), -}); - -export const validData = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - like: [ - { - id: 1, - name: 'name', - }, - ], -} satisfies yup.InferType; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - // Must be set to "unknown", otherwise typescript knows that it is invalid -} as unknown as Required>; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/yup/src/__tests__/__snapshots__/yup.ts.snap b/node_modules/@hookform/resolvers/yup/src/__tests__/__snapshots__/yup.ts.snap deleted file mode 100644 index 076491d31a4e03a9380f62a41ba5d508681c33e6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/__tests__/__snapshots__/yup.ts.snap +++ /dev/null @@ -1,244 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`yupResolver > should return a single error from yupResolver when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"birthYear"\`).", - "ref": undefined, - "type": "typeError", - }, - "like": [ - { - "id": { - "message": "like[0].id must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"z"\`).", - "ref": undefined, - "type": "typeError", - }, - "name": { - "message": "like[0].name is a required field", - "ref": undefined, - "type": "optionality", - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "matches", - }, - "username": { - "message": "username is a required field", - "ref": { - "name": "username", - }, - "type": "optionality", - }, - }, - "values": {}, -} -`; - -exports[`yupResolver > should return a single error from yupResolver with \`mode: sync\` when validation fails 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"birthYear"\`).", - "ref": undefined, - "type": "typeError", - }, - "like": [ - { - "id": { - "message": "like[0].id must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"z"\`).", - "ref": undefined, - "type": "typeError", - }, - "name": { - "message": "like[0].name is a required field", - "ref": undefined, - "type": "optionality", - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "matches", - }, - "username": { - "message": "username is a required field", - "ref": { - "name": "username", - }, - "type": "optionality", - }, - }, - "values": {}, -} -`; - -exports[`yupResolver > should return all the errors from yupResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"birthYear"\`).", - "ref": undefined, - "type": "typeError", - "types": { - "typeError": "birthYear must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"birthYear"\`).", - }, - }, - "like": [ - { - "id": { - "message": "like[0].id must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"z"\`).", - "ref": undefined, - "type": "typeError", - "types": { - "typeError": "like[0].id must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"z"\`).", - }, - }, - "name": { - "message": "like[0].name is a required field", - "ref": undefined, - "type": "optionality", - "types": { - "optionality": "like[0].name is a required field", - }, - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "matches", - "types": { - "matches": [ - "One uppercase character", - "One lowercase character", - "One number", - ], - "min": "Must be at least 8 characters in length", - }, - }, - "username": { - "message": "username is a required field", - "ref": { - "name": "username", - }, - "type": "optionality", - "types": { - "optionality": "username is a required field", - }, - }, - }, - "values": {}, -} -`; - -exports[`yupResolver > should return all the errors from yupResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "birthYear": { - "message": "birthYear must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"birthYear"\`).", - "ref": undefined, - "type": "typeError", - "types": { - "typeError": "birthYear must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"birthYear"\`).", - }, - }, - "like": [ - { - "id": { - "message": "like[0].id must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"z"\`).", - "ref": undefined, - "type": "typeError", - "types": { - "typeError": "like[0].id must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`"z"\`).", - }, - }, - "name": { - "message": "like[0].name is a required field", - "ref": undefined, - "type": "optionality", - "types": { - "optionality": "like[0].name is a required field", - }, - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "matches", - "types": { - "matches": [ - "One uppercase character", - "One lowercase character", - "One number", - ], - "min": "Must be at least 8 characters in length", - }, - }, - "username": { - "message": "username is a required field", - "ref": { - "name": "username", - }, - "type": "optionality", - "types": { - "optionality": "username is a required field", - }, - }, - }, - "values": {}, -} -`; - -exports[`yupResolver > should return an error from yupResolver when validation fails and pass down the yup context 1`] = ` -{ - "errors": { - "name": { - "message": "name must be at least 6 characters", - "ref": undefined, - "type": "min", - }, - }, - "values": {}, -} -`; - -exports[`yupResolver > should return correct error message with using yup.test 1`] = ` -{ - "errors": { - "": { - "message": "Email or name are required", - "ref": undefined, - "type": "name", - }, - }, - "values": {}, -} -`; - -exports[`yupResolver > should throw an error without inner property 1`] = ` -{ - "errors": { - "value": { - "message": "value must be a \`number\` type, but the final value was: \`NaN\` (cast from the value \`""\`).", - "ref": undefined, - "type": "typeError", - }, - }, - "values": {}, -} -`; diff --git a/node_modules/@hookform/resolvers/yup/src/__tests__/yup.ts b/node_modules/@hookform/resolvers/yup/src/__tests__/yup.ts deleted file mode 100644 index 5b33da3a974aa3993781c9d8594aaf52528862b0..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/__tests__/yup.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */ -import * as yup from 'yup'; -import { yupResolver } from '..'; -import { - fields, - invalidData, - schema, - schemaWithWhen, - validData, -} from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('yupResolver', () => { - it('should return values from yupResolver when validation pass', async () => { - const schemaSpy = vi.spyOn(schema, 'validate'); - const schemaSyncSpy = vi.spyOn(schema, 'validateSync'); - - const result = await yupResolver(schema)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(schemaSyncSpy).not.toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return values from yupResolver with `mode: sync` when validation pass', async () => { - const validateSyncSpy = vi.spyOn(schema, 'validateSync'); - const validateSpy = vi.spyOn(schema, 'validate'); - - const result = await yupResolver(schema, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }); - - expect(validateSyncSpy).toHaveBeenCalledTimes(1); - expect(validateSpy).not.toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return a single error from yupResolver when validation fails', async () => { - const result = await yupResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from yupResolver with `mode: sync` when validation fails', async () => { - const validateSyncSpy = vi.spyOn(schema, 'validateSync'); - const validateSpy = vi.spyOn(schema, 'validate'); - - const result = await yupResolver(schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }); - - expect(validateSyncSpy).toHaveBeenCalledTimes(1); - expect(validateSpy).not.toHaveBeenCalled(); - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from yupResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await yupResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from yupResolver when validation fails with `validateAllFieldCriteria` set to true and `mode: sync`', async () => { - const result = await yupResolver(schema, undefined, { mode: 'sync' })( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should return an error from yupResolver when validation fails and pass down the yup context', async () => { - const data = { name: 'eric' }; - const context = { min: true }; - const schemaWithContext = yup.object({ - name: yup - .string() - .required() - .when('$min', ([min], schema) => { - return min ? schema.min(6) : schema; - }), - }); - - const validateSpy = vi.spyOn(schemaWithContext, 'validate'); - - const result = await yupResolver(schemaWithContext)(data, context, { - fields, - shouldUseNativeValidation, - }); - expect(validateSpy).toHaveBeenCalledTimes(1); - expect(validateSpy).toHaveBeenCalledWith( - data, - expect.objectContaining({ - abortEarly: false, - context, - }), - ); - expect(result).toMatchSnapshot(); - }); - - it('should return correct error message with using yup.test', async () => { - const result = await yupResolver( - yup - .object({ - name: yup.string(), - email: yup.string(), - }) - .test( - 'name', - 'Email or name are required', - (value) => !!(value && (value.name || value.email)), - ), - )({ name: '', email: '' }, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it("should merge default yup resolver options with yup's options", async () => { - const validateSpy = vi.spyOn(schema, 'validate'); - - await yupResolver(schema, { stripUnknown: true })(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(validateSpy.mock.calls[0][1]).toEqual( - expect.objectContaining({ stripUnknown: true, abortEarly: false }), - ); - }); - - it('should throw an error without inner property', async () => { - const result = await yupResolver(schemaWithWhen)( - { name: 'test', value: '' }, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should throw any error unrelated to Yup', async () => { - const schemaWithCustomError = schema.transform(() => { - throw Error('custom error'); - }); - const promise = yupResolver(schemaWithCustomError)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - await expect(promise).rejects.toThrow('custom error'); - }); - - it('should return values from yupResolver when validation pass & raw=true', async () => { - const schemaSpy = vi.spyOn(schema, 'validate'); - const schemaSyncSpy = vi.spyOn(schema, 'validateSync'); - - const result = await yupResolver(schema, undefined, { raw: true })( - validData, - undefined, - { - fields, - shouldUseNativeValidation, - }, - ); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(schemaSyncSpy).not.toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('shoud validate a lazy schema with success', async () => { - const lazySchema = yup.lazy(() => - yup.object().shape({ firstName: yup.string().optional() }), - ); - - const schemaSpy = vi.spyOn(lazySchema, 'validate'); - const schemaSyncSpy = vi.spyOn(lazySchema, 'validateSync'); - - const result = await yupResolver(lazySchema, undefined)( - { firstName: 'resolver' }, - undefined, - { - fields: { - firstName: { - ref: { name: 'firstName' }, - name: 'firstName', - }, - }, - shouldUseNativeValidation, - }, - ); - - expect(schemaSpy).toHaveBeenCalledTimes(1); - expect(schemaSyncSpy).not.toHaveBeenCalled(); - expect(result).toEqual({ errors: {}, values: { firstName: 'resolver' } }); - }); -}); diff --git a/node_modules/@hookform/resolvers/yup/src/index.ts b/node_modules/@hookform/resolvers/yup/src/index.ts deleted file mode 100644 index 13c89e6eb059648677c90cb9e787079bb2038828..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './yup'; diff --git a/node_modules/@hookform/resolvers/yup/src/yup.ts b/node_modules/@hookform/resolvers/yup/src/yup.ts deleted file mode 100644 index 9aabf664b15faa178a6e5737ed311e463f005f85..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/yup/src/yup.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { - FieldError, - FieldValues, - Resolver, - appendErrors, -} from 'react-hook-form'; -import * as Yup from 'yup'; - -/** - * Why `path!` ? because it could be `undefined` in some case - * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string - */ -const parseErrorSchema = ( - error: Yup.ValidationError, - validateAllFieldCriteria: boolean, -) => { - return (error.inner || []).reduce>( - (previous, error) => { - if (!previous[error.path!]) { - previous[error.path!] = { message: error.message, type: error.type! }; - } - - if (validateAllFieldCriteria) { - const types = previous[error.path!].types; - const messages = types && types[error.type!]; - - previous[error.path!] = appendErrors( - error.path!, - validateAllFieldCriteria, - previous, - error.type!, - messages - ? ([] as string[]).concat(messages as string[], error.message) - : error.message, - ) as FieldError; - } - - return previous; - }, - {}, - ); -}; - -export function yupResolver( - schema: - | Yup.ObjectSchema - | ReturnType>>, - schemaOptions: Parameters<(typeof schema)['validate']>[1] = {}, - resolverOptions: { - /** - * @default async - */ - mode?: 'async' | 'sync'; - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; - } = {}, -): Resolver> { - return async (values, context, options) => { - try { - if (schemaOptions.context && process.env.NODE_ENV === 'development') { - // eslint-disable-next-line no-console - console.warn( - "You should not used the yup options context. Please, use the 'useForm' context object instead", - ); - } - - const result = await schema[ - resolverOptions.mode === 'sync' ? 'validateSync' : 'validate' - ]( - values, - Object.assign({ abortEarly: false }, schemaOptions, { context }), - ); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - values: resolverOptions.raw ? values : result, - errors: {}, - }; - } catch (e: any) { - if (!e.inner) { - throw e; - } - - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - e, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - } - }; -} diff --git a/node_modules/@hookform/resolvers/zod/dist/index.d.ts b/node_modules/@hookform/resolvers/zod/dist/index.d.ts deleted file mode 100644 index a60a00ebbc8934ae351edcb0715ed7510c4e847d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './zod'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/zod/dist/types.d.ts b/node_modules/@hookform/resolvers/zod/dist/types.d.ts deleted file mode 100644 index 033484e0c93b5d927ad2bb3023b2bffe22a281a9..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { z } from 'zod'; -export type Resolver = >(schema: T, schemaOptions?: Partial, factoryOptions?: { - /** - * @default async - */ - mode?: 'async' | 'sync'; - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; -}) => (values: TFieldValues, context: TContext | undefined, options: ResolverOptions) => Promise>; diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.d.ts b/node_modules/@hookform/resolvers/zod/dist/zod.d.ts deleted file mode 100644 index 9a486c229f85d9a08e56e86e56e9a27bab6c5e8d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Resolver } from './types'; -export declare const zodResolver: Resolver; diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.js b/node_modules/@hookform/resolvers/zod/dist/zod.js deleted file mode 100644 index d0865989c0bff42368a5524682b25b3683f08cf2..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.js +++ /dev/null @@ -1,2 +0,0 @@ -var r=require("@hookform/resolvers"),e=require("react-hook-form"),o=function(r,o){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(".");if(!n[a])if("unionErrors"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),o){var c=n[a].types,f=c&&c[s.code];n[a]=e.appendErrors(a,o,n,t,f?[].concat(f,s.message):s.message)}r.shift()}return n};exports.zodResolver=function(e,n,s){return void 0===s&&(s={}),function(t,i,a){try{return Promise.resolve(function(o,i){try{var u=Promise.resolve(e["sync"===s.mode?"parse":"parseAsync"](t,n)).then(function(e){return a.shouldUseNativeValidation&&r.validateFieldsNatively({},a),{errors:{},values:s.raw?t:e}})}catch(r){return i(r)}return u&&u.then?u.then(void 0,i):u}(0,function(e){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(e))return{values:{},errors:r.toNestErrors(o(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(r){return Promise.reject(r)}}}; -//# sourceMappingURL=zod.js.map diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.js.map b/node_modules/@hookform/resolvers/zod/dist/zod.js.map deleted file mode 100644 index 5fc14a756d72c558ede0307ebf88591004de11ee..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod.js","sources":["../src/zod.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport { ZodError, z } from 'zod';\nimport type { Resolver } from './types';\n\nconst isZodError = (error: any): error is ZodError =>\n Array.isArray(error?.errors);\n\nconst parseErrorSchema = (\n zodErrors: z.ZodIssue[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; zodErrors.length; ) {\n const error = zodErrors[0];\n const { code, message, path } = error;\n const _path = path.join('.');\n\n if (!errors[_path]) {\n if ('unionErrors' in error) {\n const unionError = error.unionErrors[0].errors[0];\n\n errors[_path] = {\n message: unionError.message,\n type: unionError.code,\n };\n } else {\n errors[_path] = { message, type: code };\n }\n }\n\n if ('unionErrors' in error) {\n error.unionErrors.forEach((unionError) =>\n unionError.errors.forEach((e) => zodErrors.push(e)),\n );\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[error.code];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n code,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n zodErrors.shift();\n }\n\n return errors;\n};\n\nexport const zodResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema[\n resolverOptions.mode === 'sync' ? 'parse' : 'parseAsync'\n ](values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (isZodError(error)) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.errors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","zodErrors","validateAllFieldCriteria","errors","length","error","code","message","_path","path","join","unionError","unionErrors","type","forEach","e","push","types","messages","appendErrors","concat","shift","schema","schemaOptions","resolverOptions","values","_","options","Promise","resolve","mode","then","data","shouldUseNativeValidation","validateFieldsNatively","raw","_catch","Array","isArray","isZodError","toNestErrors","criteriaMode","reject"],"mappings":"kEAQMA,EAAmB,SACvBC,EACAC,GAGA,IADA,IAAMC,EAAqC,CAAE,EACtCF,EAAUG,QAAU,CACzB,IAAMC,EAAQJ,EAAU,GAChBK,EAAwBD,EAAxBC,KAAMC,EAAkBF,EAAlBE,QACRC,EAD0BH,EAATI,KACJC,KAAK,KAExB,IAAKP,EAAOK,GACV,GAAI,gBAAiBH,EAAO,CAC1B,IAAMM,EAAaN,EAAMO,YAAY,GAAGT,OAAO,GAE/CA,EAAOK,GAAS,CACdD,QAASI,EAAWJ,QACpBM,KAAMF,EAAWL,KAErB,MACEH,EAAOK,GAAS,CAAED,QAAAA,EAASM,KAAMP,GAUrC,GANI,gBAAiBD,GACnBA,EAAMO,YAAYE,QAAQ,SAACH,GAAU,OACnCA,EAAWR,OAAOW,QAAQ,SAACC,GAAM,OAAAd,EAAUe,KAAKD,EAAE,EAAC,GAInDb,EAA0B,CAC5B,IAAMe,EAAQd,EAAOK,GAAOS,MACtBC,EAAWD,GAASA,EAAMZ,EAAMC,MAEtCH,EAAOK,GAASW,EAAAA,aACdX,EACAN,EACAC,EACAG,EACAY,EACK,GAAgBE,OAAOF,EAAsBb,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAUoB,OACZ,CAEA,OAAOlB,CACT,sBAGE,SAACmB,EAAQC,EAAeC,GACjBC,YADgC,IAAfD,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACvBD,QAAAC,QACiBP,EACQ,SAAzBE,EAAgBM,KAAkB,QAAU,cAC5CL,EAAQF,IAAcQ,KAFlBC,SAAAA,GAMN,OAFAL,EAAQM,2BAA6BC,yBAAuB,CAAA,EAAIP,GAEzD,CACLxB,OAAQ,CAAiB,EACzBsB,OAAQD,EAAgBW,IAAMV,EAASO,EACvC,4DAXuBI,CACvB,EAWH,SAAQ/B,GACP,GApEa,SAACA,GAClB,OAAAgC,MAAMC,QAAa,MAALjC,OAAK,EAALA,EAAOF,OAAO,CAmEpBoC,CAAWlC,GACb,MAAO,CACLoB,OAAQ,CAAA,EACRtB,OAAQqC,EAAYA,aAClBxC,EACEK,EAAMF,QACLwB,EAAQM,2BACkB,QAAzBN,EAAQc,cAEZd,IAKN,MAAMtB,CACR,GACF,CAAC,MAAAU,GAAA,OAAAa,QAAAc,OAAA3B,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.mjs b/node_modules/@hookform/resolvers/zod/dist/zod.mjs deleted file mode 100644 index c3e251af155dcf007afcae0cb827aa69dc52b810..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";var n=function(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("unionErrors"in t){var u=t.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n},t=function(o,t,s){return void 0===s&&(s={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o["sync"===s.mode?"parse":"parseAsync"](i,t)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:s.raw?i:e}})}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return{values:{},errors:e(n(r.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}};export{t as zodResolver}; -//# sourceMappingURL=zod.module.js.map diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.modern.mjs b/node_modules/@hookform/resolvers/zod/dist/zod.modern.mjs deleted file mode 100644 index a9fdd072de917bf90f2319f01900294aef7be1f1..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.modern.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as o}from"@hookform/resolvers";import{appendErrors as s}from"react-hook-form";const e=(r,o)=>{const e={};for(;r.length;){const a=r[0],{code:t,message:n,path:i}=a,c=i.join(".");if(!e[c])if("unionErrors"in a){const r=a.unionErrors[0].errors[0];e[c]={message:r.message,type:r.code}}else e[c]={message:n,type:t};if("unionErrors"in a&&a.unionErrors.forEach(o=>o.errors.forEach(o=>r.push(o))),o){const r=e[c].types,n=r&&r[a.code];e[c]=s(c,o,e,t,n?[].concat(n,a.message):a.message)}r.shift()}return e},a=(s,a,t={})=>async(n,i,c)=>{try{const o=await s["sync"===t.mode?"parse":"parseAsync"](n,a);return c.shouldUseNativeValidation&&r({},c),{errors:{},values:t.raw?n:o}}catch(r){if((r=>Array.isArray(null==r?void 0:r.errors))(r))return{values:{},errors:o(e(r.errors,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw r}};export{a as zodResolver}; -//# sourceMappingURL=zod.modern.mjs.map diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.modern.mjs.map b/node_modules/@hookform/resolvers/zod/dist/zod.modern.mjs.map deleted file mode 100644 index 9f5e331a61ab9b45a2dc0621a3de13fd39636710..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.modern.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod.modern.mjs","sources":["../src/zod.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport { ZodError, z } from 'zod';\nimport type { Resolver } from './types';\n\nconst isZodError = (error: any): error is ZodError =>\n Array.isArray(error?.errors);\n\nconst parseErrorSchema = (\n zodErrors: z.ZodIssue[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; zodErrors.length; ) {\n const error = zodErrors[0];\n const { code, message, path } = error;\n const _path = path.join('.');\n\n if (!errors[_path]) {\n if ('unionErrors' in error) {\n const unionError = error.unionErrors[0].errors[0];\n\n errors[_path] = {\n message: unionError.message,\n type: unionError.code,\n };\n } else {\n errors[_path] = { message, type: code };\n }\n }\n\n if ('unionErrors' in error) {\n error.unionErrors.forEach((unionError) =>\n unionError.errors.forEach((e) => zodErrors.push(e)),\n );\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[error.code];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n code,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n zodErrors.shift();\n }\n\n return errors;\n};\n\nexport const zodResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema[\n resolverOptions.mode === 'sync' ? 'parse' : 'parseAsync'\n ](values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (isZodError(error)) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.errors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","zodErrors","validateAllFieldCriteria","errors","length","error","code","message","path","_path","join","unionError","unionErrors","type","forEach","e","push","types","messages","appendErrors","concat","shift","zodResolver","schema","schemaOptions","resolverOptions","async","values","_","options","data","mode","shouldUseNativeValidation","validateFieldsNatively","raw","Array","isArray","isZodError","toNestErrors","criteriaMode"],"mappings":"8HAKA,MAGMA,EAAmBA,CACvBC,EACAC,KAEA,MAAMC,EAAqC,CAAA,EAC3C,KAAOF,EAAUG,QAAU,CACzB,MAAMC,EAAQJ,EAAU,IAClBK,KAAEA,EAAIC,QAAEA,EAAOC,KAAEA,GAASH,EAC1BI,EAAQD,EAAKE,KAAK,KAExB,IAAKP,EAAOM,GACV,GAAI,gBAAiBJ,EAAO,CAC1B,MAAMM,EAAaN,EAAMO,YAAY,GAAGT,OAAO,GAE/CA,EAAOM,GAAS,CACdF,QAASI,EAAWJ,QACpBM,KAAMF,EAAWL,KAErB,MACEH,EAAOM,GAAS,CAAEF,UAASM,KAAMP,GAUrC,GANI,gBAAiBD,GACnBA,EAAMO,YAAYE,QAASH,GACzBA,EAAWR,OAAOW,QAASC,GAAMd,EAAUe,KAAKD,KAIhDb,EAA0B,CAC5B,MAAMe,EAAQd,EAAOM,GAAOQ,MACtBC,EAAWD,GAASA,EAAMZ,EAAMC,MAEtCH,EAAOM,GAASU,EACdV,EACAP,EACAC,EACAG,EACAY,EACK,GAAgBE,OAAOF,EAAsBb,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAUoB,OACZ,CAEA,OAAOlB,GAGImB,EACXA,CAACC,EAAQC,EAAeC,EAAkB,KAC1CC,MAAOC,EAAQC,EAAGC,KAChB,IACE,MAAMC,QAAaP,EACQ,SAAzBE,EAAgBM,KAAkB,QAAU,cAC5CJ,EAAQH,GAIV,OAFAK,EAAQG,2BAA6BC,EAAuB,CAAE,EAAEJ,GAEzD,CACL1B,OAAQ,CAAA,EACRwB,OAAQF,EAAgBS,IAAMP,EAASG,EAE3C,CAAE,MAAOzB,GACP,GApEcA,IAClB8B,MAAMC,QAAQ/B,MAAAA,OAAAA,EAAAA,EAAOF,QAmEbkC,CAAWhC,GACb,MAAO,CACLsB,OAAQ,GACRxB,OAAQmC,EACNtC,EACEK,EAAMF,QACL0B,EAAQG,2BACkB,QAAzBH,EAAQU,cAEZV,IAKN,MAAMxB,CACR"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.module.js b/node_modules/@hookform/resolvers/zod/dist/zod.module.js deleted file mode 100644 index c3e251af155dcf007afcae0cb827aa69dc52b810..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.module.js +++ /dev/null @@ -1,2 +0,0 @@ -import{validateFieldsNatively as r,toNestErrors as e}from"@hookform/resolvers";import{appendErrors as o}from"react-hook-form";var n=function(r,e){for(var n={};r.length;){var t=r[0],s=t.code,i=t.message,a=t.path.join(".");if(!n[a])if("unionErrors"in t){var u=t.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[t.code];n[a]=o(a,e,n,s,f?[].concat(f,t.message):t.message)}r.shift()}return n},t=function(o,t,s){return void 0===s&&(s={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o["sync"===s.mode?"parse":"parseAsync"](i,t)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:s.raw?i:e}})}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return{values:{},errors:e(n(r.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}};export{t as zodResolver}; -//# sourceMappingURL=zod.module.js.map diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.module.js.map b/node_modules/@hookform/resolvers/zod/dist/zod.module.js.map deleted file mode 100644 index e9000f919c04cb73d00cd2e9ef644f5d18c4cf7f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod.module.js","sources":["../src/zod.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport { ZodError, z } from 'zod';\nimport type { Resolver } from './types';\n\nconst isZodError = (error: any): error is ZodError =>\n Array.isArray(error?.errors);\n\nconst parseErrorSchema = (\n zodErrors: z.ZodIssue[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; zodErrors.length; ) {\n const error = zodErrors[0];\n const { code, message, path } = error;\n const _path = path.join('.');\n\n if (!errors[_path]) {\n if ('unionErrors' in error) {\n const unionError = error.unionErrors[0].errors[0];\n\n errors[_path] = {\n message: unionError.message,\n type: unionError.code,\n };\n } else {\n errors[_path] = { message, type: code };\n }\n }\n\n if ('unionErrors' in error) {\n error.unionErrors.forEach((unionError) =>\n unionError.errors.forEach((e) => zodErrors.push(e)),\n );\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[error.code];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n code,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n zodErrors.shift();\n }\n\n return errors;\n};\n\nexport const zodResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema[\n resolverOptions.mode === 'sync' ? 'parse' : 'parseAsync'\n ](values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (isZodError(error)) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.errors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","zodErrors","validateAllFieldCriteria","errors","length","error","code","message","_path","path","join","unionError","unionErrors","type","forEach","e","push","types","messages","appendErrors","concat","shift","zodResolver","schema","schemaOptions","resolverOptions","values","_","options","Promise","resolve","mode","then","data","shouldUseNativeValidation","validateFieldsNatively","raw","_catch","Array","isArray","isZodError","toNestErrors","criteriaMode","reject"],"mappings":"8HAKA,IAGMA,EAAmB,SACvBC,EACAC,GAGA,IADA,IAAMC,EAAqC,CAAE,EACtCF,EAAUG,QAAU,CACzB,IAAMC,EAAQJ,EAAU,GAChBK,EAAwBD,EAAxBC,KAAMC,EAAkBF,EAAlBE,QACRC,EAD0BH,EAATI,KACJC,KAAK,KAExB,IAAKP,EAAOK,GACV,GAAI,gBAAiBH,EAAO,CAC1B,IAAMM,EAAaN,EAAMO,YAAY,GAAGT,OAAO,GAE/CA,EAAOK,GAAS,CACdD,QAASI,EAAWJ,QACpBM,KAAMF,EAAWL,KAErB,MACEH,EAAOK,GAAS,CAAED,QAAAA,EAASM,KAAMP,GAUrC,GANI,gBAAiBD,GACnBA,EAAMO,YAAYE,QAAQ,SAACH,GAAU,OACnCA,EAAWR,OAAOW,QAAQ,SAACC,GAAM,OAAAd,EAAUe,KAAKD,EAAE,EAAC,GAInDb,EAA0B,CAC5B,IAAMe,EAAQd,EAAOK,GAAOS,MACtBC,EAAWD,GAASA,EAAMZ,EAAMC,MAEtCH,EAAOK,GAASW,EACdX,EACAN,EACAC,EACAG,EACAY,EACK,GAAgBE,OAAOF,EAAsBb,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAUoB,OACZ,CAEA,OAAOlB,CACT,EAEamB,EACX,SAACC,EAAQC,EAAeC,GACjBC,YADgC,IAAfD,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACvBD,QAAAC,QACiBP,EACQ,SAAzBE,EAAgBM,KAAkB,QAAU,cAC5CL,EAAQF,IAAcQ,KAFlBC,SAAAA,GAMN,OAFAL,EAAQM,2BAA6BC,EAAuB,CAAA,EAAIP,GAEzD,CACLzB,OAAQ,CAAiB,EACzBuB,OAAQD,EAAgBW,IAAMV,EAASO,EACvC,4DAXuBI,CACvB,EAWH,SAAQhC,GACP,GApEa,SAACA,GAClB,OAAAiC,MAAMC,QAAa,MAALlC,OAAK,EAALA,EAAOF,OAAO,CAmEpBqC,CAAWnC,GACb,MAAO,CACLqB,OAAQ,CAAA,EACRvB,OAAQsC,EACNzC,EACEK,EAAMF,QACLyB,EAAQM,2BACkB,QAAzBN,EAAQc,cAEZd,IAKN,MAAMvB,CACR,GACF,CAAC,MAAAU,GAAA,OAAAc,QAAAc,OAAA5B,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.umd.js b/node_modules/@hookform/resolvers/zod/dist/zod.umd.js deleted file mode 100644 index 8faaee8418a30ddc9aa208a8c6c1fbd90b197f61..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.umd.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],e):e((r||self).hookformResolversZod={},r.hookformResolvers,r.ReactHookForm)}(this,function(r,e,o){var n=function(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(".");if(!n[a])if("unionErrors"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var f=n[a].types,c=f&&f[s.code];n[a]=o.appendErrors(a,e,n,t,c?[].concat(c,s.message):s.message)}r.shift()}return n};r.zodResolver=function(r,o,s){return void 0===s&&(s={}),function(t,i,a){try{return Promise.resolve(function(n,i){try{var u=Promise.resolve(r["sync"===s.mode?"parse":"parseAsync"](t,o)).then(function(r){return a.shouldUseNativeValidation&&e.validateFieldsNatively({},a),{errors:{},values:s.raw?t:r}})}catch(r){return i(r)}return u&&u.then?u.then(void 0,i):u}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return{values:{},errors:e.toNestErrors(n(r.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw r}))}catch(r){return Promise.reject(r)}}}}); -//# sourceMappingURL=zod.umd.js.map diff --git a/node_modules/@hookform/resolvers/zod/dist/zod.umd.js.map b/node_modules/@hookform/resolvers/zod/dist/zod.umd.js.map deleted file mode 100644 index 479773106bcb936be7d295d3e3f9018610850b97..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/dist/zod.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod.umd.js","sources":["../src/zod.ts"],"sourcesContent":["import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport { FieldError, FieldErrors, appendErrors } from 'react-hook-form';\nimport { ZodError, z } from 'zod';\nimport type { Resolver } from './types';\n\nconst isZodError = (error: any): error is ZodError =>\n Array.isArray(error?.errors);\n\nconst parseErrorSchema = (\n zodErrors: z.ZodIssue[],\n validateAllFieldCriteria: boolean,\n) => {\n const errors: Record = {};\n for (; zodErrors.length; ) {\n const error = zodErrors[0];\n const { code, message, path } = error;\n const _path = path.join('.');\n\n if (!errors[_path]) {\n if ('unionErrors' in error) {\n const unionError = error.unionErrors[0].errors[0];\n\n errors[_path] = {\n message: unionError.message,\n type: unionError.code,\n };\n } else {\n errors[_path] = { message, type: code };\n }\n }\n\n if ('unionErrors' in error) {\n error.unionErrors.forEach((unionError) =>\n unionError.errors.forEach((e) => zodErrors.push(e)),\n );\n }\n\n if (validateAllFieldCriteria) {\n const types = errors[_path].types;\n const messages = types && types[error.code];\n\n errors[_path] = appendErrors(\n _path,\n validateAllFieldCriteria,\n errors,\n code,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n zodErrors.shift();\n }\n\n return errors;\n};\n\nexport const zodResolver: Resolver =\n (schema, schemaOptions, resolverOptions = {}) =>\n async (values, _, options) => {\n try {\n const data = await schema[\n resolverOptions.mode === 'sync' ? 'parse' : 'parseAsync'\n ](values, schemaOptions);\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n errors: {} as FieldErrors,\n values: resolverOptions.raw ? values : data,\n };\n } catch (error: any) {\n if (isZodError(error)) {\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n error.errors,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n\n throw error;\n }\n };\n"],"names":["parseErrorSchema","zodErrors","validateAllFieldCriteria","errors","length","error","code","message","_path","path","join","unionError","unionErrors","type","forEach","e","push","types","messages","appendErrors","concat","shift","schema","schemaOptions","resolverOptions","values","_","options","Promise","resolve","mode","then","data","shouldUseNativeValidation","validateFieldsNatively","raw","_catch","Array","isArray","isZodError","toNestErrors","criteriaMode","reject"],"mappings":"wXAKA,IAGMA,EAAmB,SACvBC,EACAC,GAGA,IADA,IAAMC,EAAqC,CAAE,EACtCF,EAAUG,QAAU,CACzB,IAAMC,EAAQJ,EAAU,GAChBK,EAAwBD,EAAxBC,KAAMC,EAAkBF,EAAlBE,QACRC,EAD0BH,EAATI,KACJC,KAAK,KAExB,IAAKP,EAAOK,GACV,GAAI,gBAAiBH,EAAO,CAC1B,IAAMM,EAAaN,EAAMO,YAAY,GAAGT,OAAO,GAE/CA,EAAOK,GAAS,CACdD,QAASI,EAAWJ,QACpBM,KAAMF,EAAWL,KAErB,MACEH,EAAOK,GAAS,CAAED,QAAAA,EAASM,KAAMP,GAUrC,GANI,gBAAiBD,GACnBA,EAAMO,YAAYE,QAAQ,SAACH,GAAU,OACnCA,EAAWR,OAAOW,QAAQ,SAACC,GAAM,OAAAd,EAAUe,KAAKD,EAAE,EAAC,GAInDb,EAA0B,CAC5B,IAAMe,EAAQd,EAAOK,GAAOS,MACtBC,EAAWD,GAASA,EAAMZ,EAAMC,MAEtCH,EAAOK,GAASW,EAAAA,aACdX,EACAN,EACAC,EACAG,EACAY,EACK,GAAgBE,OAAOF,EAAsBb,EAAME,SACpDF,EAAME,QAEd,CAEAN,EAAUoB,OACZ,CAEA,OAAOlB,CACT,gBAGE,SAACmB,EAAQC,EAAeC,GACjBC,YADgC,IAAfD,IAAAA,EAAkB,CAAE,GACrCC,SAAAA,EAAQC,EAAGC,GAAW,IAAA,OAAAC,QAAAC,gCACvBD,QAAAC,QACiBP,EACQ,SAAzBE,EAAgBM,KAAkB,QAAU,cAC5CL,EAAQF,IAAcQ,KAFlBC,SAAAA,GAMN,OAFAL,EAAQM,2BAA6BC,yBAAuB,CAAA,EAAIP,GAEzD,CACLxB,OAAQ,CAAiB,EACzBsB,OAAQD,EAAgBW,IAAMV,EAASO,EACvC,4DAXuBI,CACvB,EAWH,SAAQ/B,GACP,GApEa,SAACA,GAClB,OAAAgC,MAAMC,QAAa,MAALjC,OAAK,EAALA,EAAOF,OAAO,CAmEpBoC,CAAWlC,GACb,MAAO,CACLoB,OAAQ,CAAA,EACRtB,OAAQqC,EAAYA,aAClBxC,EACEK,EAAMF,QACLwB,EAAQM,2BACkB,QAAzBN,EAAQc,cAEZd,IAKN,MAAMtB,CACR,GACF,CAAC,MAAAU,GAAA,OAAAa,QAAAc,OAAA3B,EAAA,CAAA,CAAA"} \ No newline at end of file diff --git a/node_modules/@hookform/resolvers/zod/package.json b/node_modules/@hookform/resolvers/zod/package.json deleted file mode 100644 index 9cf9ee9ee9f3c78ddef5beb73960cc0f38e95224..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@hookform/resolvers/zod", - "amdName": "hookformResolversZod", - "version": "1.0.0", - "private": true, - "description": "React Hook Form validation resolver: zod", - "main": "dist/zod.js", - "module": "dist/zod.module.js", - "umd:main": "dist/zod.umd.js", - "source": "src/index.ts", - "types": "dist/index.d.ts", - "license": "MIT", - "peerDependencies": { - "react-hook-form": "^7.0.0", - "@hookform/resolvers": "^2.0.0" - } -} diff --git a/node_modules/@hookform/resolvers/zod/src/__tests__/Form-native-validation.tsx b/node_modules/@hookform/resolvers/zod/src/__tests__/Form-native-validation.tsx deleted file mode 100644 index 3ac296f91b47289a2867135cbf7699a2ad65090a..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/__tests__/Form-native-validation.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { z } from 'zod'; -import { zodResolver } from '..'; - -const USERNAME_REQUIRED_MESSAGE = 'username field is required'; -const PASSWORD_REQUIRED_MESSAGE = 'password field is required'; - -const schema = z.object({ - username: z.string().nonempty({ message: USERNAME_REQUIRED_MESSAGE }), - password: z.string().nonempty({ message: PASSWORD_REQUIRED_MESSAGE }), -}); - -type FormData = z.infer; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { register, handleSubmit } = useForm({ - resolver: zodResolver(schema), - shouldUseNativeValidation: true, - }); - - return ( -
- - - - - -
- ); -} - -test("form's native validation with Zod", async () => { - const handleSubmit = vi.fn(); - render(); - - // username - let usernameField = screen.getByPlaceholderText( - /username/i, - ) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - let passwordField = screen.getByPlaceholderText( - /password/i, - ) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); - - await user.click(screen.getByText(/submit/i)); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(false); - expect(usernameField.validationMessage).toBe(USERNAME_REQUIRED_MESSAGE); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(false); - expect(passwordField.validationMessage).toBe(PASSWORD_REQUIRED_MESSAGE); - - await user.type(screen.getByPlaceholderText(/username/i), 'joe'); - await user.type(screen.getByPlaceholderText(/password/i), 'password'); - - // username - usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement; - expect(usernameField.validity.valid).toBe(true); - expect(usernameField.validationMessage).toBe(''); - - // password - passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement; - expect(passwordField.validity.valid).toBe(true); - expect(passwordField.validationMessage).toBe(''); -}); diff --git a/node_modules/@hookform/resolvers/zod/src/__tests__/Form.tsx b/node_modules/@hookform/resolvers/zod/src/__tests__/Form.tsx deleted file mode 100644 index 8b792c798b28ef185b95c18897253fd06025fe8c..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/__tests__/Form.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import user from '@testing-library/user-event'; -import React from 'react'; -import { useForm } from 'react-hook-form'; -import { z } from 'zod'; -import { zodResolver } from '..'; - -const schema = z.object({ - username: z.string().nonempty({ message: 'username field is required' }), - password: z.string().nonempty({ message: 'password field is required' }), -}); - -type FormData = z.infer & { unusedProperty: string }; - -interface Props { - onSubmit: (data: FormData) => void; -} - -function TestComponent({ onSubmit }: Props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: zodResolver(schema), // Useful to check TypeScript regressions - }); - - return ( -
- - {errors.username && {errors.username.message}} - - - {errors.password && {errors.password.message}} - - -
- ); -} - -test("form's validation with Zod and TypeScript's integration", async () => { - const handleSubmit = vi.fn(); - render(); - - expect(screen.queryAllByRole('alert')).toHaveLength(0); - - await user.click(screen.getByText(/submit/i)); - - expect(screen.getByText(/username field is required/i)).toBeInTheDocument(); - expect(screen.getByText(/password field is required/i)).toBeInTheDocument(); - expect(handleSubmit).not.toHaveBeenCalled(); -}); diff --git a/node_modules/@hookform/resolvers/zod/src/__tests__/__fixtures__/data.ts b/node_modules/@hookform/resolvers/zod/src/__tests__/__fixtures__/data.ts deleted file mode 100644 index 01923b40e19cd3c2e7e590da3de20c825f9a82a6..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/__tests__/__fixtures__/data.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { Field, InternalFieldName } from 'react-hook-form'; -import { z } from 'zod'; - -export const schema = z - .object({ - username: z.string().regex(/^\w+$/).min(3).max(30), - password: z - .string() - .regex(new RegExp('.*[A-Z].*'), 'One uppercase character') - .regex(new RegExp('.*[a-z].*'), 'One lowercase character') - .regex(new RegExp('.*\\d.*'), 'One number') - .regex( - new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), - 'One special character', - ) - .min(8, 'Must be at least 8 characters in length'), - repeatPassword: z.string(), - accessToken: z.union([z.string(), z.number()]), - birthYear: z.number().min(1900).max(2013).optional(), - email: z.string().email().optional(), - tags: z.array(z.string()), - enabled: z.boolean(), - url: z.string().url('Custom error url').or(z.literal('')), - like: z - .array( - z.object({ - id: z.number(), - name: z.string().length(4), - }), - ) - .optional(), - dateStr: z - .string() - .transform((value) => new Date(value)) - .refine((value) => !isNaN(value.getTime()), { - message: 'Invalid date', - }), - }) - .refine((obj) => obj.password === obj.repeatPassword, { - message: 'Passwords do not match', - path: ['confirm'], - }); - -export const validData: z.input = { - username: 'Doe', - password: 'Password123_', - repeatPassword: 'Password123_', - birthYear: 2000, - email: 'john@doe.com', - tags: ['tag1', 'tag2'], - enabled: true, - accessToken: 'accessToken', - url: 'https://react-hook-form.com/', - like: [ - { - id: 1, - name: 'name', - }, - ], - dateStr: '2020-01-01', -}; - -export const invalidData = { - password: '___', - email: '', - birthYear: 'birthYear', - like: [{ id: 'z' }], - url: 'abc', -}; - -export const fields: Record = { - username: { - ref: { name: 'username' }, - name: 'username', - }, - password: { - ref: { name: 'password' }, - name: 'password', - }, - email: { - ref: { name: 'email' }, - name: 'email', - }, - birthday: { - ref: { name: 'birthday' }, - name: 'birthday', - }, -}; diff --git a/node_modules/@hookform/resolvers/zod/src/__tests__/__snapshots__/zod.ts.snap b/node_modules/@hookform/resolvers/zod/src/__tests__/__snapshots__/zod.ts.snap deleted file mode 100644 index 169a9bfebb0a58e90666b6b0b251fbbca36765df..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/__tests__/__snapshots__/zod.ts.snap +++ /dev/null @@ -1,430 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`zodResolver > should return a single error from zodResolver when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "birthYear": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - }, - "dateStr": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "email": { - "message": "Invalid email", - "ref": { - "name": "email", - }, - "type": "invalid_string", - }, - "enabled": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "like": [ - { - "id": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - }, - "name": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "invalid_string", - }, - "repeatPassword": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "tags": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "url": { - "message": "Custom error url", - "ref": undefined, - "type": "invalid_string", - }, - "username": { - "message": "Required", - "ref": { - "name": "username", - }, - "type": "invalid_type", - }, - }, - "values": {}, -} -`; - -exports[`zodResolver > should return a single error from zodResolver with \`mode: sync\` when validation fails 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "birthYear": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - }, - "dateStr": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "email": { - "message": "Invalid email", - "ref": { - "name": "email", - }, - "type": "invalid_string", - }, - "enabled": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "like": [ - { - "id": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - }, - "name": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "invalid_string", - }, - "repeatPassword": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "tags": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - }, - "url": { - "message": "Custom error url", - "ref": undefined, - "type": "invalid_string", - }, - "username": { - "message": "Required", - "ref": { - "name": "username", - }, - "type": "invalid_type", - }, - }, - "values": {}, -} -`; - -exports[`zodResolver > should return all the errors from zodResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": [ - "Required", - "Required", - ], - "invalid_union": "Invalid input", - }, - }, - "birthYear": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Expected number, received string", - }, - }, - "dateStr": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "email": { - "message": "Invalid email", - "ref": { - "name": "email", - }, - "type": "invalid_string", - "types": { - "invalid_string": "Invalid email", - }, - }, - "enabled": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "like": [ - { - "id": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Expected number, received string", - }, - }, - "name": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "invalid_string", - "types": { - "invalid_string": [ - "One uppercase character", - "One lowercase character", - "One number", - ], - "too_small": "Must be at least 8 characters in length", - }, - }, - "repeatPassword": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "tags": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "url": { - "message": "Custom error url", - "ref": undefined, - "type": "invalid_string", - "types": { - "invalid_string": "Custom error url", - }, - }, - "username": { - "message": "Required", - "ref": { - "name": "username", - }, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - }, - "values": {}, -} -`; - -exports[`zodResolver > should return all the errors from zodResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = ` -{ - "errors": { - "accessToken": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": [ - "Required", - "Required", - ], - "invalid_union": "Invalid input", - }, - }, - "birthYear": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Expected number, received string", - }, - }, - "dateStr": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "email": { - "message": "Invalid email", - "ref": { - "name": "email", - }, - "type": "invalid_string", - "types": { - "invalid_string": "Invalid email", - }, - }, - "enabled": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "like": [ - { - "id": { - "message": "Expected number, received string", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Expected number, received string", - }, - }, - "name": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - }, - ], - "password": { - "message": "One uppercase character", - "ref": { - "name": "password", - }, - "type": "invalid_string", - "types": { - "invalid_string": [ - "One uppercase character", - "One lowercase character", - "One number", - ], - "too_small": "Must be at least 8 characters in length", - }, - }, - "repeatPassword": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "tags": { - "message": "Required", - "ref": undefined, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - "url": { - "message": "Custom error url", - "ref": undefined, - "type": "invalid_string", - "types": { - "invalid_string": "Custom error url", - }, - }, - "username": { - "message": "Required", - "ref": { - "name": "username", - }, - "type": "invalid_type", - "types": { - "invalid_type": "Required", - }, - }, - }, - "values": {}, -} -`; - -exports[`zodResolver > should return parsed values from zodResolver with \`mode: sync\` when validation pass 1`] = ` -{ - "errors": {}, - "values": { - "accessToken": "accessToken", - "birthYear": 2000, - "dateStr": 2020-01-01T00:00:00.000Z, - "email": "john@doe.com", - "enabled": true, - "like": [ - { - "id": 1, - "name": "name", - }, - ], - "password": "Password123_", - "repeatPassword": "Password123_", - "tags": [ - "tag1", - "tag2", - ], - "url": "https://react-hook-form.com/", - "username": "Doe", - }, -} -`; diff --git a/node_modules/@hookform/resolvers/zod/src/__tests__/zod.ts b/node_modules/@hookform/resolvers/zod/src/__tests__/zod.ts deleted file mode 100644 index c272c809376d7cdf6a2d24ad5c8d4f4df686b8fb..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/__tests__/zod.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { zodResolver } from '..'; -import { fields, invalidData, schema, validData } from './__fixtures__/data'; - -const shouldUseNativeValidation = false; - -describe('zodResolver', () => { - it('should return values from zodResolver when validation pass & raw=true', async () => { - const parseAsyncSpy = vi.spyOn(schema, 'parseAsync'); - - const result = await zodResolver(schema, undefined, { - raw: true, - })(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(parseAsyncSpy).toHaveBeenCalledTimes(1); - expect(result).toEqual({ errors: {}, values: validData }); - }); - - it('should return parsed values from zodResolver with `mode: sync` when validation pass', async () => { - const parseSpy = vi.spyOn(schema, 'parse'); - const parseAsyncSpy = vi.spyOn(schema, 'parseAsync'); - - const result = await zodResolver(schema, undefined, { - mode: 'sync', - })(validData, undefined, { fields, shouldUseNativeValidation }); - - expect(parseSpy).toHaveBeenCalledTimes(1); - expect(parseAsyncSpy).not.toHaveBeenCalled(); - expect(result.errors).toEqual({}); - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from zodResolver when validation fails', async () => { - const result = await zodResolver(schema)(invalidData, undefined, { - fields, - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return a single error from zodResolver with `mode: sync` when validation fails', async () => { - const parseSpy = vi.spyOn(schema, 'parse'); - const parseAsyncSpy = vi.spyOn(schema, 'parseAsync'); - - const result = await zodResolver(schema, undefined, { - mode: 'sync', - })(invalidData, undefined, { fields, shouldUseNativeValidation }); - - expect(parseSpy).toHaveBeenCalledTimes(1); - expect(parseAsyncSpy).not.toHaveBeenCalled(); - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from zodResolver when validation fails with `validateAllFieldCriteria` set to true', async () => { - const result = await zodResolver(schema)(invalidData, undefined, { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }); - - expect(result).toMatchSnapshot(); - }); - - it('should return all the errors from zodResolver when validation fails with `validateAllFieldCriteria` set to true and `mode: sync`', async () => { - const result = await zodResolver(schema, undefined, { mode: 'sync' })( - invalidData, - undefined, - { - fields, - criteriaMode: 'all', - shouldUseNativeValidation, - }, - ); - - expect(result).toMatchSnapshot(); - }); - - it('should throw any error unrelated to Zod', async () => { - const schemaWithCustomError = schema.refine(() => { - throw Error('custom error'); - }); - const promise = zodResolver(schemaWithCustomError)(validData, undefined, { - fields, - shouldUseNativeValidation, - }); - - await expect(promise).rejects.toThrow('custom error'); - }); -}); diff --git a/node_modules/@hookform/resolvers/zod/src/index.ts b/node_modules/@hookform/resolvers/zod/src/index.ts deleted file mode 100644 index a60a00ebbc8934ae351edcb0715ed7510c4e847d..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './zod'; -export * from './types'; diff --git a/node_modules/@hookform/resolvers/zod/src/types.ts b/node_modules/@hookform/resolvers/zod/src/types.ts deleted file mode 100644 index 162e649dcee1c6f01bc9b5117941d34fe7ab426f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/types.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form'; -import { z } from 'zod'; - -export type Resolver = >( - schema: T, - schemaOptions?: Partial, - factoryOptions?: { - /** - * @default async - */ - mode?: 'async' | 'sync'; - /** - * Return the raw input values rather than the parsed values. - * @default false - */ - raw?: boolean; - }, -) => ( - values: TFieldValues, - context: TContext | undefined, - options: ResolverOptions, -) => Promise>; diff --git a/node_modules/@hookform/resolvers/zod/src/zod.ts b/node_modules/@hookform/resolvers/zod/src/zod.ts deleted file mode 100644 index 0cdfcb33bcdff70f0989f26c0f49640bdcbae98f..0000000000000000000000000000000000000000 --- a/node_modules/@hookform/resolvers/zod/src/zod.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers'; -import { FieldError, FieldErrors, appendErrors } from 'react-hook-form'; -import { ZodError, z } from 'zod'; -import type { Resolver } from './types'; - -const isZodError = (error: any): error is ZodError => - Array.isArray(error?.errors); - -const parseErrorSchema = ( - zodErrors: z.ZodIssue[], - validateAllFieldCriteria: boolean, -) => { - const errors: Record = {}; - for (; zodErrors.length; ) { - const error = zodErrors[0]; - const { code, message, path } = error; - const _path = path.join('.'); - - if (!errors[_path]) { - if ('unionErrors' in error) { - const unionError = error.unionErrors[0].errors[0]; - - errors[_path] = { - message: unionError.message, - type: unionError.code, - }; - } else { - errors[_path] = { message, type: code }; - } - } - - if ('unionErrors' in error) { - error.unionErrors.forEach((unionError) => - unionError.errors.forEach((e) => zodErrors.push(e)), - ); - } - - if (validateAllFieldCriteria) { - const types = errors[_path].types; - const messages = types && types[error.code]; - - errors[_path] = appendErrors( - _path, - validateAllFieldCriteria, - errors, - code, - messages - ? ([] as string[]).concat(messages as string[], error.message) - : error.message, - ) as FieldError; - } - - zodErrors.shift(); - } - - return errors; -}; - -export const zodResolver: Resolver = - (schema, schemaOptions, resolverOptions = {}) => - async (values, _, options) => { - try { - const data = await schema[ - resolverOptions.mode === 'sync' ? 'parse' : 'parseAsync' - ](values, schemaOptions); - - options.shouldUseNativeValidation && validateFieldsNatively({}, options); - - return { - errors: {} as FieldErrors, - values: resolverOptions.raw ? values : data, - }; - } catch (error: any) { - if (isZodError(error)) { - return { - values: {}, - errors: toNestErrors( - parseErrorSchema( - error.errors, - !options.shouldUseNativeValidation && - options.criteriaMode === 'all', - ), - options, - ), - }; - } - - throw error; - } - }; diff --git a/node_modules/@neondatabase/serverless/CHANGELOG.md b/node_modules/@neondatabase/serverless/CHANGELOG.md deleted file mode 100644 index dadebbc4d73f6ac76b94d0bb223934b779e56283..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/CHANGELOG.md +++ /dev/null @@ -1,49 +0,0 @@ -## 0.10.1 (2024-10-07) - -Fix `CONFIG.MD` documentation. - -## 0.10.0 (2024-10-07) - -Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available. - -Allow authentication through `JWT` by adding a `authToken` property to the `neon` HTTP connection options. - -## 0.9.3 (2024-05-09) - -Expose all error information fields on `NeonDbError` objects thrown when using the http fetch transport. - -## 0.9.2 (2024-05-09) - -JSR README updates only. - -## 0.9.1 (2024-04-15) - -Pass username (and database name) through URL decoder, so all usernames can successfully authorize. - -## 0.9.0 (2024-02-27) - -Deprecate `fetchConnectionCache` option, which is now always enabled. For `neon` http fetch queries, enable setting options on individual queries within a batch `transaction` (but note that the types still do not allow this). - -## 0.8.1 (2024-02-07) - -Revert single per-region domain for WebSockets. Fix treatment of -pooler connection hosts. - -## 0.8.0 (2024-02-06) - -Use a single (per-region) domain name for all connections to Neon databases. Intended to help with connection caching in V8. Passes the endpoint ID inside connection options for WebSocket connections. - -## 0.7.2 (2024-01-10) - -Export a full ESM build to index.mjs -- don't just wrap the CJS code -- since no wrapping method seems reliable across bundlers and platforms. It's now important to only `require` or only `import` the package: if you mix, you'll get two copies of the code that don't share configuration changes. - -## 0.7.1 (2024-01-09) - -Fixed index.d.mts. - -## 0.7.0 (2024-01-08) - -Altered ESM re-export technique (in index.mjs) to work around WebPack issues. Added a re-export of TypeScript types (as index.d.mts) to fix the 'Masquerading as CJS' warning from https://arethetypeswrong.github.io/. - -## 0.6.1 (2023-12-19) - -WebSocket connection errors are now reported properly via `client.on('error', err => { /* ... */ })`. diff --git a/node_modules/@neondatabase/serverless/CONFIG.md b/node_modules/@neondatabase/serverless/CONFIG.md deleted file mode 100644 index 3a5fe70adf15d5de4d2a8a66e98c4e8168ce0819..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/CONFIG.md +++ /dev/null @@ -1,311 +0,0 @@ -# Options and configuration - -## `neon(...)` function - -The `neon(...)` function returns a query function that can be used both as a tagged-template function and as an ordinary function: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); - -// as a tagged-template function -const rowsA = await sql`SELECT * FROM posts WHERE id = ${postId}`; - -// as an ordinary function (exactly equivalent) -const rowsB = await sql('SELECT * FROM posts WHERE id = $1', [postId]); -``` - -By default, the query function returned by `neon(...)` returns only the rows resulting from the provided SQL query, and it returns them as an array of objects where the keys are column names. For example: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); -const rows = await sql`SELECT * FROM posts WHERE id = ${postId}`; -// -> [{ id: 12, title: "My post", ... }] -``` - -However, you can customise the return format of the query function using the configuration options `fullResults` and `arrayMode`. These options are available both on the `neon(...)` function and on the query function it returns (but only when the query function is called as an ordinary function, not as a tagged-template function). - -### `arrayMode: boolean` - -When `arrayMode` is true, rows are returned as an array of arrays instead of an array of objects: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL, { arrayMode: true }); -const rows = await sql`SELECT * FROM posts WHERE id = ${postId}`; -// -> [[12, "My post", ...]] -``` - -Or, with the same effect: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); -const rows = await sql('SELECT * FROM posts WHERE id = $1', [postId], { - arrayMode: true, -}); -// -> [[12, "My post", ...]] -``` - -### `fullResults: boolean` - -When `fullResults` is true, additional metadata is returned alongside the result rows, which are then found in the `rows` property of the return value. The metadata matches what would be returned by node-postgres: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL, { fullResults: true }); -const results = await sql`SELECT * FROM posts WHERE id = ${postId}`; -/* -> { - rows: [{ id: 12, title: "My post", ... }], - fields: [ - { name: "id", dataTypeID: 23, ... }, - { name: "title", dataTypeID: 25, ... }, - ... - ], - rowCount: 1, - rowAsArray: false, - command: "SELECT" -} -*/ -``` - -Or, with the same effect: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); -const results = await sql('SELECT * FROM posts WHERE id = $1', [postId], { - fullResults: true, -}); -// -> { ... same as above ... } -``` - -### `fetchOptions: Record` - -The `fetchOptions` option can be passed to `neon(...)`, the `transaction` function, or the query function (if not within a `transaction` function). This option takes an object that is merged with the options to the `fetch` call. - -For example, to increase the priority of every database `fetch` request: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL, { - fetchOptions: { priority: 'high' }, -}); -const rows = await sql`SELECT * FROM posts WHERE id = ${postId}`; -``` - -Or to implement a `fetch` timeout: - -```typescript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); -const abortController = new AbortController(); -const timeout = setTimeout(() => abortController.abort('timed out'), 10000); -const rows = await sql('SELECT * FROM posts WHERE id = $1', [postId], { - fetchOptions: { signal: abortController.signal }, -}); // throws an error if no result received within 10s -clearTimeout(timeout); -``` - -### `authToken: string | (() => Promise | string)` - -The `authToken` option can be passed to `neon(...)` to set the `Authorization` header for the `fetch` request. This allows you to authenticate database requests against third-party authentication providers. So, this mechanism can be used to ensure that access control and authorization are managed effectively across different systems. - -Example of usage: - -```typescript -import { neon } from '@neondatabase/serverless'; -// Retrieve the JWT token (implementation depends on your auth system) -const authToken = getAuthToken(); -// Initialize the Neon client with a connection string and auth token -const sql = neon(process.env.DATABASE_URL, { authToken }); -// Run a query -const posts = await sql('SELECT * FROM posts'); -``` - -## `transaction(...)` function - -The `transaction(queriesOrFn, options)` function is exposed as a property on the query function. It allows multiple queries to be executed within a single, non-interactive transaction. - -The first argument to `transaction()`, `queriesOrFn`, is either (1) an array of queries or (2) a non-`async` function that receives a query function as its argument and returns an array of queries. - -The array-of-queries case looks like this: - -```javascript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); -const showLatestN = 10; - -const [posts, tags] = await sql.transaction( - [ - sql`SELECT * FROM posts ORDER BY posted_at DESC LIMIT ${showLatestN}`, - sql`SELECT * FROM tags`, - ], - { - isolationLevel: 'RepeatableRead', - readOnly: true, - }, -); -``` - -Or as an example of the function case: - -```javascript -const [authors, tags] = await neon(process.env.DATABASE_URL).transaction( - (txn) => [txn`SELECT * FROM authors`, txn`SELECT * FROM tags`], -); -``` - -The optional second argument to `transaction()`, `options`, has the same keys as the options to the ordinary query function -- `arrayMode`, `fullResults` and `fetchOptions` -- plus three additional keys that concern the transaction configuration. These transaction-related keys are: `isolationMode`, `readOnly` and `deferrable`. They are described below. Defaults for the transaction-related keys can also be set as options to the `neon` function. - -The `fetchOptions` option cannot be supplied for individual queries inside `transaction()`, since only a single `fetch` is performed for the transaction as a whole. The TypeScript types also currently do not allow `arrayMode` or `fullResults` options to be supplied for individual queries within `transaction()` (although this does have the expected effect if the type errors are ignored). - -### `isolationMode` - -This option selects a Postgres [transaction isolation mode](https://www.postgresql.org/docs/current/transaction-iso.html). If present, it must be one of: `'ReadUncommitted'`, `'ReadCommitted'`, `'RepeatableRead'` or `'Serializable'`. - -### `readOnly` - -If `true`, this option ensures that a `READ ONLY` transaction is used to execute the queries passed. - -### `deferrable` - -If `true` (and if `readOnly` is also `true`, and `isolationMode` is `'Serializable'`), this option ensures that a `DEFERRABLE` transaction is used to execute the queries passed. - -## `neonConfig` configuration - -In most cases, there are two ways to set configuration options: - -1. Import `neonConfig` from the package and set global default options on that. -2. Set options on individual `Client` instances using their `neonConfig` property. - -For example: - -```javascript -import { Client, neonConfig } from '@neondatabase/serverless'; -import ws from 'ws'; - -// set default option for all clients -neonConfig.webSocketConstructor = ws; - -// override the default option on an individual client -const client = new Client(process.env.DATABASE_URL); -client.neonConfig.webSocketConstructor = ws; -``` - -A few configuration options can only be set globally, and these are noted as such below. - -#### `webSocketConstructor: typeof WebSocket | undefined` - -Set this parameter if you're using the driver in an environment where the `WebSocket` global is not defined, such as Node.js, and you need transaction or session support. - -For example: - -```javascript -import { neonConfig } from '@neondatabase/serverless'; -import ws from 'ws'; -neonConfig.webSocketConstructor = ws; -``` - -### Advanced configuration - -If you're using `@neondatabase/serverless` to connect to a Neon database, you usually **won't** need to touch the following configuration options. These options are intended for testing, troubleshooting, and supporting access to non-Neon Postgres instances via self-hosted WebSocket proxies. - -#### `poolQueryViaFetch: boolean` - -**Experimentally**, when `poolQueryViaFetch` is `true` and no listeners for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP `fetch` request. - -Default: currently `false` (but may be `true` in future). - -Note: this option can only be set globally, **not** on an individual `Client` instance. - -#### `fetchEndpoint: string | ((host: string, port: number | string) => string)` - -Set `fetchEndpoint` to set the server endpoint to be sent queries via http fetch. - -This may be useful for local development (e.g. to set a port that's not the default 443). - -Provide either the full endpoint URL, or a function that takes the database host address and port and returns the full endpoint URL (including protocol). - -Default: `host => 'https://' + host + '/sql'` - -Note: this option can only be set globally, **not** on an individual `Client` instance. - -#### `fetchFunction: any` - -The `fetchFunction` option allows you to supply an alternative function for making http requests. The function must accept the same arguments as native `fetch`. - -Default: `undefined`. - -Note: this option can only be set globally, **not** on an individual `Client` instance. - -#### `wsProxy: string | (host: string, port: number | string) => string` - -If connecting to a non-Neon database, the `wsProxy` option should point to [your WebSocket proxy](DEPLOY.md). It can either be a string, which will have `?address=host:port` appended to it, or a function with the signature `(host: string, port: number | string) => string`. Either way, the protocol must _not_ be included, because this depends on other options. For example, when using the `wsproxy` proxy, the `wsProxy` option should look something like this: - -```javascript -// either: -neonConfig.wsProxy = (host, port) => - `my-wsproxy.example.com/v1?address=${host}:${port}`; -// or (with identical effect): -neonConfig.wsProxy = 'my-wsproxy.example.com/v1'; -``` - -Default: `host => host + '/v2'`. - -#### `pipelineConnect: "password" | false` - -To speed up connection times, the driver will pipeline the first three messages to the database (startup, authentication and first query) if `pipelineConnect` is set to `"password"`. Note that this will only work if you've configured cleartext password authentication for the relevant user and database. - -If your connection doesn't support password authentication, set `pipelineConnect` to `false` instead. - -Default: `"password"`. - -#### `coalesceWrites: boolean` - -When this option is `true`, multiple network writes generated in a single iteration of the JavaScript run-loop are coalesced into a single WebSocket message. Since node-postgres sends a lot of very short messages, this may reduce TCP/IP overhead. - -Default: `true`. - -#### `forceDisablePgSSL: boolean` - -This option disables TLS encryption in the Postgres protocol (as set via e.g. `?sslmode=require` in the connection string). Security is not compromised if used in conjunction with `useSecureWebSocket = true`. - -Default: `true`. - -#### `useSecureWebSocket: boolean` - -This option switches between secure (the default) and insecure WebSockets. - -To use experimental pure-JS encryption, set `useSecureWebSocket = false` and `forceDisablePgSSL = false`, and append `?sslmode=verify-full` to your database connection string. - -**Remember that pure-JS encryption is currently experimental and not suitable for use in production.** - -Default: `true`. - -#### `subtls: any` - -**Only when using experimental pure-JS TLS encryption**, you must supply the [subtls](https://github.com/jawj/subtls) TLS library to the `subtls` option like so: - -```typescript -import { neonConfig } from '@neondatabase/serverless'; -import * as subtls from 'subtls'; -neonConfig.subtls = subtls; -``` - -Default: `undefined`. - -#### `rootCerts: string /* PEM format */` - -**Only when using experimental pure-JS TLS encryption**, the `rootCerts` option determines what root (certificate authority) certificates are trusted. - -Its value is a string containing zero or more certificates in PEM format. - -Default: `""` (the empty string). - -#### `pipelineTLS: boolean` - -**Only when using experimental pure-JS encryption**, the driver will pipeline the SSL request message and TLS Client Hello if `pipelineTLS` is set to `true`. Currently, this is only supported by Neon database hosts, and will fail when communicating with an ordinary Postgres or pgbouncer back-end. - -Default: `false`. diff --git a/node_modules/@neondatabase/serverless/DEPLOY.md b/node_modules/@neondatabase/serverless/DEPLOY.md deleted file mode 100644 index 6360612dcff4c0ce8986764babf378c477ee5b1c..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/DEPLOY.md +++ /dev/null @@ -1,132 +0,0 @@ -# Deploying a WebSocket proxy in front of your own Postgres instance - -**This package comes configured to connect to a Neon database over a secure (`wss:`) WebSocket. If you're using a Neon database, you can ignore what follows.** - -But you can also run your own WebSocket proxy, and configure it to allow onward connections to your own Postgres instances. - -First, you'll need to set up the proxy itself somewhere public-facing (or on `localhost` for development). See https://github.com/neondatabase/wsproxy for the Go code and instructions. - -There are then two ways you can secure this: - -1. Set up nginx as a TLS proxy in front of `wsproxy`. Example shell commands to achieve this can be found below. Onward traffic to Postgres is not secured by this method, so Postgres should be running on the same machine or be reached over a private network. - -2. Use experimental pure-JS Postgres connection encryption via [subtls](https://github.com/jawj/subtls). There's no need for nginx in this scenario, and the Postgres connection is encrypted end-to-end. You get this form of encryption if you set both `neonConfig.useSecureWebSocket` and `neonConfig.forceDisablePgSSL` to `false`, and append `?sslmode=verify-full` (or similar) to your connection string. TLS version 1.3 must be supported by the Postgres back-end. **Please note that subtls is experimental software and this configuration is not recommended for production use.** - -Second, you'll need to set some [configuration options](CONFIG.md) on this package: at a minimum the `wsProxy` option and (if using experimental encryption) `subtls` and `rootCerts`. - -## Example shell commands - -To deploy `wsproxy` behind nginx (for TLS) on a host `ws.example.com` running Ubuntu 22.04 (and Postgres locally), you'd do something similar to the following. - -Before you start: - -1. Ensure port 443 is accessible on this machine. You might need to change firewall settings with your platform provider. - -2. Upgrade to Ubuntu 22.04 if on an earlier version (golang is too old on older releases): - -```bash -sudo su # do this all as root -apt update -y && apt upgrade -y && apt dist-upgrade -y -apt autoremove -y && apt autoclean -y -apt install -y update-manager-core -do-release-upgrade # and answer yes to all defaults -``` - -Then: - -```bash -sudo su # do this all as root - -export HOSTDOMAIN=ws.example.com # edit the domain name for your case - -# if required: install postgres + create a password-auth user - -apt install -y postgresql - -echo 'create database wstest; create user wsclear; grant all privileges on database wstest to wsclear;' | sudo -u postgres psql - -sudo -u postgres psql # and run: \password wsclear - -perl -pi -e 's/^# IPv4 local connections:\n/# IPv4 local connections:\nhost all wsclear 127.0.0.1\/32 password\n/' /etc/postgresql/14/main/pg_hba.conf - -service postgresql restart - -# install wsproxy - -adduser wsproxy --disabled-login - -sudo su wsproxy -cd -git clone https://github.com/neondatabase/wsproxy.git -cd wsproxy -go build -exit - -echo " -[Unit] -Description=wsproxy - -[Service] -Type=simple -Restart=always -RestartSec=5s -User=wsproxy -Environment=LISTEN_PORT=:6543 ALLOW_ADDR_REGEX='^${HOSTDOMAIN}:5432\$' -ExecStart=/home/wsproxy/wsproxy/wsproxy - -[Install] -WantedBy=multi-user.target -" > /lib/systemd/system/wsproxy.service - -systemctl enable wsproxy -service wsproxy start - -# install nginx as tls proxy - -apt install -y golang nginx certbot python3-certbot-nginx - -echo "127.0.0.1 ${HOSTDOMAIN}" >> /etc/hosts - -echo " -server { - listen 80; - listen [::]:80; - server_name ${HOSTDOMAIN}; - location / { - proxy_pass http://127.0.0.1:6543/; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection Upgrade; - proxy_set_header Host \$host; - } -} -" > /etc/nginx/sites-available/wsproxy - -ln -s /etc/nginx/sites-available/wsproxy /etc/nginx/sites-enabled/wsproxy - -certbot --nginx -d ${HOSTDOMAIN} - -echo " -server { - server_name ${HOSTDOMAIN}; - - location / { - proxy_pass http://127.0.0.1:6543/; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection Upgrade; - proxy_set_header Host \$host; - } - - listen [::]:80 ipv6only=on; - listen 80; - - listen [::]:443 ssl ipv6only=on; # managed by Certbot - listen 443 ssl; # managed by Certbot - ssl_certificate /etc/letsencrypt/live/${HOSTDOMAIN}/fullchain.pem; # managed by Certbot - ssl_certificate_key /etc/letsencrypt/live/${HOSTDOMAIN}/privkey.pem; # managed by Certbot - include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot -} -" > /etc/nginx/sites-available/wsproxy - -service nginx restart -``` diff --git a/node_modules/@neondatabase/serverless/DEVELOP.md b/node_modules/@neondatabase/serverless/DEVELOP.md deleted file mode 100644 index b69c017c91046c92e12d5b06462cee7b672dcb7b..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/DEVELOP.md +++ /dev/null @@ -1,24 +0,0 @@ -# Development and contributing - -The code is at https://github.com/neondatabase/serverless. Most of the interesting stuff is in `shims/net/index.ts` and the `export/` folder. - -- To update the npm & jsr package: - -```bash -npm run export -cd dist/npm -npm version patch # or minor or major -npm publish - -# Copy npm version -jq --arg v "$(jq -r .version dist/npm/package.json)" '.version = $v' dist/jsr/jsr.json > dist/jsr/jsr.json.tmp && mv dist/jsr/jsr.json.tmp dist/jsr/jsr.json - -# Publish jsr package -npx jsr publish -``` - -- To run or deploy the simple test app on Cloudflare, create a `.dev.vars` file containing `NEON_DB_URL=postgres://connection_string`, run `npx wrangler dev --local` or `npx wrangler publish`. - -- To run the latencies test app in a browser, create a `.dev.vars` file as above, run `npm run browser` and visit `http://localhost:7070/dist/browser/`. To include debug output and avoid minification, use `npm run browserDebug` instead. - -- To run the latencies test app in node, create a `.dev.vars` file as above and run `npm run node`. To include debug output and avoid minification, use `npm run nodeDebug` instead. diff --git a/node_modules/@neondatabase/serverless/LICENSE b/node_modules/@neondatabase/serverless/LICENSE deleted file mode 100644 index b213c55af289075da6ada50b32f309ccf1c0befa..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 - 2024 Neon Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@neondatabase/serverless/README.md b/node_modules/@neondatabase/serverless/README.md deleted file mode 100644 index e361b0981eda0dec4cf44a5e03035dde34dbee1d..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/README.md +++ /dev/null @@ -1,283 +0,0 @@ -# @neondatabase/serverless - -`@neondatabase/serverless` is [Neon](https://neon.tech)'s PostgreSQL driver for JavaScript and TypeScript. It's: - -- **Low-latency**, thanks to [message pipelining](https://neon.tech/blog/quicker-serverless-postgres) and other optimizations -- **Ideal for serverless/edge** deployment, using https and WebSockets in place of TCP -- **A drop-in replacement** for [node-postgres](https://node-postgres.com/), aka [`pg`](https://www.npmjs.com/package/pg) (on which it's based) - -## Get started - -### Install it - -Install it with your preferred JavaScript package manager. It's named `@neondatabase/serverless` on npm and `@neon/serverless` on JSR. So, for example: - -```bash -npm install @neondatabase/serverless -``` - -or - -```bash -bunx jsr add @neon/serverless -``` - -Using TypeScript? No worries: types are included either way. - -### Configure it - -Get your connection string from the [Neon console](https://console.neon.tech/) and set it as an environment variable. Something like: - -``` -DATABASE_URL=postgres://username:password@host.neon.tech/neondb -``` - -### Use it - -For one-shot queries, use the `neon` function. For instance: - -```javascript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); - -const [post] = await sql`SELECT * FROM posts WHERE id = ${postId}`; -// `post` is now { id: 12, title: 'My post', ... } (or undefined) -``` - -Note: interpolating `${postId}` here is [safe from SQL injection](https://neon.tech/blog/sql-template-tags). - -### Deploy it - -Turn this example into a complete API endpoint deployed on [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) at `https://myapp.vercel.dev/api/post?postId=123` by following two simple steps: - -1. Create a new file `api/post.ts`: - -```javascript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); - -export default async (req: Request, ctx: any) => { - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await sql`SELECT * FROM posts WHERE id = ${postId}`; - if (!post) return new Response('Not found', { status: 404 }); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); -} - -export const config = { - runtime: 'edge', - regions: ['iad1'], // specify the region nearest your Neon DB -}; -``` - -2. Test and deploy - -```bash -npm install -g vercel # install vercel CLI -npx vercel env add DATABASE_URL # paste Neon connection string, select all environments -npx vercel dev # check working locally, then ... -npx vercel deploy -``` - -The `neon` query function has a few [additional options](CONFIG.md). - -## Sessions, transactions, and node-postgres compatibility - -A query using the `neon` function, as shown above, is carried by an https [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) request. - -This should work — and work fast — from any modern JavaScript environment. But you can only send one query at a time this way: sessions and transactions are not supported. - -### `transaction()` - -Multiple queries can be issued via fetch request within a single, non-interactive transaction by using the `transaction()` function. This is exposed as a property on the query function. - -For example: - -```javascript -import { neon } from '@neondatabase/serverless'; -const sql = neon(process.env.DATABASE_URL); -const showLatestN = 10; - -const [posts, tags] = await sql.transaction([ - sql`SELECT * FROM posts ORDER BY posted_at DESC LIMIT ${showLatestN}`, - sql`SELECT * FROM tags`, -]); -``` - -There are some [additional options](CONFIG.md) when using `transaction()`. - -### `Pool` and `Client` - -Use the `Pool` or `Client` constructors, instead of the functions described above, when you need: - -- **session or interactive transaction support**, and/or - -- **compatibility with node-postgres**, which supports query libraries like [Kysely](https://kysely.dev/) or [Zapatos](https://jawj.github.io/zapatos/). - -Queries using `Pool` and `Client` are carried by WebSockets. There are **two key things** to know about this: - -1. **In Node.js** and some other environments, there's no built-in WebSocket support. In these cases, supply a WebSocket constructor function. - -2. **In serverless environments** such as Vercel Edge Functions or Cloudflare Workers, WebSocket connections can't outlive a single request. - - That means `Pool` or `Client` objects must be connected, used and closed **within a single request handler**. Don't create them outside a request handler; don't create them in one handler and try to reuse them in another; and to avoid exhausting available connections, don't forget to close them. - -These points are demonstrated in the examples below. - -### API - -- **The full API guide** to `Pool` and `Client` can be found in the [node-postgres docs](https://node-postgres.com/). - -- There are a few [additional configuration options](CONFIG.md) that apply to `Pool` and `Client` here. - -## Example: Node.js with `Pool.connect()` - -In Node.js, it takes two lines to configure WebSocket support. For example: - -```javascript -import { Pool, neonConfig } from '@neondatabase/serverless'; - -import ws from 'ws'; -neonConfig.webSocketConstructor = ws; // <-- this is the key bit - -const pool = new Pool({ connectionString: process.env.DATABASE_URL }); -pool.on('error', (err) => console.error(err)); // deal with e.g. re-connect -// ... - -const client = await pool.connect(); - -try { - await client.query('BEGIN'); - const { - rows: [{ id: postId }], - } = await client.query('INSERT INTO posts (title) VALUES ($1) RETURNING id', [ - 'Welcome', - ]); - await client.query('INSERT INTO photos (post_id, url) VALUES ($1, $2)', [ - postId, - 's3.bucket/photo/url', - ]); - await client.query('COMMIT'); -} catch (err) { - await client.query('ROLLBACK'); - throw err; -} finally { - client.release(); -} - -// ... -await pool.end(); -``` - -Other WebSocket libraries are available. For example, you could replace `ws` in the above example with `undici`: - -```typescript -import { WebSocket } from 'undici'; -neonConfig.webSocketConstructor = WebSocket; -``` - -## Example: Vercel Edge Function with `Pool.query()` - -We can rewrite the Vercel Edge Function shown above (under the heading 'Deploy it') to use `Pool`, as follows: - -```javascript -import { Pool } from '@neondatabase/serverless'; - -// *don't* create a `Pool` or `Client` here, outside the request handler - -export default async (req: Request, ctx: any) => { - // create a `Pool` inside the request handler - const pool = new Pool({ connectionString: process.env.DATABASE_URL }); - - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await pool.query('SELECT * FROM posts WHERE id = $1', [postId]); - if (!post) return new Response('Not found', { status: 404 }); - - // end the `Pool` inside the same request handler - // (unlike `await`, `ctx.waitUntil` won't hold up the response) - ctx.waitUntil(pool.end()); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); -} - -export const config = { - runtime: 'edge', - regions: ['iad1'], // specify the region nearest your Neon DB -}; -``` - -Note: we don't actually use the pooling capabilities of `Pool` in this example. But it's slightly briefer than using `Client` and, because `Pool.query` is designed for one-shot queries, we may in future automatically route these queries over https for lower latency. - -## Example: Vercel Edge Function with `Client` - -Using `Client` instead, the example looks like this: - -```javascript -import { Client } from '@neondatabase/serverless'; - -// don't create a `Pool` or `Client` here, outside the request handler - -export default async (req: Request, ctx: any) => { - // create a `Client` inside the request handler - const client = new Client(process.env.DATABASE_URL); - await client.connect(); - - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await client.query('SELECT * FROM posts WHERE id = $1', [postId]); - if (!post) return new Response('Not found', { status: 404 }); - - // end the `Client` inside the same request handler - // (unlike `await`, `ctx.waitUntil` won't hold up the response) - ctx.waitUntil(client.end()); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); -} - -export const config = { - runtime: 'edge', - regions: ['iad1'], // specify the region nearest your Neon DB -}; -``` - -## More examples - -These repos show how to use `@neondatabase/serverless` with a variety of environments and tools: - -- [Raw SQL + Vercel Edge Functions](https://github.com/neondatabase/neon-vercel-rawsql) -- [Raw SQL via https + Vercel Edge Functions](https://github.com/neondatabase/neon-vercel-http) -- [Raw SQL + Cloudflare Workers](https://github.com/neondatabase/serverless-cfworker-demo) -- [Kysely + Vercel Edge Functions](https://github.com/neondatabase/neon-vercel-kysely) -- [Zapatos + Vercel Edge Functions](https://github.com/neondatabase/neon-vercel-zapatos) - -## Bring your own Postgres database - -This package comes configured to connect to a Neon database. But you can also use it to connect to your own Postgres instances if you [run your own WebSocket proxy](DEPLOY.md). - -## Open-source - -This code is released under the [MIT license](LICENSE). - -## Feedback and support - -Please visit [Neon Community](https://community.neon.tech/) or [Support](https://neon.tech/docs/introduction/support). diff --git a/node_modules/@neondatabase/serverless/index.d.mts b/node_modules/@neondatabase/serverless/index.d.mts deleted file mode 100644 index 66719f78e17208697844ddb561427179a2a45fd3..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/index.d.mts +++ /dev/null @@ -1,430 +0,0 @@ - -// DON'T EDIT THIS FILE -// It's a simple automatic copy of index.d.ts - - -// @neondatabase/serverless driver types, mimicking pg - -export { - BindConfig, ClientConfig, Connection, ConnectionConfig, CustomTypesConfig, Defaults, defaults, Events, ExecuteConfig, FieldDef, MessageConfig, native, Notification, PoolConfig, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, - QueryResultRow, ResultBuilder, Submittable, types -} from "pg"; -export { DatabaseError } from "pg-protocol"; - -interface FetchEndpointOptions { - jwtAuth?: boolean; -} - -export interface NeonConfigGlobalOnly { - /** - * Set `fetchEndpoint` to set the server endpoint to be sent queries via http - * fetch. May be useful in local development (e.g. to set a port that's not - * the default 443). - * - * Provide either the full endpoint URL, or a function that takes the - * database host address and port and returns the full endpoint URL - * (including protocol). - * - * Default: `host => 'https://' + host + '/sql'` - * - */ - fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); - - /** - * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners - * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set - * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP - * fetch request. - * - * Default: `false`. - */ - poolQueryViaFetch: boolean; - - /** - * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` - * did queries carried via HTTP fetch make use of a connection pool/cache - * on the server. All queries now use the connection pool/cache: this setting - * is ignored. - * - * Default: `true`. - */ - fetchConnectionCache: boolean; - - /** - * The `fetchFunction` option allows you to supply an alternative function - * for making http requests. The function must accept the same arguments as - * native `fetch`. - * - * Default: `undefined`. - */ - fetchFunction: any; -} - -export interface NeonConfigGlobalAndClient { - /** - * If no global `WebSocket` object is available, set `webSocketConstructor` - * to the constructor for a custom WebSocket implementation, such as those - * provided by `ws` or `undici`. - */ - webSocketConstructor: any; - - /** - * Set `wsProxy` to use your own WebSocket proxy server. - * - * Provide either the proxy server’s domain name, or a function that takes - * the database host and port and returns the proxy server address (without - * protocol). - * - * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` - * - * Default: `host => host + '/v2'` - */ - wsProxy: string | ((host: string, port: number | string) => string) | undefined; - - /** - * Use a secure (`wss:`) connection to the WebSocket proxy. - * - * Default: `true`. - */ - useSecureWebSocket: boolean; - - /** - * Disable TLS encryption in the Postgres protocol (as set via e.g. - * `?sslmode=require` in the connection string). Connection remains secure - * if `useSecureWebSocket` is `true`. - * - * Default: `true` - */ - forceDisablePgSSL: boolean; - - /** - * Pipelines the startup message, cleartext password message and first query - * when set to `"password"`. This works only for cleartext password auth. - * - * Default: `"password"`. - */ - pipelineConnect: "password" | false; - - /** - * If `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS, you must supply the subtls TLS library to this option: - * - * ``` - * import { neonConfig } from '@neondatabase/serverless'; - * import * as subtls from 'subtls'; - * neonConfig.subtls = subtls; - * ``` - * - * Default: `undefined`. - */ - subtls: any; - - /** - * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is - * `false` and the Postgres connection parameters specify TLS. Currently - * compatible only with Neon hosts. - * - * Default: `false`. - */ - pipelineTLS: boolean; - - /** - * Set `rootCerts` to a string comprising one or more PEM files. These are - * the trusted root certificates for a TLS connection to Postgres when - * `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS. - * - * Default: `""`. - */ - rootCerts: string; - - /** - * Batch multiple network writes per run-loop into a single outgoing - * WebSocket message. - * - * Default: `true`. - */ - coalesceWrites: boolean; - - /** - * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the - * Postgres connection parameters specify TLS, we send no SNI data in the - * Postgres TLS handshake. - * - * On Neon, disabling SNI and including the Neon project name in the password - * avoids CPU-intensive SCRAM authentication, but this is only relevant for - * earlier iterations of Neon's WebSocket support. - * - * Default: `false`. - */ - disableSNI: boolean; -} - -export interface NeonConfig extends NeonConfigGlobalOnly, NeonConfigGlobalAndClient { } - -import { - Client as PgClient, - ClientBase as PgClientBase, - Pool as PgPool, - PoolClient as PgPoolClient, -} from "pg"; - -export class ClientBase extends PgClientBase { - neonConfig: NeonConfigGlobalAndClient; -} - -export class Client extends PgClient { - neonConfig: NeonConfigGlobalAndClient; -} - -export interface PoolClient extends PgPoolClient { - neonConfig: NeonConfigGlobalAndClient; -} - -export class Pool extends PgPool { - connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; - on(event: 'error', listener: (err: Error, client: PoolClient) => void): this; - on(event: 'connect' | 'acquire' | 'remove', listener: (client: PoolClient) => void): this; -} - -export const neonConfig: NeonConfig; - - -// SQL-over-HTTP - -import { FieldDef } from "pg"; - -export type QueryRows = - ArrayMode extends true ? any[][] : Record[]; - -export interface FullQueryResults { - fields: FieldDef[]; - command: string; - rowCount: number; - rows: QueryRows; - rowAsArray: ArrayMode; -} - -export interface ParameterizedQuery { - query: string; - params: any[]; -} - -export interface HTTPQueryOptions { - /** - * When `arrayMode` is `false`, which is the default, result rows are - * returned as objects whose keys represent column names, such as - * `{ id: 1 }`). - * - * When `arrayMode` is `true`, rows are returned as arrays (and keys are not - * provided), e.g. `[1]`. - */ - arrayMode?: ArrayMode; - /** - * When `fullResults` is `false`, which is the default, only result rows are - * returned, e.g. `[{ id: 1 }]`). - * - * When `fullResults` is `true`, a result object is returned that matches - * what's returned by node-postgres. This has a `rows` property, which is an - * array of result rows, plus `fields`, which provides column names and - * types, `command` and `rowCount`. - */ - fullResults?: FullResults; // default false - /** - * Any options in `fetchOptions` are merged in to the options passed to - * `fetch`. In case of conflict with what would otherwise be passed, these - * options take precedence. - */ - fetchOptions?: Record; - - /** - * JWT auth token to be passed as the Bearer token in the Authorization header - * - * Default: `undefined` - */ - authToken?: string | (() => Promise | string); -} - -export interface HTTPTransactionOptions extends HTTPQueryOptions { - /** - * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. - * Note that `ReadUncommitted` actually gets you `ReadCommitted` in Postgres. - * */ - isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; - /** - * When `readOnly` is `false`, which is the default, a `READ WRITE` Postgres - * transaction is used. - * - * When `readOnly` is `true`, a `READ ONLY` Postgres transaction is used. - * */ - readOnly?: boolean; - /** - * When `deferrable` is `false`, which is the default, a `NOT DEFERRABLE` - * Postgres transaction is used. - * - * When `deferrable` is `true` (and `isolationLevel` is `Serializable` and - * `readOnly` is `true`), a `DEFERRABLE` Postgres transaction is used. - * */ - deferrable?: boolean; -} - -export interface NeonQueryPromise extends Promise { - parameterizedQuery: ParameterizedQuery; - opts?: HTTPQueryOptions; -} - -export interface NeonQueryInTransaction { - // this is a simplified form of query, which has only a `parameterizedQuery` (no `opts` and not a `Promise`) - parameterizedQuery: ParameterizedQuery; -} - -export interface NeonQueryFunctionInTransaction { - // this is a simplified form of NeonQueryFunction (below): - // * `opts` cannot be passed - // * no `transaction()` method is available - - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage (*no* options overrides) - (string: string, params?: any[]): - NeonQueryPromise : QueryRows>; -} - -export interface NeonQueryFunction { - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage, with options overrides - ( - string: string, - params?: any[], - opts?: HTTPQueryOptions - ): NeonQueryPromise< - ArrayModeOverride, - FullResultsOverride, - FullResultsOverride extends true ? FullQueryResults : QueryRows - >; - - /** - * The `transaction()` function allows multiple queries to be submitted (over - * HTTP) as a single, non-interactive Postgres transaction. - * - * For example: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const sql = neon("postgres://user:pass@host/db"); - * - * const results = await sql.transaction([ - * sql`SELECT 1 AS num`, - * sql`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * - * // or equivalently: - * const results = await sql.transaction(txn => [ - * txn`SELECT 1 AS num`, - * txn`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * ``` - * @param queriesOrFn Either an array of queries, or a (non-`async`) function - * that receives a query function and returns an array of queries. - * @param opts The same options that may be set on individual queries in a - * non-transaction setting -- that is, `arrayMode` `fullResults` and - * `fetchOptions` -- plus the transaction options `isolationLevel`, - * `readOnly` and `deferrable`. Note that none of these options can be set on - * individual queries within a transaction. - * @returns An array of results. The structure of each result object depends - * on the `arrayMode` and `fullResults` options. - */ - transaction: ( - queriesOrFn: NeonQueryPromise[] | // not ArrayModeOverride or FullResultsOverride: clamp these values to the current ones - ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), - opts?: HTTPTransactionOptions - ) => Promise[] : QueryRows[]>; -} - -/** - * This function returns an async tagged-template function that runs a single - * SQL query (no session or transactions) with low latency over https. Support - * for multiple queries as a non-interactive transaction is provided by - * the `transaction` property of the query function. - * - * By default, the query function returns database rows directly. Types should - * match those returned by this driver (i.e. Pool or Client) over WebSockets. - * - * The returned function can also be called directly (i.e. not as a template - * function). In that case, pass it a query string with embedded `$1`, `$2` - * (etc.), followed by an array of query parameters, followed (optionally) by - * any of the same options you can pass to this function. - * - * Some examples: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const h = "hello", w = "world"; - * - * // example 1: default options, tagged-template usage - * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; - * // -> [ { greeting: "hello world" } ] - * - * // example 2: `arrayMode` and `fullResults` options, ordinary function usage - * const options = { arrayMode: true, fullResults: true }; - * const sql = neon("postgres://user:pass@host/db", options); - * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); - * // -> { - * // command: "SELECT", - * // fields: [ { name: "greeting", dataTypeID: 25 } ], - * // rowAsArray: true, - * // rowCount: 1, - * // rows: [ [ "hello world" ] ] - * // } - * - * // example 3: `fetchOptions` option, ordinary function usage - * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql( - * "SELECT $1 || ' ' || $2 AS greeting", [h, w], - * { fetchOptions: { priority: "high" } } - * ); - * // -> [ { greeting: "hello world" } ] - * ``` - * - * @param connectionString this has the format `postgres://user:pass@host/db` - * @param options pass `arrayMode: true` to receive results as an array of - * arrays, instead of the default array of objects; pass `fullResults: true` - * to receive a complete result object similar to one returned by node-postgres - * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); - * pass as `fetchOptions` an object which will be merged into the options - * passed to `fetch`. - */ -export function neon( - connectionString: string, - options?: HTTPTransactionOptions, -): NeonQueryFunction; - -export class NeonDbError extends Error { - name: 'NeonDbError'; - - severity: string | undefined; - code: string | undefined; - detail: string | undefined; - hint: string | undefined; - position: string | undefined; - internalPosition: string | undefined; - internalQuery: string | undefined; - where: string | undefined; - schema: string | undefined; - table: string | undefined; - column: string | undefined; - dataType: string | undefined; - constraint: string | undefined; - file: string | undefined; - line: string | undefined; - routine: string | undefined; - - sourceError: Error | undefined; -} diff --git a/node_modules/@neondatabase/serverless/index.d.ts b/node_modules/@neondatabase/serverless/index.d.ts deleted file mode 100644 index 02278d975c200fcf4b534f1bcea1d400185cef83..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/index.d.ts +++ /dev/null @@ -1,426 +0,0 @@ - -// @neondatabase/serverless driver types, mimicking pg - -export { - BindConfig, ClientConfig, Connection, ConnectionConfig, CustomTypesConfig, Defaults, defaults, Events, ExecuteConfig, FieldDef, MessageConfig, native, Notification, PoolConfig, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, - QueryResultRow, ResultBuilder, Submittable, types -} from "pg"; -export { DatabaseError } from "pg-protocol"; - -interface FetchEndpointOptions { - jwtAuth?: boolean; -} - -export interface NeonConfigGlobalOnly { - /** - * Set `fetchEndpoint` to set the server endpoint to be sent queries via http - * fetch. May be useful in local development (e.g. to set a port that's not - * the default 443). - * - * Provide either the full endpoint URL, or a function that takes the - * database host address and port and returns the full endpoint URL - * (including protocol). - * - * Default: `host => 'https://' + host + '/sql'` - * - */ - fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); - - /** - * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners - * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set - * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP - * fetch request. - * - * Default: `false`. - */ - poolQueryViaFetch: boolean; - - /** - * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` - * did queries carried via HTTP fetch make use of a connection pool/cache - * on the server. All queries now use the connection pool/cache: this setting - * is ignored. - * - * Default: `true`. - */ - fetchConnectionCache: boolean; - - /** - * The `fetchFunction` option allows you to supply an alternative function - * for making http requests. The function must accept the same arguments as - * native `fetch`. - * - * Default: `undefined`. - */ - fetchFunction: any; -} - -export interface NeonConfigGlobalAndClient { - /** - * If no global `WebSocket` object is available, set `webSocketConstructor` - * to the constructor for a custom WebSocket implementation, such as those - * provided by `ws` or `undici`. - */ - webSocketConstructor: any; - - /** - * Set `wsProxy` to use your own WebSocket proxy server. - * - * Provide either the proxy server’s domain name, or a function that takes - * the database host and port and returns the proxy server address (without - * protocol). - * - * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` - * - * Default: `host => host + '/v2'` - */ - wsProxy: string | ((host: string, port: number | string) => string) | undefined; - - /** - * Use a secure (`wss:`) connection to the WebSocket proxy. - * - * Default: `true`. - */ - useSecureWebSocket: boolean; - - /** - * Disable TLS encryption in the Postgres protocol (as set via e.g. - * `?sslmode=require` in the connection string). Connection remains secure - * if `useSecureWebSocket` is `true`. - * - * Default: `true` - */ - forceDisablePgSSL: boolean; - - /** - * Pipelines the startup message, cleartext password message and first query - * when set to `"password"`. This works only for cleartext password auth. - * - * Default: `"password"`. - */ - pipelineConnect: "password" | false; - - /** - * If `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS, you must supply the subtls TLS library to this option: - * - * ``` - * import { neonConfig } from '@neondatabase/serverless'; - * import * as subtls from 'subtls'; - * neonConfig.subtls = subtls; - * ``` - * - * Default: `undefined`. - */ - subtls: any; - - /** - * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is - * `false` and the Postgres connection parameters specify TLS. Currently - * compatible only with Neon hosts. - * - * Default: `false`. - */ - pipelineTLS: boolean; - - /** - * Set `rootCerts` to a string comprising one or more PEM files. These are - * the trusted root certificates for a TLS connection to Postgres when - * `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS. - * - * Default: `""`. - */ - rootCerts: string; - - /** - * Batch multiple network writes per run-loop into a single outgoing - * WebSocket message. - * - * Default: `true`. - */ - coalesceWrites: boolean; - - /** - * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the - * Postgres connection parameters specify TLS, we send no SNI data in the - * Postgres TLS handshake. - * - * On Neon, disabling SNI and including the Neon project name in the password - * avoids CPU-intensive SCRAM authentication, but this is only relevant for - * earlier iterations of Neon's WebSocket support. - * - * Default: `false`. - */ - disableSNI: boolean; -} - -export interface NeonConfig extends NeonConfigGlobalOnly, NeonConfigGlobalAndClient { } - -import { - Client as PgClient, - ClientBase as PgClientBase, - Pool as PgPool, - PoolClient as PgPoolClient, -} from "pg"; - -export class ClientBase extends PgClientBase { - neonConfig: NeonConfigGlobalAndClient; -} - -export class Client extends PgClient { - neonConfig: NeonConfigGlobalAndClient; -} - -export interface PoolClient extends PgPoolClient { - neonConfig: NeonConfigGlobalAndClient; -} - -export class Pool extends PgPool { - connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; - on(event: 'error', listener: (err: Error, client: PoolClient) => void): this; - on(event: 'connect' | 'acquire' | 'remove', listener: (client: PoolClient) => void): this; -} - -export const neonConfig: NeonConfig; - - -// SQL-over-HTTP - -import { FieldDef } from "pg"; - -export type QueryRows = - ArrayMode extends true ? any[][] : Record[]; - -export interface FullQueryResults { - fields: FieldDef[]; - command: string; - rowCount: number; - rows: QueryRows; - rowAsArray: ArrayMode; -} - -export interface ParameterizedQuery { - query: string; - params: any[]; -} - -export interface HTTPQueryOptions { - /** - * When `arrayMode` is `false`, which is the default, result rows are - * returned as objects whose keys represent column names, such as - * `{ id: 1 }`). - * - * When `arrayMode` is `true`, rows are returned as arrays (and keys are not - * provided), e.g. `[1]`. - */ - arrayMode?: ArrayMode; - /** - * When `fullResults` is `false`, which is the default, only result rows are - * returned, e.g. `[{ id: 1 }]`). - * - * When `fullResults` is `true`, a result object is returned that matches - * what's returned by node-postgres. This has a `rows` property, which is an - * array of result rows, plus `fields`, which provides column names and - * types, `command` and `rowCount`. - */ - fullResults?: FullResults; // default false - /** - * Any options in `fetchOptions` are merged in to the options passed to - * `fetch`. In case of conflict with what would otherwise be passed, these - * options take precedence. - */ - fetchOptions?: Record; - - /** - * JWT auth token to be passed as the Bearer token in the Authorization header - * - * Default: `undefined` - */ - authToken?: string | (() => Promise | string); -} - -export interface HTTPTransactionOptions extends HTTPQueryOptions { - /** - * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. - * Note that `ReadUncommitted` actually gets you `ReadCommitted` in Postgres. - * */ - isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; - /** - * When `readOnly` is `false`, which is the default, a `READ WRITE` Postgres - * transaction is used. - * - * When `readOnly` is `true`, a `READ ONLY` Postgres transaction is used. - * */ - readOnly?: boolean; - /** - * When `deferrable` is `false`, which is the default, a `NOT DEFERRABLE` - * Postgres transaction is used. - * - * When `deferrable` is `true` (and `isolationLevel` is `Serializable` and - * `readOnly` is `true`), a `DEFERRABLE` Postgres transaction is used. - * */ - deferrable?: boolean; -} - -export interface NeonQueryPromise extends Promise { - parameterizedQuery: ParameterizedQuery; - opts?: HTTPQueryOptions; -} - -export interface NeonQueryInTransaction { - // this is a simplified form of query, which has only a `parameterizedQuery` (no `opts` and not a `Promise`) - parameterizedQuery: ParameterizedQuery; -} - -export interface NeonQueryFunctionInTransaction { - // this is a simplified form of NeonQueryFunction (below): - // * `opts` cannot be passed - // * no `transaction()` method is available - - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage (*no* options overrides) - (string: string, params?: any[]): - NeonQueryPromise : QueryRows>; -} - -export interface NeonQueryFunction { - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage, with options overrides - ( - string: string, - params?: any[], - opts?: HTTPQueryOptions - ): NeonQueryPromise< - ArrayModeOverride, - FullResultsOverride, - FullResultsOverride extends true ? FullQueryResults : QueryRows - >; - - /** - * The `transaction()` function allows multiple queries to be submitted (over - * HTTP) as a single, non-interactive Postgres transaction. - * - * For example: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const sql = neon("postgres://user:pass@host/db"); - * - * const results = await sql.transaction([ - * sql`SELECT 1 AS num`, - * sql`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * - * // or equivalently: - * const results = await sql.transaction(txn => [ - * txn`SELECT 1 AS num`, - * txn`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * ``` - * @param queriesOrFn Either an array of queries, or a (non-`async`) function - * that receives a query function and returns an array of queries. - * @param opts The same options that may be set on individual queries in a - * non-transaction setting -- that is, `arrayMode` `fullResults` and - * `fetchOptions` -- plus the transaction options `isolationLevel`, - * `readOnly` and `deferrable`. Note that none of these options can be set on - * individual queries within a transaction. - * @returns An array of results. The structure of each result object depends - * on the `arrayMode` and `fullResults` options. - */ - transaction: ( - queriesOrFn: NeonQueryPromise[] | // not ArrayModeOverride or FullResultsOverride: clamp these values to the current ones - ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), - opts?: HTTPTransactionOptions - ) => Promise[] : QueryRows[]>; -} - -/** - * This function returns an async tagged-template function that runs a single - * SQL query (no session or transactions) with low latency over https. Support - * for multiple queries as a non-interactive transaction is provided by - * the `transaction` property of the query function. - * - * By default, the query function returns database rows directly. Types should - * match those returned by this driver (i.e. Pool or Client) over WebSockets. - * - * The returned function can also be called directly (i.e. not as a template - * function). In that case, pass it a query string with embedded `$1`, `$2` - * (etc.), followed by an array of query parameters, followed (optionally) by - * any of the same options you can pass to this function. - * - * Some examples: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const h = "hello", w = "world"; - * - * // example 1: default options, tagged-template usage - * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; - * // -> [ { greeting: "hello world" } ] - * - * // example 2: `arrayMode` and `fullResults` options, ordinary function usage - * const options = { arrayMode: true, fullResults: true }; - * const sql = neon("postgres://user:pass@host/db", options); - * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); - * // -> { - * // command: "SELECT", - * // fields: [ { name: "greeting", dataTypeID: 25 } ], - * // rowAsArray: true, - * // rowCount: 1, - * // rows: [ [ "hello world" ] ] - * // } - * - * // example 3: `fetchOptions` option, ordinary function usage - * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql( - * "SELECT $1 || ' ' || $2 AS greeting", [h, w], - * { fetchOptions: { priority: "high" } } - * ); - * // -> [ { greeting: "hello world" } ] - * ``` - * - * @param connectionString this has the format `postgres://user:pass@host/db` - * @param options pass `arrayMode: true` to receive results as an array of - * arrays, instead of the default array of objects; pass `fullResults: true` - * to receive a complete result object similar to one returned by node-postgres - * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); - * pass as `fetchOptions` an object which will be merged into the options - * passed to `fetch`. - */ -export function neon( - connectionString: string, - options?: HTTPTransactionOptions, -): NeonQueryFunction; - -export class NeonDbError extends Error { - name: 'NeonDbError'; - - severity: string | undefined; - code: string | undefined; - detail: string | undefined; - hint: string | undefined; - position: string | undefined; - internalPosition: string | undefined; - internalQuery: string | undefined; - where: string | undefined; - schema: string | undefined; - table: string | undefined; - column: string | undefined; - dataType: string | undefined; - constraint: string | undefined; - file: string | undefined; - line: string | undefined; - routine: string | undefined; - - sourceError: Error | undefined; -} diff --git a/node_modules/@neondatabase/serverless/index.js b/node_modules/@neondatabase/serverless/index.js deleted file mode 100644 index 60c4542412a8c137c60c88805a92e89839b543d8..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/index.js +++ /dev/null @@ -1,1642 +0,0 @@ -"use strict";var no=Object.create;var Ie=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var so=Object.getOwnPropertyNames;var oo=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty;var uo=(r,e,t)=>e in r?Ie(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): -r[e]=t;var a=(r,e)=>Ie(r,"name",{value:e,configurable:!0});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),te=(r,e)=>{for(var t in e) -Ie(r,t,{get:e[t],enumerable:!0})},In=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== -"function")for(let i of so(e))!ao.call(r,i)&&i!==t&&Ie(r,i,{get:()=>e[i],enumerable:!(n= -io(e,i))||n.enumerable});return r};var Pe=(r,e,t)=>(t=r!=null?no(oo(r)):{},In(e||!r||!r.__esModule?Ie(t,"default",{ -value:r,enumerable:!0}):t,r)),N=r=>In(Ie({},"__esModule",{value:!0}),r);var _=(r,e,t)=>uo(r,typeof e!="symbol"?e+"":e,t);var Ln=I(it=>{"use strict";p();it.byteLength=ho;it.toByteArray=fo;it.fromByteArray= -mo;var oe=[],re=[],co=typeof Uint8Array<"u"?Uint8Array:Array,Rt="ABCDEFGHIJKLMNO\ -PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ae=0,Pn=Rt.length;Ae0)throw new Error("Invalid string. Length must be a multip\ -le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(Bn, -"getLens");function ho(r){var e=Bn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(ho,"byte\ -Length");function lo(r,e,t){return(e+t)*3/4-t}a(lo,"_byteLength");function fo(r){ -var e,t=Bn(r),n=t[0],i=t[1],s=new co(lo(r,n,i)),o=0,u=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e= -re[r.charCodeAt(c)]<<2|re[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=re[r.charCodeAt( -c)]<<10|re[r.charCodeAt(c+1)]<<4|re[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= -e&255),s}a(fo,"toByteArray");function po(r){return oe[r>>18&63]+oe[r>>12&63]+oe[r>> -6&63]+oe[r&63]}a(po,"tripletToBase64");function yo(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(oe[e>>2]+ -oe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(oe[e>>10]+oe[e>>4&63]+oe[e<< -2&63]+"=")),i.join("")}a(mo,"fromByteArray")});var Rn=I(Ft=>{p();Ft.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> -1,l=-7,d=t?i-1:0,b=t?-1:1,C=r[e+d];for(d+=b,s=C&(1<<-l)-1,C>>=-l,l+=u;l>0;s=s*256+ -r[e+d],d+=b,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+r[e+d],d+=b,l-=8);if(s=== -0)s=1-h;else{if(s===c)return o?NaN:(C?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(C? --1:1)*o*Math.pow(2,s-n)};Ft.write=function(r,e,t,n,i,s){var o,u,c,h=s*8-i-1,l=(1<< -h)-1,d=l>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=n?0:s-1,B=n?1:-1,j=e<0|| -e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math. -floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=b/c:e+= -b*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow( -2,i),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;r[t+C]=u&255,C+=B,u/=256, -i-=8);for(o=o<0;r[t+C]=o&255,C+=B,o/=256,h-=8);r[t+C-B]|=j*128}});var zn=I(Fe=>{"use strict";p();var Mt=Ln(),Le=Rn(),Fn=typeof Symbol=="function"&& -typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Fe.Buffer= -f;Fe.SlowBuffer=xo;Fe.INSPECT_MAX_BYTES=50;var st=2147483647;Fe.kMaxLength=st;f. -TYPED_ARRAY_SUPPORT=go();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. -error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ -pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ -rowser support.");function go(){try{let r=new Uint8Array(1),e={foo:a(function(){ -return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf( -r,e),r.foo()===42}catch{return!1}}a(go,"typedArraySupport");Object.defineProperty( -f.prototype,"parent",{enumerable:!0,get:a(function(){if(f.isBuffer(this))return this. -buffer},"get")});Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:a( -function(){if(f.isBuffer(this))return this.byteOffset},"get")});function fe(r){if(r> -st)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( -r);return Object.setPrototypeOf(e,f.prototype),e}a(fe,"createBuffer");function f(r,e,t){ -if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" a\ -rgument must be of type string. Received type number');return Ut(r)}return On(r, -e,t)}a(f,"Buffer");f.poolSize=8192;function On(r,e,t){if(typeof r=="string")return bo( -r,e);if(ArrayBuffer.isView(r))return So(r);if(r==null)throw new TypeError("The f\ -irst argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-l\ -ike Object. Received type "+typeof r);if(ae(r,ArrayBuffer)||r&&ae(r.buffer,ArrayBuffer)|| -typeof SharedArrayBuffer<"u"&&(ae(r,SharedArrayBuffer)||r&&ae(r.buffer,SharedArrayBuffer))) -return kt(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ - must not be of type number. Received type number');let n=r.valueOf&&r.valueOf(); -if(n!=null&&n!==r)return f.from(n,e,t);let i=Eo(r);if(i)return i;if(typeof Symbol< -"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return f. -from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argumen\ -t must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. \ -Received type "+typeof r)}a(On,"from");f.from=function(r,e,t){return On(r,e,t)}; -Object.setPrototypeOf(f.prototype,Uint8Array.prototype);Object.setPrototypeOf(f, -Uint8Array);function Un(r){if(typeof r!="number")throw new TypeError('"size" arg\ -ument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is\ - invalid for option "size"')}a(Un,"assertSize");function wo(r,e,t){return Un(r), -r<=0?fe(r):e!==void 0?typeof t=="string"?fe(r).fill(e,t):fe(r).fill(e):fe(r)}a(wo, -"alloc");f.alloc=function(r,e,t){return wo(r,e,t)};function Ut(r){return Un(r),fe( -r<0?0:Nt(r)|0)}a(Ut,"allocUnsafe");f.allocUnsafe=function(r){return Ut(r)};f.allocUnsafeSlow= -function(r){return Ut(r)};function bo(r,e){if((typeof e!="string"||e==="")&&(e="\ -utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Nn(r,e)| -0,n=fe(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}a(bo,"fromString");function Dt(r){ -let e=r.length<0?0:Nt(r.length)|0,t=fe(e);for(let n=0;n= -st)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ -st.toString(16)+" bytes");return r|0}a(Nt,"checked");function xo(r){return+r!=r&& -(r=0),f.alloc(+r)}a(xo,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. -_isBuffer===!0&&e!==f.prototype},"isBuffer");f.compare=a(function(e,t){if(ae(e,Uint8Array)&& -(e=f.from(e,e.offset,e.byteLength)),ae(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)), -!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ - must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t. -length;for(let s=0,o=Math.min(n,i);si.length?(f.isBuffer( -o)||(o=f.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(f.isBuffer( -o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ -fers');s+=o.length}return i},"concat");function Nn(r,e){if(f.isBuffer(r))return r. -length;if(ArrayBuffer.isView(r)||ae(r,ArrayBuffer))return r.byteLength;if(typeof r!= -"string")throw new TypeError('The "string" argument must be one of type string, \ -Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> -2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ -latin1":case"binary":return t;case"utf8":case"utf-8":return Ot(r).length;case"uc\ -s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ -base64":return Kn(r).length;default:if(i)return n?-1:Ot(r).length;e=(""+e).toLowerCase(), -i=!0}}a(Nn,"byteLength");f.byteLength=Nn;function vo(r,e,t){let n=!1;if((e===void 0|| -e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| -(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Fo( -this,e,t);case"utf8":case"utf-8":return Qn(this,e,t);case"ascii":return Lo(this, -e,t);case"latin1":case"binary":return Ro(this,e,t);case"base64":return Po(this,e, -t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mo(this,e,t);default: -if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( -vo,"slowToString");f.prototype._isBuffer=!0;function Ce(r,e,t){let n=r[e];r[e]=r[t], -r[t]=n}a(Ce,"swap");f.prototype.swap16=a(function(){let e=this.length;if(e%2!==0) -throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t< -e;t+=2)Ce(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. -length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ -s");for(let t=0;tt&&(e+=" ... "),""},"inspect");Fn&&(f.prototype[Fn]=f.prototype.inspect);f.prototype.compare= -a(function(e,t,n,i,s){if(ae(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f. -isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ -r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? -e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| -s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; -if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; -let o=s-i,u=n-t,c=Math.min(o,u),h=this.slice(i,s),l=e.slice(t,n);for(let d=0;d2147483647?t=2147483647: -t<-2147483648&&(t=-2147483648),t=+t,Qt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), -t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== -"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Mn(r,e,t,n,i);if(typeof e== -"number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. -prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Mn(r, -[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(qn,"bid\ -irectionalIndexOf");function Mn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== -void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ -utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,u/=2,t/=2}function c(l,d){ -return s===1?l[d]:l.readUInt16BE(d*s)}a(c,"read");let h;if(i){let l=-1;for(h=t;h< -o;h++)if(c(r,h)===c(e,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===u)return l*s}else l!== --1&&(h-=h-l),l=-1}else for(t+u>o&&(t=o-u),h=t;h>=0;h--){let l=!0;for(let d=0;di&&(n=i)):n=i;let s=e.length;n> -s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)? -(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ -te(string, encoding, offset[, length]) is no longer supported");let s=this.length- -t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( -"Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"\ -hex":return _o(this,e,t,n);case"utf8":case"utf-8":return Ao(this,e,t,n);case"asc\ -ii":case"latin1":case"binary":return Co(this,e,t,n);case"base64":return To(this, -e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Io(this,e,t,n);default: -if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"\ -write");f.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype. -slice.call(this._arr||this,0)}},"toJSON");function Po(r,e,t){return e===0&&t===r. -length?Mt.fromByteArray(r):Mt.fromByteArray(r.slice(e,t))}a(Po,"base64Slice");function Qn(r,e,t){ -t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223? -3:s>191?2:1;if(i+u<=t){let c,h,l,d;switch(u){case 1:s<128&&(o=s);break;case 2:c= -r[i+1],(c&192)===128&&(d=(s&31)<<6|c&63,d>127&&(o=d));break;case 3:c=r[i+1],h=r[i+ -2],(c&192)===128&&(h&192)===128&&(d=(s&15)<<12|(c&63)<<6|h&63,d>2047&&(d<55296|| -d>57343)&&(o=d));break;case 4:c=r[i+1],h=r[i+2],l=r[i+3],(c&192)===128&&(h&192)=== -128&&(l&192)===128&&(d=(s&15)<<18|(c&63)<<12|(h&63)<<6|l&63,d>65535&&d<1114112&& -(o=d))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| -o&1023),n.push(o),i+=u}return Bo(n)}a(Qn,"utf8Slice");var Dn=4096;function Bo(r){ -let e=r.length;if(e<=Dn)return String.fromCharCode.apply(String,r);let t="",n=0; -for(;nn)&&(t=n);let i="";for(let s=e;sn&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError( -"Trying to access beyond buffer length")}a(q,"checkOffset");f.prototype.readUintLE= -f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e], -s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e,t,this. -length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"re\ -adUIntBE");f.prototype.readUint8=f.prototype.readUInt8=a(function(e,t){return e= -e>>>0,t||q(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. -readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]|this[e+ -1]<<8},"readUInt16LE");f.prototype.readUint16BE=f.prototype.readUInt16BE=a(function(e,t){ -return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. -readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. -length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE"); -f.prototype.readUint32BE=f.prototype.readUInt32BE=a(function(e,t){return e=e>>>0, -t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ -readUInt32BE");f.prototype.readBigUInt64LE=we(a(function(e){e=e>>>0,Re(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=t+ -this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]* -2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,Re(e,"offset");let t=this[e],n=this[e+7]; -(t===void 0||n===void 0)&&We(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* -2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt( -i)<>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");f.prototype. -readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=t,s=1,o=this[e+ ---i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)), -o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this. -length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");f.prototype.readInt16LE= -a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& -32768?n|4294901760:n},"readInt16LE");f.prototype.readInt16BE=a(function(e,t){e=e>>> -0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, -"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. -length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");f.prototype. -readInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+ -1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=we(a(function(e){ -e=e>>>0,Re(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, -this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt( -i)<>>0,Re(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=(t<< -24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||q(e,4,this.length),Le.read(this,e, -!0,23,4)},"readFloatLE");f.prototype.readFloatBE=a(function(e,t){return e=e>>>0, -t||q(e,4,this.length),Le.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= -a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Le.read(this,e,!0,52,8)},"r\ -eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this. -length),Le.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( -r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e< -s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError( -"Index out of range")}a(Y,"checkInt");f.prototype.writeUintLE=f.prototype.writeUIntLE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;Y(this,e, -t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;Y(this,e,t,n,u,0)}let s=n-1, -o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+n},"writeUI\ -ntBE");f.prototype.writeUint8=f.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||Y(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");f.prototype.writeUint16LE= -f.prototype.writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,2, -65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");f.prototype.writeUint16BE= -f.prototype.writeUInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,2, -65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");f.prototype.writeUint32LE= -f.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,4, -4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+ -4},"writeUInt32LE");f.prototype.writeUint32BE=f.prototype.writeUInt32BE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||Y(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16, -this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function jn(r,e,t,n,i){Vn( -e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8, -r[t++]=s,s=s>>8,r[t++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]= -o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(jn,"wrtBigUInt64LE");function Wn(r,e,t,n,i){ -Vn(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> -8,r[t+5]=s,s=s>>8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+ -3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(Wn,"wrtBigUInt64BE");f. -prototype.writeBigUInt64LE=we(a(function(e,t=0){return jn(this,e,t,BigInt(0),BigInt( -"0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=we(a(function(e,t=0){ -return Wn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")); -f.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2, -8*n-1);Y(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntL\ -E");f.prototype.writeIntBE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow( -2,8*n-1);Y(this,e,t,n,c-1,-c)}let s=n-1,o=1,u=0;for(this[t+s]=e&255;--s>=0&&(o*= -256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+n},"w\ -riteIntBE");f.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this, -e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");f.prototype.writeInt16LE= -a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,2,32767,-32768),this[t]=e&255, -this[t+1]=e>>>8,t+2},"writeInt16LE");f.prototype.writeInt16BE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||Y(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255, -t+2},"writeInt16BE");f.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t=t>>> -0,n||Y(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]= -e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");f.prototype.writeInt32BE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+ -1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeIn\ -t32BE");f.prototype.writeBigInt64LE=we(a(function(e,t=0){return jn(this,e,t,-BigInt( -"0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));f.prototype. -writeBigInt64BE=we(a(function(e,t=0){return Wn(this,e,t,-BigInt("0x8000000000000\ -000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Hn(r,e,t,n,i,s){ -if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError( -"Index out of range")}a(Hn,"checkIEEE754");function Gn(r,e,t,n,i){return e=+e,t= -t>>>0,i||Hn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Le.write(r,e,t,n, -23,4),t+4}a(Gn,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return Gn( -this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return Gn( -this,e,t,!1,n)},"writeFloatBE");function $n(r,e,t,n,i){return e=+e,t=t>>>0,i||Hn( -r,e,t,8,17976931348623157e292,-17976931348623157e292),Le.write(r,e,t,n,52,8),t+8} -a($n,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return $n(this,e, -t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return $n( -this,e,t,!1,n)},"writeDoubleBE");f.prototype.copy=a(function(e,t,n,i){if(!f.isBuffer( -e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i= -this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError( -"sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>0, -n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=kn(String(t)):typeof t=="bigint"&&(i=String(t), -(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=kn(i)),i+="n"),n+=` It\ - must be ${e}. Received ${i}`,n},RangeError);function kn(r){let e="",t=r.length, -n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0, -t)}${e}`}a(kn,"addNumericalSeparator");function Do(r,e,t){Re(e,"offset"),(r[e]=== -void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(Do,"checkBounds");function Vn(r,e,t,n,i,s){ -if(r>t||r3?e===0||e===BigInt(0)?u= -`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:u=`>= -(2${o} ** ${(s+1)*8-1}${o}) and \ -< 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new Be.ERR_OUT_OF_RANGE( -"value",u,r)}Do(n,i,s)}a(Vn,"checkIntBI");function Re(r,e){if(typeof r!="number") -throw new Be.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Re,"validateNumber");function We(r,e,t){ -throw Math.floor(r)!==r?(Re(r,t),new Be.ERR_OUT_OF_RANGE(t||"offset","an integer", -r)):e<0?new Be.ERR_BUFFER_OUT_OF_BOUNDS:new Be.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? -1:0} and <= ${e}`,r)}a(We,"boundsError");var ko=/[^+/0-9A-Za-z-_]/g;function Oo(r){ -if(r=r.split("=")[0],r=r.trim().replace(ko,""),r.length<2)return"";for(;r.length% -4!==0;)r=r+"=";return r}a(Oo,"base64clean");function Ot(r,e){e=e||1/0;let t,n=r. -length,i=null,s=[];for(let o=0;o55295&&t<57344){if(!i){ -if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&& -s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, -189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191, -189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break; -s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>> -6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63| -128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a( -Ot,"utf8ToBytes");function Uo(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s} -a(No,"utf16leToBytes");function Kn(r){return Mt.toByteArray(Oo(r))}a(Kn,"base64T\ -oBytes");function ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(ot,"blitBuffer");function ae(r,e){return r instanceof e|| -r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name} -a(ae,"isInstance");function Qt(r){return r!==r}a(Qt,"numberIsNaN");var qo=function(){ -let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< -16;++i)e[n+i]=r[t]+r[i]}return e}();function we(r){return typeof BigInt>"u"?Qo:r} -a(we,"defineBigIntMethod");function Qo(){throw new Error("BigInt not supported")} -a(Qo,"BufferBigIntNotDefined")});var S,E,x,g,y,m,p=z(()=>{"use strict";S=globalThis,E=globalThis.setImmediate??(r=>setTimeout( -r,0)),x=globalThis.clearImmediate??(r=>clearTimeout(r)),g=globalThis.crypto??{}; -g.subtle??(g.subtle={});y=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:zn().Buffer,m=globalThis.process?? -{};m.env??(m.env={});try{m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick= -e.then.bind(e)}});var be=I((rh,jt)=>{"use strict";p();var Me=typeof Reflect=="object"?Reflect:null, -Yn=Me&&typeof Me.apply=="function"?Me.apply:a(function(e,t,n){return Function.prototype. -apply.call(e,t,n)},"ReflectApply"),at;Me&&typeof Me.ownKeys=="function"?at=Me.ownKeys: -Object.getOwnPropertySymbols?at=a(function(e){return Object.getOwnPropertyNames( -e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):at=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function jo(r){console&&console.warn&& -console.warn(r)}a(jo,"ProcessEmitWarning");var Jn=Number.isNaN||a(function(e){return e!== -e},"NumberIsNaN");function L(){L.init.call(this)}a(L,"EventEmitter");jt.exports= -L;jt.exports.once=$o;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount= -0;L.prototype._maxListeners=void 0;var Zn=10;function ut(r){if(typeof r!="functi\ -on")throw new TypeError('The "listener" argument must be of type Function. Recei\ -ved type '+typeof r)}a(ut,"checkListener");Object.defineProperty(L,"defaultMaxLi\ -steners",{enumerable:!0,get:a(function(){return Zn},"get"),set:a(function(r){if(typeof r!= -"number"||r<0||Jn(r))throw new RangeError('The value of "defaultMaxListeners" is\ - out of range. It must be a non-negative number. Received '+r+".");Zn=r},"set")}); -L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). -_events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= -this._maxListeners||void 0};L.prototype.setMaxListeners=a(function(e){if(typeof e!= -"number"||e<0||Jn(e))throw new RangeError('The value of "n" is out of range. It \ -must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, -"setMaxListeners");function Xn(r){return r._maxListeners===void 0?L.defaultMaxListeners: -r._maxListeners}a(Xn,"_getMaxListeners");L.prototype.getMaxListeners=a(function(){ -return Xn(this)},"getMaxListeners");L.prototype.emit=a(function(e){for(var t=[], -n=1;n -0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+ -o.message+")":""));throw u.context=o,u}var c=s[e];if(c===void 0)return!1;if(typeof c== -"function")Yn(c,this,t);else for(var h=c.length,l=ii(c,h),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ -ssible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners a\ -dded. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExce\ -ededWarning",u.emitter=r,u.type=e,u.count=o.length,jo(u)}return r}a(ei,"_addList\ -ener");L.prototype.addListener=a(function(e,t){return ei(this,e,t,!1)},"addListe\ -ner");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=a(function(e,t){ -return ei(this,e,t,!0)},"prependListener");function Wo(){if(!this.fired)return this. -target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? -this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Wo, -"onceWrapper");function ti(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, -listener:t},i=Wo.bind(n);return i.listener=t,n.wrapFn=i,i}a(ti,"_onceWrap");L.prototype. -once=a(function(e,t){return ut(t),this.on(e,ti(this,e,t)),this},"once");L.prototype. -prependOnceListener=a(function(e,t){return ut(t),this.prependListener(e,ti(this, -e,t)),this},"prependOnceListener");L.prototype.removeListener=a(function(e,t){var n, -i,s,o,u;if(ut(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; -if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): -(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= -"function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o]. -listener,s=o;break}if(s<0)return this;s===0?n.shift():Ho(n,s),n.length===1&&(i[e]= -n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this}, -"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners= -a(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== -void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= -0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), -this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ri(r,e,t){ -var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== -"function"?t?[i.listener||i]:[i]:t?Go(i):ii(i,i.length)}a(ri,"_listeners");L.prototype. -listeners=a(function(e){return ri(this,e,!0)},"listeners");L.prototype.rawListeners= -a(function(e){return ri(this,e,!1)},"rawListeners");L.listenerCount=function(r,e){ -return typeof r.listenerCount=="function"?r.listenerCount(e):ni.call(r,e)};L.prototype. -listenerCount=ni;function ni(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== -"function")return 1;if(t!==void 0)return t.length}return 0}a(ni,"listenerCount"); -L.prototype.eventNames=a(function(){return this._eventsCount>0?at(this._events): -[]},"eventNames");function ii(r,e){for(var t=new Array(e),n=0;nKo});var Ko,Ge=z(()=>{"use strict";p();Ko={}});function $e(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, -o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,3049323471, -3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, -1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, -604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, -3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372, -1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, -3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, -883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, -2361852424,2428436474,2756734187,3204031479,3329325298],b=a((A,w)=>A>>>w|A<<32-w, -"rrot"),C=new Uint32Array(64),B=new Uint8Array(64),j=a(()=>{for(let R=0,G=0;R<16;R++, -G+=4)C[R]=B[G]<<24|B[G+1]<<16|B[G+2]<<8|B[G+3];for(let R=16;R<64;R++){let G=b(C[R- -15],7)^b(C[R-15],18)^C[R-15]>>>3,he=b(C[R-2],17)^b(C[R-2],19)^C[R-2]>>>10;C[R]=C[R- -16]+G+C[R-7]+he|0}let A=e,w=t,P=n,V=i,O=s,W=o,ce=u,ee=c;for(let R=0;R<64;R++){let G=b( -O,6)^b(O,11)^b(O,25),he=O&W^~O&ce,ye=ee+G+he+d[R]+C[R]|0,ve=b(A,2)^b(A,13)^b(A,22), -le=A&w^A&P^w&P,Te=ve+le|0;ee=ce,ce=W,W=O,O=V+ye|0,V=P,P=w,w=A,A=ye+Te|0}e=e+A|0, -t=t+w|0,n=n+P|0,i=i+V|0,s=s+O|0,o=o+W|0,u=u+ce|0,c=c+ee|0,l=0},"process"),X=a(A=>{ -typeof A=="string"&&(A=new TextEncoder().encode(A));for(let w=0;w{if(B[l++]=128,l==64&&j(),l+8>64){ -for(;l<64;)B[l++]=0;j()}for(;l<58;)B[l++]=0;let A=h*8;B[l++]=A/1099511627776&255, -B[l++]=A/4294967296&255,B[l++]=A>>>24,B[l++]=A>>>16&255,B[l++]=A>>>8&255,B[l++]= -A&255,j();let w=new Uint8Array(32);return w[0]=e>>>24,w[1]=e>>>16&255,w[2]=e>>>8& -255,w[3]=e&255,w[4]=t>>>24,w[5]=t>>>16&255,w[6]=t>>>8&255,w[7]=t&255,w[8]=n>>>24, -w[9]=n>>>16&255,w[10]=n>>>8&255,w[11]=n&255,w[12]=i>>>24,w[13]=i>>>16&255,w[14]= -i>>>8&255,w[15]=i&255,w[16]=s>>>24,w[17]=s>>>16&255,w[18]=s>>>8&255,w[19]=s&255, -w[20]=o>>>24,w[21]=o>>>16&255,w[22]=o>>>8&255,w[23]=o&255,w[24]=u>>>24,w[25]=u>>> -16&255,w[26]=u>>>8&255,w[27]=u&255,w[28]=c>>>24,w[29]=c>>>16&255,w[30]=c>>>8&255, -w[31]=c&255,w},"digest");return r===void 0?{add:X,digest:de}:(X(r),de())}var oi=z( -()=>{"use strict";p();a($e,"sha256")});var U,Ve,ai=z(()=>{"use strict";p();U=class U{constructor(){_(this,"_dataLength", -0);_(this,"_bufferLength",0);_(this,"_state",new Int32Array(4));_(this,"_buffer", -new ArrayBuffer(68));_(this,"_buffer8");_(this,"_buffer32");this._buffer8=new Uint8Array( -this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){ -return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ -return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U. -hexChars,n=U.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ -o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ -let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| -0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| -0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,n+=(i& -s|~i&o)+t[4]-176418897|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[5]+1200080426|0,o=(o<< -12|o>>>20)+n|0,s+=(o&n|~o&i)+t[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+ -t[7]-45705983|0,i=(i<<22|i>>>10)+s|0,n+=(i&s|~i&o)+t[8]+1770035416|0,n=(n<<7|n>>> -25)+i|0,o+=(n&i|~n&s)+t[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[10]- -42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[11]-1990404162|0,i=(i<<22|i>>>10)+s| -0,n+=(i&s|~i&o)+t[12]+1804603682|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[13]-40341101| -0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,i+= -(s&o|~s&n)+t[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,n+=(i&o|s&~o)+t[1]-165796510| -0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i&~s)+t[6]-1069501632|0,o=(o<<9|o>>>23)+n|0,s+=(o& -i|n&~i)+t[11]+643717713|0,s=(s<<14|s>>>18)+o|0,i+=(s&n|o&~n)+t[0]-373897302|0,i= -(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[5]-701558691|0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i& -~s)+t[10]+38016083|0,o=(o<<9|o>>>23)+n|0,s+=(o&i|n&~i)+t[15]-660478335|0,s=(s<<14| -s>>>18)+o|0,i+=(s&n|o&~n)+t[4]-405537848|0,i=(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[9]+ -568446438|0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i&~s)+t[14]-1019803690|0,o=(o<<9|o>>>23)+ -n|0,s+=(o&i|n&~i)+t[3]-187363961|0,s=(s<<14|s>>>18)+o|0,i+=(s&n|o&~n)+t[8]+1163531501| -0,i=(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[13]-1444681467|0,n=(n<<5|n>>>27)+i|0,o+=(n& -s|i&~s)+t[2]-51403784|0,o=(o<<9|o>>>23)+n|0,s+=(o&i|n&~i)+t[7]+1735328473|0,s=(s<< -14|s>>>18)+o|0,i+=(s&n|o&~n)+t[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,n+=(i^s^o)+ -t[5]-378558|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[8]-2022574463|0,o=(o<<11|o>>>21)+ -n|0,s+=(o^n^i)+t[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+t[14]-35309556| -0,i=(i<<23|i>>>9)+s|0,n+=(i^s^o)+t[1]-1530992060|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+ -t[4]+1272893353|0,o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+t[7]-155497632|0,s=(s<<16|s>>> -16)+o|0,i+=(s^o^n)+t[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,n+=(i^s^o)+t[13]+681279174| -0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[0]-358537222|0,o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+ -t[3]-722521979|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+t[6]+76029189|0,i=(i<<23|i>>>9)+ -s|0,n+=(i^s^o)+t[9]-640364487|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[12]-421815835|0, -o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+t[15]+530742520|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+ -t[2]-995338651|0,i=(i<<23|i>>>9)+s|0,n+=(s^(i|~o))+t[0]-198630844|0,n=(n<<6|n>>> -26)+i|0,o+=(i^(n|~s))+t[7]+1126891415|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[14]- -1416354905|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[5]-57434055|0,i=(i<<21|i>>>11)+ -s|0,n+=(s^(i|~o))+t[12]+1700485571|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[3]-1894986606| -0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^ -(s|~n))+t[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,n+=(s^(i|~o))+t[8]+1873313359|0,n= -(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[15]-30611744|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+ -t[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[13]+1309151649|0,i=(i<<21| -i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[11]- -1120210379|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ -o|0,i+=(o^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| -0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength=0,this._bufferLength= -0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. -_buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296|| -s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)* -1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard\ - supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128, -t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this. -_state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(e){let t=this. -_buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,U._md5cycle( -this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this. -_buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,U._md5cycle(this._state, -n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String. -fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this. -_dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state,i=this. -_state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]= -n[1],i[2]=n[2],i[3]=n[3],s=0;s>2)+1;this._dataLength+= -t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(U.buffer32Identity. -subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)),o<=4294967295) -i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),h=parseInt(u[1],16)||0;i[14]=c,i[15]=h}return U._md5cycle(this._state,i), -e?this._state:U._hex(this._state)}};a(U,"Md5"),_(U,"stateIdentity",new Int32Array( -[1732584193,-271733879,-1732584194,271733878])),_(U,"buffer32Identity",new Int32Array( -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),_(U,"hexChars","0123456789abcdef"),_(U,"hexO\ -ut",[]),_(U,"onePassHasher",new U);Ve=U});var Wt={};te(Wt,{createHash:()=>Yo,createHmac:()=>Zo,randomBytes:()=>zo});function zo(r){ -return g.getRandomValues(y.alloc(r))}function Yo(r){if(r==="sha256")return{update:a( -function(e){return{digest:a(function(){return y.from($e(e))},"digest")}},"update")}; -if(r==="md5")return{update:a(function(e){return{digest:a(function(){return typeof e== -"string"?Ve.hashStr(e):Ve.hashByteArray(e)},"digest")}},"update")};throw new Error( -`Hash type '${r}' not supported`)}function Zo(r,e){if(r!=="sha256")throw new Error( -`Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{ -digest:a(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== -"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=$e(e);else if(n< -64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array(64),s=new Uint8Array( -64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ -64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set($e(o), -64),y.from($e(u))},"digest")}},"update")}}var Ht=z(()=>{"use strict";p();oi();ai(); -a(zo,"randomBytes");a(Yo,"createHash");a(Zo,"createHmac")});var $t=I(ui=>{"use strict";p();ui.parse=function(r,e){return new Gt(r,e).parse()}; -var ct=class ct{constructor(e,t){this.source=e,this.transform=t||Jo,this.position= -0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>= -this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== -"\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){ -this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&(t=this.recorded. -join(""),t==="NULL"&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.push( -t),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){ -var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this.consumeDimensions();!this. -isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this.dimension> -1&&(n=new ct(this.source.substr(this.position-1),this.transform),this.entries.push( -n.parse(!0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--, -!this.dimension&&(this.newEntry(),e))return this.entries}else t.value==='"'&&!t. -escaped?(i&&this.newEntry(!0),i=!i):t.value===","&&!i?this.newEntry():this.record( -t.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this. -entries}};a(ct,"ArrayParser");var Gt=ct;function Jo(r){return r}a(Jo,"identity")});var Vt=I((bh,ci)=>{p();var Xo=$t();ci.exports={create:a(function(r,e){return{parse:a( -function(){return Xo.parse(r,e)},"parse")}},"create")}});var fi=I((xh,li)=>{"use strict";p();var ea=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -ta=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,ra=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,na=/^-?infinity$/; -li.exports=a(function(e){if(na.test(e))return Number(e.replace("i","I"));var t=ea. -exec(e);if(!t)return ia(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=hi(i));var s=parseInt( -t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),h=parseInt(t[6],10),l=t[7]; -l=l?1e3*parseFloat(l):0;var d,b=sa(e);return b!=null?(d=new Date(Date.UTC(i,s,o, -u,c,h,l)),Kt(i)&&d.setUTCFullYear(i),b!==0&&d.setTime(d.getTime()-b)):(d=new Date( -i,s,o,u,c,h,l),Kt(i)&&d.setFullYear(i)),d},"parseDate");function ia(r){var e=ta. -exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=hi(t));var i=parseInt(e[2], -10)-1,s=e[3],o=new Date(t,i,s);return Kt(t)&&o.setFullYear(t),o}}a(ia,"getDate"); -function sa(r){if(r.endsWith("+00"))return 0;var e=ra.exec(r.split(" ")[1]);if(e){ -var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(sa,"timeZoneOffset");function hi(r){ -return-(r-1)}a(hi,"bcYearToNegativeYear");function Kt(r){return r>=0&&r<100}a(Kt, -"is0To99")});var di=I((Ah,pi)=>{p();pi.exports=aa;var oa=Object.prototype.hasOwnProperty;function aa(r){ -for(var e=1;e{"use strict";p();var ua=di();mi.exports=De;function De(r){if(!(this instanceof -De))return new De(r);ua(this,Sa(r))}a(De,"PostgresInterval");var ca=["seconds","\ -minutes","hours","days","months","years"];De.prototype.toPostgres=function(){var r=ca. -filter(this.hasOwnProperty,this);return this.milliseconds&&r.indexOf("seconds")< -0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]||0;return e=== -"seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var ha={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ -M",seconds:"S"},la=["years","months","days"],fa=["hours","minutes","seconds"];De. -prototype.toISOString=De.prototype.toISO=function(){var r=la.map(t,this).join(""), -e=fa.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== -"seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/, -"")),i+ha[n]}};var zt="([+-]?\\d+)",pa=zt+"\\s+years?",da=zt+"\\s+mons?",ya=zt+"\ -\\s+days?",ma="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ga=new RegExp([ -pa,da,ya,ma].map(function(r){return"("+r+")?"}).join("\\s*")),yi={years:2,months:4, -days:6,hours:9,minutes:10,seconds:11,milliseconds:12},wa=["hours","minutes","sec\ -onds","milliseconds"];function ba(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(ba,"parseMilliseconds");function Sa(r){if(!r)return{};var e=ga.exec( -r),t=e[8]==="-";return Object.keys(yi).reduce(function(n,i){var s=yi[i],o=e[s];return!o|| -(o=i==="milliseconds"?ba(o):parseInt(o,10),!o)||(t&&~wa.indexOf(i)&&(o*=-1),n[i]= -o),n},{})}a(Sa,"parse")});var bi=I((Lh,wi)=>{"use strict";p();wi.exports=a(function(e){if(/^\\x/.test(e))return new y( -e.substr(2),"hex");for(var t="",n=0;n{p();var Ke=$t(),ze=Vt(),ht=fi(),Ei=gi(),xi=bi();function lt(r){ -return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(lt,"allowNull");function vi(r){ -return r===null?r:r==="TRUE"||r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"|| -r==="1"}a(vi,"parseBool");function Ea(r){return r?Ke.parse(r,vi):null}a(Ea,"pars\ -eBoolArray");function xa(r){return parseInt(r,10)}a(xa,"parseBaseTenInt");function Yt(r){ -return r?Ke.parse(r,lt(xa)):null}a(Yt,"parseIntegerArray");function va(r){return r? -Ke.parse(r,lt(function(e){return _i(e).trim()})):null}a(va,"parseBigIntegerArray"); -var _a=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!== -null&&(t=er(t)),t});return e.parse()},"parsePointArray"),Zt=a(function(r){if(!r) -return null;var e=ze.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); -return e.parse()},"parseFloatArray"),ne=a(function(r){if(!r)return null;var e=ze. -create(r);return e.parse()},"parseStringArray"),Jt=a(function(r){if(!r)return null; -var e=ze.create(r,function(t){return t!==null&&(t=ht(t)),t});return e.parse()},"\ -parseDateArray"),Aa=a(function(r){if(!r)return null;var e=ze.create(r,function(t){ -return t!==null&&(t=Ei(t)),t});return e.parse()},"parseIntervalArray"),Ca=a(function(r){ -return r?Ke.parse(r,lt(xi)):null},"parseByteAArray"),Xt=a(function(r){return parseInt( -r,10)},"parseInteger"),_i=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: -r},"parseBigInteger"),Si=a(function(r){return r?Ke.parse(r,lt(JSON.parse)):null}, -"parseJsonArray"),er=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- -1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Ta=a(function(r){ -if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1,i=2;i{"use strict";p();var Z=1e6;function Pa(r){var e=r.readInt32BE( -0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u, -c,h,l;{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ -u+i;for(c="",h=6-u.length,l=0;l>>0,o=4294967296* -s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l< -h;l++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), -t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l{p();var Ba=Ii(),F=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(C,B,j){ -return C*Math.pow(2,j)+B};var s=t>>3,o=a(function(C){return n?~C&255:C},"inv"),u=255, -c=8-t%8;e>t%8);var h=0;t%8+e>=8&&(h=i(0,o(r[s])& -u,c));for(var l=e+t>>3,d=s+1;d0&& -(h=i(h,o(r[l])>>8-b,b)),h},"parseBits"),Li=a(function(r,e,t){var n=Math.pow(2,t- -1)-1,i=F(r,1),s=F(r,t,1);if(s===0)return 0;var o=1,u=a(function(h,l,d){h===0&&(h= -1);for(var b=1;b<=d;b++)o/=2,(l&1<0&&(h+=o);return h},"parsePrecisionBits"), -c=F(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: --1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),La=a(function(r){return F(r,1)==1?-1* -(F(r,15,1,!0)+1):F(r,15,1)},"parseInt16"),Pi=a(function(r){return F(r,1)==1?-1*(F( -r,31,1,!0)+1):F(r,31,1)},"parseInt32"),Ra=a(function(r){return Li(r,23,8)},"pars\ -eFloat32"),Fa=a(function(r){return Li(r,52,11)},"parseFloat64"),Ma=a(function(r){ -var e=F(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,F(r,16,16)),n=0,i=[], -s=F(r,16),o=0;o>3,(i+=l<<3)>>3), -d;console.log("ERROR: ElementType not implemented: "+h)},"parseElement"),c=a(function(h,l){ -var d=[],b;if(h.length>1){var C=h.shift();for(b=0;b0},"parseBool"),Oa=a(function(r){r(20,Ba),r(21,La),r(23,Pi),r(26, -Pi),r(1700,Ma),r(700,Ra),r(701,Fa),r(16,ka),r(1114,Bi.bind(null,!1)),r(1184,Bi.bind( -null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye),r(1008,Ye),r(1009,Ye),r(25,Da)},"init"); -Ri.exports={init:Oa}});var Di=I((Wh,Mi)=>{p();Mi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, -REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194, -SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703, -TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033, -BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186, -TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203, -REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220, -PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642, -REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Xe=I(Je=>{p();var Ua=Ci(),Na=Fi(),qa=Vt(),Qa=Di();Je.getTypeParser=ja;Je.setTypeParser= -Wa;Je.arrayParser=qa;Je.builtins=Qa;var Ze={text:{},binary:{}};function ki(r){return String( -r)}a(ki,"noParse");function ja(r,e){return e=e||"text",Ze[e]&&Ze[e][r]||ki}a(ja, -"getTypeParser");function Wa(r,e,t){typeof e=="function"&&(t=e,e="text"),Ze[e][r]= -t}a(Wa,"setTypeParser");Ua.init(function(r,e){Ze.text[r]=e});Na.init(function(r,e){ -Ze.binary[r]=e})});var et=I((Kh,tr)=>{"use strict";p();tr.exports={host:"localhost",user:m.platform=== -"win32"?m.env.USERNAME:m.env.USER,database:void 0,password:null,connectionString:void 0, -port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1, -application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, -statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1, -connect_timeout:0,keepalives:1,keepalives_idle:0};var ke=Xe(),Ha=ke.getTypeParser( -20,"text"),Ga=ke.getTypeParser(1016,"text");tr.exports.__defineSetter__("parseIn\ -t8",function(r){ke.setTypeParser(20,"text",r?ke.getTypeParser(23,"text"):Ha),ke. -setTypeParser(1016,"text",r?ke.getTypeParser(1007,"text"):Ga)})});var tt=I((Yh,Ui)=>{"use strict";p();var $a=(Ht(),N(Wt)),Va=et();function Ka(r){var e=r. -replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Ka,"escapeElement"); -function Oi(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> -"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Oi(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. -toString("hex"):e+=Ka(ft(r[t]));return e=e+"}",e}a(Oi,"arrayString");var ft=a(function(r,e){ -if(r==null)return null;if(r instanceof y)return r;if(ArrayBuffer.isView(r)){var t=y. -from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice( -r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Va.parseInputDatesAsUTC? -Za(r):Ya(r):Array.isArray(r)?Oi(r):typeof r=="object"?za(r,e):r.toString()},"pre\ -pareValue");function za(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. -indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+ -r+'" for query');return e.push(r),ft(r.toPostgres(ft),e)}return JSON.stringify(r)} -a(za,"prepareObject");function H(r,e){for(r=""+r;r.length{"use strict";p();var nr=(Ht(),N(Wt));function eu(r){if(r.indexOf( -"SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is cur\ -rently supported");let e=nr.randomBytes(18).toString("base64");return{mechanism:"\ -SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"SASLInitialResponse"}} -a(eu,"startSession");function tu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( -"SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!= -"string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a\ - string");let n=iu(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== -r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ -once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serv\ -er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=au(e, -i,n.iteration),o=Oe(s,"Client Key"),u=ou(o),c="n=*,r="+r.clientNonce,h="r="+n.nonce+ -",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,d=c+","+h+","+l,b=Oe(u,d),C=Qi( -o,b),B=C.toString("base64"),j=Oe(s,"Server Key"),X=Oe(j,d);r.message="SASLRespon\ -se",r.serverSignature=X.toString("base64"),r.response=l+",p="+B}a(tu,"continueSe\ -ssion");function ru(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ -st message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: S\ -CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=su( -e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: s\ -erver signature does not match")}a(ru,"finalizeSession");function nu(r){if(typeof r!= -"string")throw new TypeError("SASL: text must be a string");return r.split("").map( -(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(nu,"isPrintableC\ -hars");function Ni(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(Ni,"isBase64");function qi(r){if(typeof r!="string")throw new TypeError( -"SASL: attribute pairs text must be a string");return new Map(r.split(",").map(e=>{ -if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let t=e[0], -n=e.substring(2);return[t,n]}))}a(qi,"parseAttributePairs");function iu(r){let e=qi( -r),t=e.get("r");if(t){if(!nu(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ -E: nonce must only contain printable characters")}else throw new Error("SASL: SC\ -RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Ni(n))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("S\ -ASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/. -test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration cou\ -nt")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); -let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(iu,"parseServerFirstMe\ -ssage");function su(r){let t=qi(r).get("v");if(t){if(!Ni(t))throw new Error("SAS\ -L: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error( -"SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}} -a(su,"parseServerFinalMessage");function Qi(r,e){if(!y.isBuffer(r))throw new TypeError( -"first argument must be a Buffer");if(!y.isBuffer(e))throw new TypeError("second\ - argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer leng\ -ths must match");if(r.length===0)throw new Error("Buffers cannot be empty");return y. -from(r.map((t,n)=>r[n]^e[n]))}a(Qi,"xorBuffers");function ou(r){return nr.createHash( -"sha256").update(r).digest()}a(ou,"sha256");function Oe(r,e){return nr.createHmac( -"sha256",r).update(e).digest()}a(Oe,"hmacSha256");function au(r,e,t){for(var n=Oe( -r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;suu});function uu(...r){return r.join("/")}var sr=z(()=>{ -"use strict";p();a(uu,"join")});var or={};te(or,{stat:()=>cu});function cu(r,e){e(new Error("No filesystem"))}var ar=z( -()=>{"use strict";p();a(cu,"stat")});var ur={};te(ur,{default:()=>hu});var hu,cr=z(()=>{"use strict";p();hu={}});var Hi={};te(Hi,{StringDecoder:()=>hr});var lr,hr,Gi=z(()=>{"use strict";p();lr= -class lr{constructor(e){_(this,"td");this.td=new TextDecoder(e)}write(e){return this. -td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}};a(lr,"StringDecoder"); -hr=lr});var zi=I((cl,Ki)=>{"use strict";p();var{Transform:lu}=(cr(),N(ur)),{StringDecoder:fu}=(Gi(),N(Hi)), -Se=Symbol("last"),pt=Symbol("decoder");function pu(r,e,t){let n;if(this.overflow){ -if(n=this[pt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. -overflow=!1}else this[Se]+=this[pt].write(r),n=this[Se].split(this.matcher);this[Se]= -n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ -t(new Error("maximum buffer reached"));return}t()}a(pu,"transform");function du(r){ -if(this[Se]+=this[pt].end(),this[Se])try{Vi(this,this.mapper(this[Se]))}catch(e){ -return r(e)}r()}a(du,"flush");function Vi(r,e){e!==void 0&&r.push(e)}a(Vi,"push"); -function $i(r){return r}a($i,"noop");function yu(r,e,t){switch(r=r||/\r?\n/,e=e|| -$i,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== -"object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2: -typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=$i)}t=Object. -assign({},t),t.autoDestroy=!0,t.transform=pu,t.flush=du,t.readableObjectMode=!0; -let n=new lu(t);return n[Se]="",n[pt]=new fu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= -t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){ -this._writableState.errorEmitted=!1,s(i)},n}a(yu,"split");Ki.exports=yu});var Ji=I((fl,pe)=>{"use strict";p();var Yi=(sr(),N(ir)),mu=(cr(),N(ur)).Stream,gu=zi(), -Zi=(Ge(),N(He)),wu=5432,dt=m.platform==="win32",rt=m.stderr,bu=56,Su=7,Eu=61440, -xu=32768;function vu(r){return(r&Eu)==xu}a(vu,"isRegFile");var Ue=["host","port", -"database","user","password"],fr=Ue.length,_u=Ue[fr-1];function pr(){var r=rt instanceof -mu&&rt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);rt.write(Zi.format.apply(Zi,e))}}a(pr,"warn");Object.defineProperty(pe.exports, -"isWin",{get:a(function(){return dt},"get"),set:a(function(r){dt=r},"set")});pe. -exports.warnTo=function(r){var e=rt;return rt=r,e};pe.exports.getFileName=function(r){ -var e=r||m.env,t=e.PGPASSFILE||(dt?Yi.join(e.APPDATA||"./","postgresql","pgpass.\ -conf"):Yi.join(e.HOME||"./",".pgpass"));return t};pe.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:dt?!0:(e=e||"\ -",vu(r.mode)?r.mode&(bu|Su)?(pr('WARNING: password file "%s" has group or \ -world access; permissions should be u=rw (0600) or less',e),!1):!0:(pr('WARNING:\ - password file "%s" is not a plain file',e),!1))};var Au=pe.exports.match=function(r,e){ -return Ue.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||wu)===Number( -e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};pe.exports.getPassword=function(r,e,t){ -var n,i=e.pipe(gu());function s(c){var h=Cu(c);h&&Tu(h)&&Au(r,h)&&(n=h[_u],i.end())} -a(s,"onLine");var o=a(function(){e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(), -pr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. -on("data",s).on("end",o).on("error",u)};var Cu=pe.exports.parseLine=function(r){ -if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={}, -u=!1,c=a(function(l,d,b){var C=r.substring(d,b);Object.hasOwnProperty.call(m.env, -"PGPASS_NO_DEESCAPE")||(C=C.replace(/\\([:\\])/g,"$1")),o[Ue[l]]=C},"addToObj"), -h=0;h=0&&e==":"&&t!=="\\"&&(c(n,i,h+1),i=h+2,n+=1)}return o=Object.keys(o).length=== -fr?o:null,o},Tu=pe.exports.isValidEntry=function(r){for(var e={0:function(o){return o. -length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&& -Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length> -0},4:function(o){return o.length>0}},t=0;t{"use strict";p();var yl=(sr(),N(ir)),Xi=(ar(),N(or)),yt=Ji(); -dr.exports=function(r,e){var t=yt.getFileName();Xi.stat(t,function(n,i){if(n||!yt. -usePgPass(i,t))return e(void 0);var s=Xi.createReadStream(t);yt.getPassword(r,s, -e)})};dr.exports.warnTo=yt.warnTo});var gt=I((wl,ts)=>{"use strict";p();var Iu=Xe();function mt(r){this._types=r||Iu, -this.text={},this.binary={}}a(mt,"TypeOverrides");mt.prototype.getOverrides=function(r){ -switch(r){case"text":return this.text;case"binary":return this.binary;default:return{}}}; -mt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), -this.getOverrides(e)[r]=t};mt.prototype.getTypeParser=function(r,e){return e=e|| -"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ts.exports=mt});var rs={};te(rs,{default:()=>Pu});var Pu,ns=z(()=>{"use strict";p();Pu={}});var is={};te(is,{parse:()=>yr});function yr(r,e=!1){let{protocol:t}=new URL(r),n="\ -http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,searchParams:d,hash:b}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( -i),h=decodeURIComponent(h);let C=i+":"+s,B=e?Object.fromEntries(d.entries()):l;return{ -href:r,protocol:t,auth:C,username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,query:B,hash:b}}var mr=z(()=>{"use strict";p();a(yr,"parse")});var os=I((_l,ss)=>{"use strict";p();var Bu=(mr(),N(is)),gr=(ar(),N(or));function wr(r){ -if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Bu. -parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(r)?encodeURI(r).replace(/\%25(\d\d)/g, -"%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&&(t[n]=t[n][t[n].length- -1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join(":"), -t.port=e.port,e.protocol=="socket:")return t.host=decodeURI(e.pathname),t.database= -e.query.db,t.client_encoding=e.query.encoding,t;t.host||(t.host=e.hostname);var s=e. -pathname;if(!t.host&&s&&/^%2f/i.test(s)){var o=s.split("/");t.host=decodeURIComponent( -o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt(0)==="/"&&(s=s.slice(1)||null), -t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0),t.ssl==="0"&& -(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&& -(t.ssl.cert=gr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gr.readFileSync( -t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=gr.readFileSync(t.sslrootcert).toString()), -t.sslmode){case"disable":{t.ssl=!1;break}case"prefer":case"require":case"verify-\ -ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized=!1;break}} -return t}a(wr,"parse");ss.exports=wr;wr.parse=wr});var wt=I((Tl,cs)=>{"use strict";p();var Lu=(ns(),N(rs)),us=et(),as=os().parse,$=a( -function(r,e,t){return t===void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]), -e[r]||t||us[r]},"val"),Ru=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ -prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify": -return{rejectUnauthorized:!1}}return us.ssl},"readSSLConfigFromEnvironment"),Ne=a( -function(r){return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quo\ -teParamValue"),ie=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Ne(n))},"ad\ -d"),Sr=class Sr{constructor(e){e=typeof e=="string"?as(e):e||{},e.connectionString&& -(e=Object.assign({},e,as(e.connectionString))),this.user=$("user",e),this.database= -$("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt( -$("port",e),10),this.host=$("host",e),Object.defineProperty(this,"password",{configurable:!0, -enumerable:!1,writable:!0,value:$("password",e)}),this.binary=$("binary",e),this. -options=$("options",e),this.ssl=typeof e.ssl>"u"?Ru():e.ssl,typeof this.ssl=="st\ -ring"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}), -this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this. -client_encoding=$("client_encoding",e),this.replication=$("replication",e),this. -isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=$("applicatio\ -n_name",e,"PGAPPNAME"),this.fallback_application_name=$("fallback_application_na\ -me",e,!1),this.statement_timeout=$("statement_timeout",e,!1),this.lock_timeout=$( -"lock_timeout",e,!1),this.idle_in_transaction_session_timeout=$("idle_in_transac\ -tion_session_timeout",e,!1),this.query_timeout=$("query_timeout",e,!1),e.connectionTimeoutMillis=== -void 0?this.connect_timeout=m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math. -floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive=== -!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle= -Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[]; -ie(t,this,"user"),ie(t,this,"password"),ie(t,this,"port"),ie(t,this,"application\ -_name"),ie(t,this,"fallback_application_name"),ie(t,this,"connect_timeout"),ie(t, -this,"options");var n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this. -ssl}:{};if(ie(t,n,"sslmode"),ie(t,n,"sslca"),ie(t,n,"sslkey"),ie(t,n,"sslcert"), -ie(t,n,"sslrootcert"),this.database&&t.push("dbname="+Ne(this.database)),this.replication&& -t.push("replication="+Ne(this.replication)),this.host&&t.push("host="+Ne(this.host)), -this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("cli\ -ent_encoding="+Ne(this.client_encoding)),Lu.lookup(this.host,function(i,s){return i? -e(i,null):(t.push("hostaddr="+Ne(s)),e(null,t.join(" ")))})}};a(Sr,"ConnectionPa\ -rameters");var br=Sr;cs.exports=br});var fs=I((Bl,ls)=>{"use strict";p();var Fu=Xe(),hs=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, -xr=class xr{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, -this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null, -this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=hs.exec(e.text):t=hs.exec(e.command),t&&(this.command=t[1],t[3]?(this. -oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt( -t[2],10)))}_parseRowAsArray(e){for(var t=new Array(e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Mu}=be(),ps=fs(),ds=tt(),_r=class _r extends Mu{constructor(e,t,n){ -super(),e=ds.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this. -rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal= -e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,m.domain&&e.callback&& -(this.callback=m.domain.bind(e.callback)),this._result=new ps(this._rowMode,this. -types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= -!1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this. -text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&& -(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ps( -this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ -this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this. -callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){ -try{t=this._result.parseRow(e.fields)}catch(n){this._canceledDueToError=n;return} -this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){ -this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){ -this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._canceledDueToError, -this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("er\ -ror",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError( -this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(t){ -m.nextTick(()=>{throw t})}this.emit("end",this._results)}submit(e){if(typeof this. -text!="string"&&typeof this.name!="string")return new Error("A query must have e\ -ither text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this. -name];return this.text&&t&&this.text!==t?new Error(`Prepared statements must be \ -unique - '${this.name}' was used for a different statement`):this.values&&!Array. -isArray(this.values)?new Error("Query values must be an array"):(this.requiresPreparation()? -this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this. -name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute( -{portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement= -!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types}); -try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this. -binary,valueMapper:ds.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( -{type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(_r,"Query"); -var vr=_r;ys.exports=vr});var bs={};te(bs,{Socket:()=>Ee,isIP:()=>Du});function Du(r){return 0}var ws,gs,v, -Ee,bt=z(()=>{"use strict";p();ws=Pe(be(),1);a(Du,"isIP");gs=/^[^.]+\./,v=class v extends ws.EventEmitter{constructor(){ -super(...arguments);_(this,"opts",{});_(this,"connecting",!1);_(this,"pending",!0); -_(this,"writable",!0);_(this,"encrypted",!1);_(this,"authorized",!1);_(this,"des\ -troyed",!1);_(this,"ws",null);_(this,"writeBuffer");_(this,"tlsState",0);_(this, -"tlsRead");_(this,"tlsWrite")}static get poolQueryViaFetch(){return v.opts.poolQueryViaFetch?? -v.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){v.opts.poolQueryViaFetch= -t}static get fetchEndpoint(){return v.opts.fetchEndpoint??v.defaults.fetchEndpoint}static set fetchEndpoint(t){ -v.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ -console.warn("The `fetchConnectionCache` option is deprecated (now always `true`\ -)")}static get fetchFunction(){return v.opts.fetchFunction??v.defaults.fetchFunction}static set fetchFunction(t){ -v.opts.fetchFunction=t}static get webSocketConstructor(){return v.opts.webSocketConstructor?? -v.defaults.webSocketConstructor}static set webSocketConstructor(t){v.opts.webSocketConstructor= -t}get webSocketConstructor(){return this.opts.webSocketConstructor??v.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return v.opts.wsProxy??v.defaults. -wsProxy}static set wsProxy(t){v.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? -v.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return v. -opts.coalesceWrites??v.defaults.coalesceWrites}static set coalesceWrites(t){v.opts. -coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??v.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return v.opts.useSecureWebSocket?? -v.defaults.useSecureWebSocket}static set useSecureWebSocket(t){v.opts.useSecureWebSocket= -t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??v.useSecureWebSocket}set useSecureWebSocket(t){ -this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return v.opts.forceDisablePgSSL?? -v.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){v.opts.forceDisablePgSSL= -t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??v.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return v.opts.disableSNI?? -v.defaults.disableSNI}static set disableSNI(t){v.opts.disableSNI=t}get disableSNI(){ -return this.opts.disableSNI??v.disableSNI}set disableSNI(t){this.opts.disableSNI= -t}static get pipelineConnect(){return v.opts.pipelineConnect??v.defaults.pipelineConnect}static set pipelineConnect(t){ -v.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? -v.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return v.opts.subtls??v.defaults.subtls}static set subtls(t){v.opts.subtls=t}get subtls(){ -return this.opts.subtls??v.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ -return v.opts.pipelineTLS??v.defaults.pipelineTLS}static set pipelineTLS(t){v.opts. -pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??v.pipelineTLS}set pipelineTLS(t){ -this.opts.pipelineTLS=t}static get rootCerts(){return v.opts.rootCerts??v.defaults. -rootCerts}static set rootCerts(t){v.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??v.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ -let i=this.wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configur\ -ed. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#ws\ -proxy-string--host-string-port-number--string--string");return typeof i=="functi\ -on"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){ -return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("\ -connect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"), -this.emit("ready")},"handleWebSocketOpen"),o=a((c,h=!1)=>{c.binaryType="arraybuf\ -fer",c.addEventListener("error",l=>{this.emit("error",l),this.emit("close")}),c. -addEventListener("message",l=>{if(this.tlsState===0){let d=y.from(l.data);this.emit( -"data",d)}}),c.addEventListener("close",()=>{this.emit("close")}),h?s():c.addEventListener( -"open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="st\ -ring"?parseInt(t,10):t)}catch(c){this.emit("error",c),this.emit("close");return} -try{let h=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== -void 0)this.ws=new this.webSocketConstructor(h),o(this.ws);else try{this.ws=new WebSocket( -h),o(this.ws)}catch{this.ws=new __unstable_WebSocket(h),o(this.ws)}}catch(c){let l=(this. -useSecureWebSocket?"https:":"http:")+"//"+u;fetch(l,{headers:{Upgrade:"websocket"}}). -then(d=>{if(this.ws=d.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, -!0)}).catch(d=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ - connect to the database failed. Please refer to https://github.com/neondatabase\ -/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined\ -. Details: ${d.message}`)),this.emit("close")})}}async startTls(t){if(this.subtls=== -void 0)throw new Error("For Postgres SSL connections, you must set `neonConfig.s\ -ubtls` to the subtls library. See https://github.com/neondatabase/serverless/blo\ -b/main/CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. -fromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i.read.bind( -i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o,{useSNI:!this. -disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead= -u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit( -"secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let t=await this. -tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data",n)}}}rawWrite(t){ -if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer===void 0)this. -writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer=void 0}, -0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this.writeBuffer), -n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf8",i=s=>{}){return t. -length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this.tlsState===0?(this. -rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write( -t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){return this. -write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed=!0,this. -end()}};a(v,"Socket"),_(v,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{ -let s;return i?.jwtAuth?s=t.replace(gs,"apiauth."):s=t.replace(gs,"api."),"https\ -://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0, -wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, -pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1}), -_(v,"opts",{});Ee=v});var Xr=I(T=>{"use strict";p();Object.defineProperty(T,"__esModule",{value:!0});T. -NoticeMessage=T.DataRowMessage=T.CommandCompleteMessage=T.ReadyForQueryMessage=T. -NotificationResponseMessage=T.BackendKeyDataMessage=T.AuthenticationMD5Password= -T.ParameterStatusMessage=T.ParameterDescriptionMessage=T.RowDescriptionMessage=T. -Field=T.CopyResponse=T.CopyDataMessage=T.DatabaseError=T.copyDone=T.emptyQuery=T. -replicationStart=T.portalSuspended=T.noData=T.closeComplete=T.bindComplete=T.parseComplete= -void 0;T.parseComplete={name:"parseComplete",length:5};T.bindComplete={name:"bin\ -dComplete",length:5};T.closeComplete={name:"closeComplete",length:5};T.noData={name:"\ -noData",length:5};T.portalSuspended={name:"portalSuspended",length:5};T.replicationStart= -{name:"replicationStart",length:4};T.emptyQuery={name:"emptyQuery",length:4};T.copyDone= -{name:"copyDone",length:4};var Nr=class Nr extends Error{constructor(e,t,n){super( -e),this.length=t,this.name=n}};a(Nr,"DatabaseError");var Ar=Nr;T.DatabaseError=Ar; -var qr=class qr{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; -a(qr,"CopyDataMessage");var Cr=qr;T.CopyDataMessage=Cr;var Qr=class Qr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Qr,"Co\ -pyResponse");var Tr=Qr;T.CopyResponse=Tr;var jr=class jr{constructor(e,t,n,i,s,o,u){ -this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s, -this.dataTypeModifier=o,this.format=u}};a(jr,"Field");var Ir=jr;T.Field=Ir;var Wr=class Wr{constructor(e,t){ -this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=new Array( -this.fieldCount)}};a(Wr,"RowDescriptionMessage");var Pr=Wr;T.RowDescriptionMessage= -Pr;var Hr=class Hr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= -"parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(Hr,"P\ -arameterDescriptionMessage");var Br=Hr;T.ParameterDescriptionMessage=Br;var Gr=class Gr{constructor(e,t,n){ -this.length=e,this.parameterName=t,this.parameterValue=n,this.name="parameterSta\ -tus"}};a(Gr,"ParameterStatusMessage");var Lr=Gr;T.ParameterStatusMessage=Lr;var $r=class $r{constructor(e,t){ -this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a($r,"Authenti\ -cationMD5Password");var Rr=$r;T.AuthenticationMD5Password=Rr;var Vr=class Vr{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Vr, -"BackendKeyDataMessage");var Fr=Vr;T.BackendKeyDataMessage=Fr;var Kr=class Kr{constructor(e,t,n,i){ -this.length=e,this.processId=t,this.channel=n,this.payload=i,this.name="notifica\ -tion"}};a(Kr,"NotificationResponseMessage");var Mr=Kr;T.NotificationResponseMessage= -Mr;var zr=class zr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ -ForQuery"}};a(zr,"ReadyForQueryMessage");var Dr=zr;T.ReadyForQueryMessage=Dr;var Yr=class Yr{constructor(e,t){ -this.length=e,this.text=t,this.name="commandComplete"}};a(Yr,"CommandCompleteMes\ -sage");var kr=Yr;T.CommandCompleteMessage=kr;var Zr=class Zr{constructor(e,t){this. -length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zr,"Data\ -RowMessage");var Or=Zr;T.DataRowMessage=Or;var Jr=class Jr{constructor(e,t){this. -length=e,this.message=t,this.name="notice"}};a(Jr,"NoticeMessage");var Ur=Jr;T.NoticeMessage= -Ur});var Ss=I(St=>{"use strict";p();Object.defineProperty(St,"__esModule",{value:!0}); -St.Writer=void 0;var tn=class tn{constructor(e=256){this.size=e,this.offset=5,this. -headerPosition=0,this.buffer=y.allocUnsafe(e)}ensure(e){var t=this.buffer.length- -this.offset;if(t>1)+e;this.buffer=y.allocUnsafe( -i),n.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]= -e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>> -8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2), -this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){ -if(!e)this.ensure(1);else{var t=y.byteLength(e);this.ensure(t+1),this.buffer.write( -e,this.offset,"utf-8"),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=""){ -var t=y.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this. -offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset), -this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this. -offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)} -return this.buffer.slice(e?0:5,this.offset)}flush(e){var t=this.join(e);return this. -offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(tn,"Wr\ -iter");var en=tn;St.Writer=en});var xs=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0}); -xt.serialize=void 0;var rn=Ss(),M=new rn.Writer,ku=a(r=>{M.addInt16(3).addInt16( -0);for(let n of Object.keys(r))M.addCString(n).addCString(r[n]);M.addCString("cl\ -ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new rn. -Writer().addInt32(t).add(e).flush()},"startup"),Ou=a(()=>{let r=y.allocUnsafe(8); -return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Uu=a(r=>M. -addCString(r).flush(112),"password"),Nu=a(function(r,e){return M.addCString(r).addInt32( -y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),qu=a( -function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),Qu=a( -r=>M.addCString(r).flush(81),"query"),Es=[],ju=a(r=>{let e=r.name||"";e.length>63&& -(console.error("Warning! Postgres only supports 63 characters for query names."), -console.error("You supplied %s (%s)",e,e.length),console.error("This can cause c\ -onflicts and silent errors executing queries"));let t=r.types||Es;for(var n=t.length, -i=M.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| -"",n=r.binary||!1,i=r.values||Es,s=i.length;return M.addCString(e).addCString(t), -M.addInt16(s),Wu(i,r.valueMapper),M.addInt16(s),M.add(qe.flush()),M.addInt16(n?1: -0),M.flush(66)},"bind"),Gu=y.from([69,0,0,0,9,0,0,0,0,0]),$u=a(r=>{if(!r||!r.portal&& -!r.rows)return Gu;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. -allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]= -0,s.writeUInt32BE(t,s.length-4),s},"execute"),Vu=a((r,e)=>{let t=y.allocUnsafe(16); -return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678,6),t.writeInt32BE( -r,8),t.writeInt32BE(e,12),t},"cancel"),nn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. -allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i}, -"cstringMessage"),Ku=M.addCString("P").flush(68),zu=M.addCString("S").flush(68), -Yu=a(r=>r.name?nn(68,`${r.type}${r.name||""}`):r.type==="P"?Ku:zu,"describe"),Zu=a( -r=>{let e=`${r.type}${r.name||""}`;return nn(67,e)},"close"),Ju=a(r=>M.add(r).flush( -100),"copyData"),Xu=a(r=>nn(102,r),"copyFail"),Et=a(r=>y.from([r,0,0,0,4]),"code\ -OnlyBuffer"),ec=Et(72),tc=Et(83),rc=Et(88),nc=Et(99),ic={startup:ku,password:Uu, -requestSsl:Ou,sendSASLInitialResponseMessage:Nu,sendSCRAMClientFinalMessage:qu,query:Qu, -parse:ju,bind:Hu,execute:$u,describe:Yu,close:Zu,flush:a(()=>ec,"flush"),sync:a( -()=>tc,"sync"),end:a(()=>rc,"end"),copyData:Ju,copyDone:a(()=>nc,"copyDone"),copyFail:Xu, -cancel:Vu};xt.serialize=ic});var vs=I(vt=>{"use strict";p();Object.defineProperty(vt,"__esModule",{value:!0}); -vt.BufferReader=void 0;var sc=y.allocUnsafe(0),on=class on{constructor(e=0){this. -offset=e,this.buffer=sc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. -buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+= -2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this. -buffer.readInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer. -toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){ -let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. -toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this. -offset+e);return this.offset+=e,t}};a(on,"BufferReader");var sn=on;vt.BufferReader= -sn});var Cs=I(_t=>{"use strict";p();Object.defineProperty(_t,"__esModule",{value:!0}); -_t.Parser=void 0;var D=Xr(),oc=vs(),an=1,ac=4,_s=an+ac,As=y.allocUnsafe(0),cn=class cn{constructor(e){ -if(this.buffer=As,this.bufferLength=0,this.bufferOffset=0,this.reader=new oc.BufferReader, -e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?. -mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength, -i=this.bufferOffset;for(;i+_s<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+an),u=an+o;if(u+i<=n){let c=this.handlePacket(i+_s,s,o,this.buffer);t(c),i+=u}else -break}i===n?(this.buffer=As,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength= -n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+ -e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let i;if(t<=this.buffer. -byteLength&&this.bufferOffset>=this.bufferLength)i=this.buffer;else{let s=this.buffer. -byteLength*2;for(;t>=s;)s*=2;i=y.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset, -this.bufferOffset+this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this. -buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer= -e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){switch(t){case 50: -return D.bindComplete;case 49:return D.parseComplete;case 51:return D.closeComplete;case 110: -return D.noData;case 115:return D.portalSuspended;case 99:return D.copyDone;case 87: -return D.replicationStart;case 73:return D.emptyQuery;case 68:return this.parseDataRowMessage( -e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this. -parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e, -n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this. -parseParameterStatusMessage(e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69: -return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessage( -e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this. -parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e, -n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData( -e,n,i);default:return new D.DatabaseError("received invalid response: "+t.toString( -16),n,"error")}}parseReadyForQueryMessage(e,t,n){this.reader.setBuffer(e,n);let i=this. -reader.string(1);return new D.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new D.CommandCompleteMessage( -t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new D.CopyDataMessage( -t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyInRespons\ -e")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ -se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!== -0,o=this.reader.int16(),u=new D.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(xe,"__esModule",{value:!0}); -xe.DatabaseError=xe.serialize=xe.parse=void 0;var uc=Xr();Object.defineProperty( -xe,"DatabaseError",{enumerable:!0,get:a(function(){return uc.DatabaseError},"get")}); -var cc=xs();Object.defineProperty(xe,"serialize",{enumerable:!0,get:a(function(){ -return cc.serialize},"get")});var hc=Cs();function lc(r,e){let t=new hc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(lc,"parse");xe. -parse=lc});var Ts={};te(Ts,{connect:()=>fc});function fc({socket:r,servername:e}){return r. -startTls(e),r}var Is=z(()=>{"use strict";p();a(fc,"connect")});var pn=I((sf,Ls)=>{"use strict";p();var Ps=(bt(),N(bs)),pc=be().EventEmitter,{parse:dc, -serialize:Q}=hn(),Bs=Q.flush(),yc=Q.sync(),mc=Q.end(),fn=class fn extends pc{constructor(e){ -super(),e=e||{},this.stream=e.stream||new Ps.Socket,this._keepAlive=e.keepAlive, -this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer= -!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage= -!1;var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){ -var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e, -t),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0, -n._keepAliveInitialDelayMillis),n.emit("connect")});let i=a(function(s){n._ending&& -(s.code==="ECONNRESET"||s.code==="EPIPE")||n.emit("error",s)},"reportStreamError"); -if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this. -ssl)return this.attachListeners(this.stream);this.stream.once("data",function(s){ -var o=s.toString("utf8");switch(o){case"S":break;case"N":return n.stream.end(),n. -emit("error",new Error("The server does not support SSL connections"));default:return n. -stream.end(),n.emit("error",new Error("There was an error establishing an SSL co\ -nnection"))}var u=(Is(),N(Ts));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( -c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Ps.isIP(t)===0&&(c.servername=t);try{ -n.stream=u.connect(c)}catch(h){return n.emit("error",h)}n.attachListeners(n.stream), -n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{ -this.emit("end")}),dc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(Q.requestSsl())}startup(e){ -this.stream.write(Q.startup(e))}cancel(e,t){this._send(Q.cancel(e,t))}password(e){ -this._send(Q.password(e))}sendSASLInitialResponseMessage(e,t){this._send(Q.sendSASLInitialResponseMessage( -e,t))}sendSCRAMClientFinalMessage(e){this._send(Q.sendSCRAMClientFinalMessage(e))}_send(e){ -return this.stream.writable?this.stream.write(e):!1}query(e){this._send(Q.query( -e))}parse(e){this._send(Q.parse(e))}bind(e){this._send(Q.bind(e))}execute(e){this. -_send(Q.execute(e))}flush(){this.stream.writable&&this.stream.write(Bs)}sync(){this. -_ending=!0,this._send(Bs),this._send(yc)}ref(){this.stream.ref()}unref(){this.stream. -unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this. -stream.end();return}return this.stream.write(mc,()=>{this.stream.end()})}close(e){ -this._send(Q.close(e))}describe(e){this._send(Q.describe(e))}sendCopyFromChunk(e){ -this._send(Q.copyData(e))}endCopyFrom(){this._send(Q.copyDone())}sendCopyFail(e){ -this._send(Q.copyFail(e))}};a(fn,"Connection");var ln=fn;Ls.exports=ln});var Ms=I((cf,Fs)=>{"use strict";p();var gc=be().EventEmitter,uf=(Ge(),N(He)),wc=tt(), -dn=Wi(),bc=es(),Sc=gt(),Ec=wt(),Rs=ms(),xc=et(),vc=pn(),yn=class yn extends gc{constructor(e){ -super(),this.connectionParameters=new Ec(e),this.user=this.connectionParameters. -user,this.database=this.connectionParameters.database,this.port=this.connectionParameters. -port,this.host=this.connectionParameters.host,Object.defineProperty(this,"passwo\ -rd",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), -this.replication=this.connectionParameters.replication;var t=e||{};this._Promise= -t.Promise||S.Promise,this._types=new Sc(t.types),this._ending=!1,this._connecting= -!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection= -t.connection||new vc({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. -keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. -connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t. -binary||xc.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. -ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), -this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=a( -n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError");this.activeQuery&& -(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue. -length=0}_connect(e){var t=this,n=this.connection;if(this._connectionCallback=e, -this._connecting||this._connected){let i=new Error("Client has already been conn\ -ected. You cannot reuse a client.");m.nextTick(()=>{e(i)});return}this._connecting= -!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle= -setTimeout(()=>{n._ending=!0,n.stream.destroy(new Error("timeout expired"))},this. -_connectionTimeoutMillis)),this.host&&this.host.indexOf("/")===0?n.connect(this. -host+"/.s.PGSQL."+this.port):n.connect(this.port,this.host),n.on("connect",function(){ -t.ssl?n.requestSsl():n.startup(t.getStartupConf())}),n.on("sslconnect",function(){ -n.startup(t.getStartupConf())}),this._attachListeners(n),n.once("end",()=>{let i=this. -_ending?new Error("Connection terminated"):new Error("Connection terminated unex\ -pectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this. -_ending||(this._connecting&&!this._connectionError?this._connectionCallback?this. -_connectionCallback(i):this._handleErrorEvent(i):this._connectionError||this._handleErrorEvent( -i)),m.nextTick(()=>{this.emit("end")})})}connect(e){if(e){this._connect(e);return} -return new this._Promise((t,n)=>{this._connect(i=>{i?n(i):t()})})}_attachListeners(e){ -e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)), -e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("a\ -uthenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLCont\ -inue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this. -_handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData. -bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage", -this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery. -bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this. -_handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)), -e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery", -this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete. -bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("cop\ -yInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData. -bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){ -let t=this.connection;typeof this.password=="function"?this._Promise.resolve().then( -()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("erro\ -r",new TypeError("Password must be a string"));return}this.connectionParameters. -password=this.password=n}else this.connectionParameters.password=this.password=null; -e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():bc(this.connectionParameters, -n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ -this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){ -this._checkPgPass(()=>{let t=wc.postgresMd5PasswordHash(this.user,this.password, -e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{ -this.saslSession=dn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){ -dn.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage( -this.saslSession.response)}_handleAuthSASLFinal(e){dn.finalizeSession(this.saslSession, -e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID, -this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting= -!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&& -(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("c\ -onnect"));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&& -t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){ -if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle), -this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){ -if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1, -this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting) -return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t){this._handleErrorEvent( -e);return}this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){ -this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow( -e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){ -this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this. -activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this. -activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this. -activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse( -this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){ -this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){ -var e=this.connectionParameters,t={user:e.user,database:e.database},n=e.application_name|| -e.fallback_application_name;return n&&(t.application_name=n),e.replication&&(t.replication= -""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout, -10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&& -(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout, -10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var n=this. -connection;this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+ -this.port):n.connect(this.port,this.host),n.on("connect",function(){n.cancel(e.processID, -e.secretKey)})}else e.queryQueue.indexOf(t)!==-1&&e.queryQueue.splice(e.queryQueue. -indexOf(t),1)}setTypeParser(e,t,n){return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){ -return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g, -'""')+'"'}escapeLiteral(e){for(var t=!1,n="'",i=0;i{this.activeQuery.handleError(e,this.connection),this.readyForQuery= -!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this. -emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError("Client\ - was passed a null or undefined query");return typeof e.submit=="function"?(o=e. -query_timeout||this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&& -(i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new Rs( -e,t,n),i.callback||(s=new this._Promise((h,l)=>{i.callback=(d,b)=>d?l(d):h(b)}))), -o&&(c=i.callback,u=setTimeout(()=>{var h=new Error("Query read timeout");m.nextTick( -()=>{i.handleError(h,this.connection)}),c(h),i.callback=()=>{};var l=this.queryQueue. -indexOf(i);l>-1&&this.queryQueue.splice(l,1),this._pulseQueryQueue()},o),i.callback= -(h,l)=>{clearTimeout(u),c(h,l)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& -!i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(m. -nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"), -this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick( -()=>{i.handleError(new Error("Client has encountered a connection error and is n\ -ot queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.connection. -unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(e)e();else return this. -_Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream. -destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};a(yn,"Client");var At=yn;At.Query= -Rs;Fs.exports=At});var Us=I((ff,Os)=>{"use strict";p();var _c=be().EventEmitter,Ds=a(function(){},"\ -NOOP"),ks=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, -"removeWhere"),wn=class wn{constructor(e,t,n){this.client=e,this.idleListener=t, -this.timeoutId=n}};a(wn,"IdleItem");var mn=wn,bn=class bn{constructor(e){this.callback= -e}};a(bn,"PendingItem");var Qe=bn;function Ac(){throw new Error("Release called \ -on client which has already been released to the pool.")}a(Ac,"throwOnDoubleRele\ -ase");function Ct(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ -o?t(o):n(u)},"cb"),s=new r(function(o,u){n=o,t=u}).catch(o=>{throw Error.captureStackTrace( -o),o});return{callback:i,result:s}}a(Ct,"promisify");function Cc(r,e){return a(function t(n){ -n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log("additional clien\ -t error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)}, -"idleListener")}a(Cc,"makeIdleListener");var Sn=class Sn extends _c{constructor(e,t){ -super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty( -this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}), -e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}), -this.options.max=this.options.max||this.options.poolSize||10,this.options.maxUses= -this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle|| -!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this. -options.log||function(){},this.Client=this.options.Client||t||Tt().Client,this.Promise= -this.options.Promise||S.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. -options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet, -this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){ -return this._clients.length>=this.options.max}_pulseQueue(){if(this.log("pulse q\ -ueue"),this.ended){this.log("pulse queue ended");return}if(this.ending){this.log( -"pulse queue on ending"),this._idle.length&&this._idle.slice().map(t=>{this._remove( -t.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this. -_pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&& -this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this. -_idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener; -return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e); -throw new Error("unexpected condition")}_remove(e){let t=ks(this._idle,n=>n.client=== -e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(n=>n!== -e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Can\ -not use a pool after calling end on the pool");return e?e(i):this.Promise.reject( -i)}let t=Ct(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. -_idle.length&&m.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis) -return this._pendingQueue.push(new Qe(t.callback)),n;let i=a((u,c,h)=>{clearTimeout( -o),t.callback(u,c,h)},"queueCallback"),s=new Qe(i),o=setTimeout(()=>{ks(this._pendingQueue, -u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when try\ -ing to connect"))},this.options.connectionTimeoutMillis);return this._pendingQueue. -push(s),n}return this.newClient(new Qe(t.callback)),n}newClient(e){let t=new this. -Client(this.options);this._clients.push(t);let n=Cc(this,t);this.log("checking c\ -lient timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{ -this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): -t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"), -t.connect(o=>{if(i&&clearTimeout(i),t.on("error",n),o)this.log("client failed to\ - connect",o),this._clients=this._clients.filter(u=>u!==t),s&&(o.message="Connect\ -ion terminated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback( -o,void 0,Ds);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== -0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. -_expired.add(t),this._idle.findIndex(h=>h.client===t)!==-1&&this._acquireClient( -t,new Qe((h,l,d)=>d()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( -"end",()=>clearTimeout(u))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ -i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n), -e.removeListener("error",n),t.timedOut?i&&this.options.verify?this.options.verify( -e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,Ds);t.callback(void 0,e,e.release)}):t.callback(void 0, -e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Ac(),n=!0,this._release(e, -t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1, -this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= -this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove ex\ -pended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e)){ -this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue(); -return}let s;this.options.idleTimeoutMillis&&(s=setTimeout(()=>{this.log("remove\ - idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&& -s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new mn(e,t,s)), -this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Ct(this.Promise,e); -return E(function(){return s.callback(new Error("Passing a function as the first\ - parameter to pool.query is not supported"))}),s.result}typeof t=="function"&&(n= -t,t=void 0);let i=Ct(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) -return n(s);let u=!1,c=a(h=>{u||(u=!0,o.release(h),n(h))},"onError");o.once("err\ -or",c),this.log("dispatching query");try{o.query(e,t,(h,l)=>{if(this.log("query \ -dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(h),h?n(h):n(void 0, -l)})}catch(h){return o.release(h),n(h)}}),i.result}end(e){if(this.log("ending"), -this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=Ct(this.Promise,e);return this._endCallback= -t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue. -length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients. -reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients. -length}};a(Sn,"Pool");var gn=Sn;Os.exports=gn});var Ns={};te(Ns,{default:()=>Tc});var Tc,qs=z(()=>{"use strict";p();Tc={}});var Qs=I((mf,Ic)=>{Ic.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ - client - pure javascript & libpq with the same API",keywords:["database","libpq", -"pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/bri\ -anc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-post\ -gres.git",directory:"packages/pg"},author:"Brian Carlson ",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0", -"pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-ty\ -pes":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"\ -4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{ -"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS\ -.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c\ -7b9a5491a178655"}});var Hs=I((gf,Ws)=>{"use strict";p();var js=be().EventEmitter,Pc=(Ge(),N(He)),En=tt(), -je=Ws.exports=function(r,e,t){js.call(this),r=En.normalizeQueryConfig(r,e,t),this. -text=r.text,this.values=r.values,this.name=r.name,this.callback=r.callback,this. -state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1,this.on("\ -newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Pc.inherits( -je,js);var Bc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ -age",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"\ -dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"\ -routine"};je.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); -if(e)for(var t in e){var n=Bc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. -emit("error",r),this.state="error"};je.prototype.then=function(r,e){return this. -_getPromise().then(r,e)};je.prototype.catch=function(r){return this._getPromise(). -catch(r)};je.prototype._getPromise=function(){return this._promise?this._promise: -(this._promise=new Promise(function(r,e){this._once("end",r),this._once("error", -e)}.bind(this)),this._promise)};je.prototype.submit=function(r){this.state="runn\ -ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a( -function(s,o,u){if(r.native.arrayMode=!1,E(function(){e.emit("_done")}),s)return e. -handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,h)=>{c.forEach(l=>{e.emit( -"row",l,u[h])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( -"end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind( -t)),this.name){this.name.length>63&&(console.error("Warning! Postgres only suppo\ -rts 63 characters for query names."),console.error("You supplied %s (%s)",this.name, -this.name.length),console.error("This can cause conflicts and silent errors exec\ -uting queries"));var n=(this.values||[]).map(En.prepareValue);if(r.namedQueries[this. -name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Pre\ -pared statements must be unique - '${this.name}' was used for a different statem\ -ent`);return t(s)}return r.native.execute(this.name,n,t)}return r.native.prepare( -this.name,this.text,n.length,function(s){return s?t(s):(r.namedQueries[e.name]=e. -text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray(this. -values)){let s=new Error("Query values must be an array");return t(s)}var i=this. -values.map(En.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. -text,t)}});var Ks=I((Ef,Vs)=>{"use strict";p();var Lc=(qs(),N(Ns)),Rc=gt(),Sf=Qs(),Gs=be(). -EventEmitter,Fc=(Ge(),N(He)),Mc=wt(),$s=Hs(),J=Vs.exports=function(r){Gs.call(this), -r=r||{},this._Promise=r.Promise||S.Promise,this._types=new Rc(r.types),this.native= -new Lc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= -!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Mc( -r);this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, -writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port= -e.port,this.namedQueries={}};J.Query=$s;Fc.inherits(J,Gs);J.prototype._errorAllQueries= -function(r){let e=a(t=>{m.nextTick(()=>{t.native=this.native,t.handleError(r)})}, -"enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= -null),this._queryQueue.forEach(e),this._queryQueue.length=0};J.prototype._connect= -function(r){var e=this;if(this._connecting){m.nextTick(()=>r(new Error("Client h\ -as already been connected. You cannot reuse a client.")));return}this._connecting= -!0,this.connectionParameters.getLibpqConnectionString(function(t,n){if(t)return r( -t);e.native.connect(n,function(i){if(i)return e.native.end(),r(i);e._connected=!0, -e.native.on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("er\ -ror",s)}),e.native.on("notification",function(s){e.emit("notification",{channel:s. -relname,payload:s.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),r()})})};J. -prototype.connect=function(r){if(r){this._connect(r);return}return new this._Promise( -(e,t)=>{this._connect(n=>{n?t(n):e()})})};J.prototype.query=function(r,e,t){var n, -i,s,o,u;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ -ery");if(typeof r.submit=="function")s=r.query_timeout||this.connectionParameters. -query_timeout,i=n=r,typeof e=="function"&&(r.callback=e);else if(s=this.connectionParameters. -query_timeout,n=new $s(r,e,t),!n.callback){let c,h;i=new this._Promise((l,d)=>{c= -l,h=d}),n.callback=(l,d)=>l?h(l):c(d)}return s&&(u=n.callback,o=setTimeout(()=>{ -var c=new Error("Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}), -u(c),n.callback=()=>{};var h=this._queryQueue.indexOf(n);h>-1&&this._queryQueue. -splice(h,1),this._pulseQueryQueue()},s),n.callback=(c,h)=>{clearTimeout(o),u(c,h)}), -this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( -new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push( -n),this._pulseQueryQueue(),i):(n.native=this.native,m.nextTick(()=>{n.handleError( -new Error("Client has encountered a connection error and is not queryable"))}),i)}; -J.prototype.end=function(r){var e=this;this._ending=!0,this._connected||this.once( -"connect",this.end.bind(this,r));var t;return r||(t=new this._Promise(function(n,i){ -r=a(s=>s?i(s):n(),"cb")})),this.native.end(function(){e._errorAllQueries(new Error( -"Connection terminated")),m.nextTick(()=>{e.emit("end"),r&&r()})}),t};J.prototype. -_hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="\ -error"&&this._activeQuery.state!=="end"};J.prototype._pulseQueryQueue=function(r){ -if(this._connected&&!this._hasActiveQuery()){var e=this._queryQueue.shift();if(!e){ -r||this.emit("drain");return}this._activeQuery=e,e.submit(this);var t=this;e.once( -"_done",function(){t._pulseQueryQueue()})}};J.prototype.cancel=function(r){this. -_activeQuery===r?this.native.cancel(function(){}):this._queryQueue.indexOf(r)!== --1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};J.prototype.ref=function(){}; -J.prototype.unref=function(){};J.prototype.setTypeParser=function(r,e,t){return this. -_types.setTypeParser(r,e,t)};J.prototype.getTypeParser=function(r,e){return this. -_types.getTypeParser(r,e)}});var xn=I((_f,zs)=>{"use strict";p();zs.exports=Ks()});var Tt=I((Cf,nt)=>{"use strict";p();var Dc=Ms(),kc=et(),Oc=pn(),Uc=Us(),{DatabaseError:Nc}=hn(), -qc=a(r=>{var e;return e=class extends Uc{constructor(n){super(n,r)}},a(e,"BoundP\ -ool"),e},"poolFactory"),vn=a(function(r){this.defaults=kc,this.Client=r,this.Query= -this.Client.Query,this.Pool=qc(this.Client),this._pools=[],this.Connection=Oc,this. -types=Xe(),this.DatabaseError=Nc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?nt. -exports=new vn(xn()):(nt.exports=new vn(Dc),Object.defineProperty(nt.exports,"na\ -tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new vn(xn())}catch(e){ -if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(nt.exports,"\ -native",{value:r}),r}}))});var Gc={};te(Gc,{Client:()=>Pt,ClientBase:()=>se.ClientBase,Connection:()=>se.Connection, -DatabaseError:()=>se.DatabaseError,NeonDbError:()=>ue,Pool:()=>An,Query:()=>se.Query, -defaults:()=>se.defaults,neon:()=>_n,neonConfig:()=>Ee,types:()=>se.types});module. -exports=N(Gc);p();var Bt=Pe(Tt());bt();p();bt();mr();var Js=Pe(tt()),Xs=Pe(gt());var It=class It extends Error{constructor(t){super(t);_(this,"name","NeonDbError"); -_(this,"severity");_(this,"code");_(this,"detail");_(this,"hint");_(this,"positi\ -on");_(this,"internalPosition");_(this,"internalQuery");_(this,"where");_(this,"\ -schema");_(this,"table");_(this,"column");_(this,"dataType");_(this,"constraint"); -_(this,"file");_(this,"line");_(this,"routine");_(this,"sourceError");"captureSt\ -ackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace( -this,It)}};a(It,"NeonDbError");var ue=It,Ys="transaction() expects an array of q\ -ueries, or a function returning an array of queries",Qc=["severity","code","deta\ -il","hint","position","internalPosition","internalQuery","where","schema","table", -"column","dataType","constraint","file","line","routine"];function _n(r,{arrayMode:e, -fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,queryCallback:u, -resultCallback:c,authToken:h}={}){if(!r)throw new Error("No database connection \ -string was provided to `neon()`. Perhaps an environment variable has not been se\ -t?");let l;try{l=yr(r)}catch{throw new Error("Database connection string provide\ -d to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:d, -username:b,hostname:C,port:B,pathname:j}=l;if(d!=="postgres:"&&d!=="postgresql:"|| -!b||!C||!j)throw new Error("Database connection string format for `neon()` shoul\ -d be: postgresql://user:password@host.tld/dbname?option=value");function X(A,...w){ -let P,V;if(typeof A=="string")P=A,V=w[1],w=w[0]??[];else{P="";for(let W=0;W(0,Js.prepareValue)(W));let O={query:P, -params:w};return u&&u(O),jc(de,O,V)}a(X,"resolve"),X.transaction=async(A,w)=>{if(typeof A== -"function"&&(A=A(X)),!Array.isArray(A))throw new Error(Ys);A.forEach(O=>{if(O[Symbol. -toStringTag]!=="NeonQueryPromise")throw new Error(Ys)});let P=A.map(O=>O.parameterizedQuery), -V=A.map(O=>O.opts??{});return de(P,V,w)};async function de(A,w,P){let{fetchEndpoint:V, -fetchFunction:O}=Ee,W=typeof V=="function"?V(C,B,{jwtAuth:h!==void 0}):V,ce=Array. -isArray(A)?{queries:A}:A,ee=n??{},R=e??!1,G=t??!1,he=i,ye=s,ve=o;P!==void 0&&(P. -fetchOptions!==void 0&&(ee={...ee,...P.fetchOptions}),P.arrayMode!==void 0&&(R=P. -arrayMode),P.fullResults!==void 0&&(G=P.fullResults),P.isolationLevel!==void 0&& -(he=P.isolationLevel),P.readOnly!==void 0&&(ye=P.readOnly),P.deferrable!==void 0&& -(ve=P.deferrable)),w!==void 0&&!Array.isArray(w)&&w.fetchOptions!==void 0&&(ee={ -...ee,...w.fetchOptions});let le={"Neon-Connection-String":r,"Neon-Raw-Text-Outp\ -ut":"true","Neon-Array-Mode":"true"},Te=await Wc(h);Te&&(le.Authorization=`Beare\ -r ${Te}`),Array.isArray(A)&&(he!==void 0&&(le["Neon-Batch-Isolation-Level"]=he), -ye!==void 0&&(le["Neon-Batch-Read-Only"]=String(ye)),ve!==void 0&&(le["Neon-Batc\ -h-Deferrable"]=String(ve)));let me;try{me=await(O??fetch)(W,{method:"POST",body:JSON. -stringify(ce),headers:le,...ee})}catch(K){let k=new ue(`Error connecting to data\ -base: ${K.message}`);throw k.sourceError=K,k}if(me.ok){let K=await me.json();if(Array. -isArray(A)){let k=K.results;if(!Array.isArray(k))throw new ue("Neon internal err\ -or: unexpected result format");return k.map((ge,_e)=>{let Lt=w[_e]??{},to=Lt.arrayMode?? -R,ro=Lt.fullResults??G;return Zs(ge,{arrayMode:to,fullResults:ro,parameterizedQuery:A[_e], -resultCallback:c,types:Lt.types})})}else{let k=w??{},ge=k.arrayMode??R,_e=k.fullResults?? -G;return Zs(K,{arrayMode:ge,fullResults:_e,parameterizedQuery:A,resultCallback:c, -types:k.types})}}else{let{status:K}=me;if(K===400){let k=await me.json(),ge=new ue( -k.message);for(let _e of Qc)ge[_e]=k[_e]??void 0;throw ge}else{let k=await me.text(); -throw new ue(`Server error (HTTP status ${K}): ${k}`)}}}return a(de,"execute"),X} -a(_n,"neon");function jc(r,e,t){return{[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e, -opts:t,then:a((n,i)=>r(e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"), -finally:a(n=>r(e,t).finally(n),"finally")}}a(jc,"createNeonQueryPromise");function Zs(r,{ -arrayMode:e,fullResults:t,parameterizedQuery:n,resultCallback:i,types:s}){let o=new Xs.default( -s),u=r.fields.map(l=>l.name),c=r.fields.map(l=>o.getTypeParser(l.dataTypeID)),h=e=== -!0?r.rows.map(l=>l.map((d,b)=>d===null?null:c[b](d))):r.rows.map(l=>Object.fromEntries( -l.map((d,b)=>[u[b],d===null?null:c[b](d)])));return i&&i(n,r,h,{arrayMode:e,fullResults:t}), -t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=h,r._parsers=c,r._types=o,r):h}a(Zs,"\ -processQueryResult");async function Wc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new ue("Error ge\ -tting auth token.");throw e instanceof Error&&(t=new ue(`Error getting auth toke\ -n: ${e.message}`)),t}}a(Wc,"getAuthToken");var eo=Pe(wt()),se=Pe(Tt());var Cn=class Cn extends Bt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ -return this.connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&& -(this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&&console.warn("\ -SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string\ - + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = tru\ -e). Double encryption will increase latency and CPU usage. It may be appropriate\ - to disable SSL in the Postgres connection parameters or set forceDisablePgSSL =\ - true.");let i=this.config?.host!==void 0||this.config?.connectionString!==void 0|| -m.env.PGHOST!==void 0,s=m.env.USER??m.env.USERNAME;if(!i&&this.host==="localhost"&& -this.user===s&&this.database===s&&this.password===null)throw new Error(`No datab\ -ase host or connection string was set, and key parameters have default values (h\ -ost: localhost, user: ${s}, db: ${s}, password: null). Is an environment variabl\ -e missing? Alternatively, if you intended to connect with these parameters, plea\ -se set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&& -this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let h=this. -connection;if(u&&h.on("connect",()=>h.stream.emit("data","S")),c){h.removeAllListeners( -"authenticationCleartextPassword"),h.removeAllListeners("readyForQuery"),h.once( -"readyForQuery",()=>h.on("readyForQuery",this._handleReadyForQuery.bind(this))); -let l=this.ssl?"sslconnect":"connect";h.on(l,()=>{this._handleAuthCleartextPassword(), -this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){let n=this. -saslSession,i=this.password,s=t.data;if(n.message!=="SASLInitialResponse"||typeof i!= -"string"||typeof s!="string")throw new Error("SASL: protocol error");let o=Object. -fromEntries(s.split(",").map(K=>{if(!/^.=/.test(K))throw new Error("SASL: Invali\ -d attribute pair entry");let k=K[0],ge=K.substring(2);return[k,ge]})),u=o.r,c=o. -s,h=o.i;if(!u||!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-\ -MESSAGE: nonce missing/unprintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ -64");if(!h||!/^[1-9][0-9]*$/.test(h))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ -ESSAGE: missing/invalid iteration count");if(!u.startsWith(n.clientNonce))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); -if(u.length===n.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ -SAGE: server nonce is too short");let l=parseInt(h,10),d=y.from(c,"base64"),b=new TextEncoder, -C=b.encode(i),B=await g.subtle.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-25\ -6"}},!1,["sign"]),j=new Uint8Array(await g.subtle.sign("HMAC",B,y.concat([d,y.from( -[0,0,0,1])]))),X=j;for(var de=0;deX[k]^j[k]));let A=X,w=await g.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),P=new Uint8Array(await g. -subtle.sign("HMAC",w,b.encode("Client Key"))),V=await g.subtle.digest("SHA-256", -P),O="n=*,r="+n.clientNonce,W="r="+u+",s="+c+",i="+l,ce="c=biws,r="+u,ee=O+","+W+ -","+ce,R=await g.subtle.importKey("raw",V,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]);var G=new Uint8Array(await g.subtle.sign("HMAC",R,b.encode(ee))),he=y. -from(P.map((K,k)=>P[k]^G[k])),ye=he.toString("base64");let ve=await g.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),le=await g.subtle.sign( -"HMAC",ve,b.encode("Server Key")),Te=await g.subtle.importKey("raw",le,{name:"HM\ -AC",hash:{name:"SHA-256"}},!1,["sign"]);var me=y.from(await g.subtle.sign("HMAC", -Te,b.encode(ee)));n.message="SASLResponse",n.serverSignature=me.toString("base64"), -n.response=ce+",p="+ye,this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}};a(Cn,"NeonClient");var Pt=Cn;function Hc(r,e){if(e)return{callback:e, -result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u});return{callback:i,result:s}}a(Hc,"promisify");var Tn=class Tn extends Bt.Pool{constructor(){ -super(...arguments);_(this,"Client",Pt);_(this,"hasFetchUnsupportedListeners",!1)}on(t,n){ -return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ -if(!Ee.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function") -return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Hc(this.Promise, -i);i=s.callback;try{let o=new eo.default(this.options),u=encodeURIComponent,c=encodeURI, -h=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`,l=typeof t== -"string"?t:t.text,d=n??t.values??[];_n(h,{fullResults:!0,arrayMode:t.rowMode==="\ -array"})(l,d,{types:t.types??this.options?.types}).then(C=>i(void 0,C)).catch(C=>i( -C))}catch(o){i(o)}return s.result}};a(Tn,"NeonPool");var An=Tn; -/*! Bundled license information: - -ieee754/index.js: - (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) - -buffer/index.js: - (*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - *) -*/ diff --git a/node_modules/@neondatabase/serverless/index.mjs b/node_modules/@neondatabase/serverless/index.mjs deleted file mode 100644 index 561855c26c78b49a5b9d2f7e819d0f3f98bca792..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/index.mjs +++ /dev/null @@ -1,1643 +0,0 @@ -var no=Object.create;var Te=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var so=Object.getOwnPropertyNames;var oo=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty;var uo=(r,e,t)=>e in r?Te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): -r[e]=t;var a=(r,e)=>Te(r,"name",{value:e,configurable:!0});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ie=(r,e)=>{for(var t in e) -Te(r,t,{get:e[t],enumerable:!0})},Cn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== -"function")for(let i of so(e))!ao.call(r,i)&&i!==t&&Te(r,i,{get:()=>e[i],enumerable:!(n= -io(e,i))||n.enumerable});return r};var Ie=(r,e,t)=>(t=r!=null?no(oo(r)):{},Cn(e||!r||!r.__esModule?Te(t,"default",{ -value:r,enumerable:!0}):t,r)),N=r=>Cn(Te({},"__esModule",{value:!0}),r);var _=(r,e,t)=>uo(r,typeof e!="symbol"?e+"":e,t);var Pn=I(it=>{"use strict";p();it.byteLength=ho;it.toByteArray=fo;it.fromByteArray= -mo;var se=[],te=[],co=typeof Uint8Array<"u"?Uint8Array:Array,Lt="ABCDEFGHIJKLMNO\ -PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ve=0,Tn=Lt.length;ve0)throw new Error("Invalid string. Length must be a multip\ -le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(In, -"getLens");function ho(r){var e=In(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(ho,"byte\ -Length");function lo(r,e,t){return(e+t)*3/4-t}a(lo,"_byteLength");function fo(r){ -var e,t=In(r),n=t[0],i=t[1],s=new co(lo(r,n,i)),o=0,u=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e= -te[r.charCodeAt(c)]<<2|te[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=te[r.charCodeAt( -c)]<<10|te[r.charCodeAt(c+1)]<<4|te[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= -e&255),s}a(fo,"toByteArray");function po(r){return se[r>>18&63]+se[r>>12&63]+se[r>> -6&63]+se[r&63]}a(po,"tripletToBase64");function yo(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(se[e>>2]+ -se[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(se[e>>10]+se[e>>4&63]+se[e<< -2&63]+"=")),i.join("")}a(mo,"fromByteArray")});var Bn=I(Rt=>{p();Rt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> -1,l=-7,d=t?i-1:0,b=t?-1:1,C=r[e+d];for(d+=b,s=C&(1<<-l)-1,C>>=-l,l+=u;l>0;s=s*256+ -r[e+d],d+=b,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+r[e+d],d+=b,l-=8);if(s=== -0)s=1-h;else{if(s===c)return o?NaN:(C?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(C? --1:1)*o*Math.pow(2,s-n)};Rt.write=function(r,e,t,n,i,s){var o,u,c,h=s*8-i-1,l=(1<< -h)-1,d=l>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=n?0:s-1,B=n?1:-1,j=e<0|| -e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math. -floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=b/c:e+= -b*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow( -2,i),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;r[t+C]=u&255,C+=B,u/=256, -i-=8);for(o=o<0;r[t+C]=o&255,C+=B,o/=256,h-=8);r[t+C-B]|=j*128}});var Vn=I(Re=>{"use strict";p();var Ft=Pn(),Be=Bn(),Ln=typeof Symbol=="function"&& -typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Re.Buffer= -f;Re.SlowBuffer=xo;Re.INSPECT_MAX_BYTES=50;var st=2147483647;Re.kMaxLength=st;f. -TYPED_ARRAY_SUPPORT=go();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. -error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ -pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ -rowser support.");function go(){try{let r=new Uint8Array(1),e={foo:a(function(){ -return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf( -r,e),r.foo()===42}catch{return!1}}a(go,"typedArraySupport");Object.defineProperty( -f.prototype,"parent",{enumerable:!0,get:a(function(){if(f.isBuffer(this))return this. -buffer},"get")});Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:a( -function(){if(f.isBuffer(this))return this.byteOffset},"get")});function he(r){if(r> -st)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( -r);return Object.setPrototypeOf(e,f.prototype),e}a(he,"createBuffer");function f(r,e,t){ -if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" a\ -rgument must be of type string. Received type number');return Ot(r)}return Dn(r, -e,t)}a(f,"Buffer");f.poolSize=8192;function Dn(r,e,t){if(typeof r=="string")return bo( -r,e);if(ArrayBuffer.isView(r))return So(r);if(r==null)throw new TypeError("The f\ -irst argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-l\ -ike Object. Received type "+typeof r);if(oe(r,ArrayBuffer)||r&&oe(r.buffer,ArrayBuffer)|| -typeof SharedArrayBuffer<"u"&&(oe(r,SharedArrayBuffer)||r&&oe(r.buffer,SharedArrayBuffer))) -return Dt(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ - must not be of type number. Received type number');let n=r.valueOf&&r.valueOf(); -if(n!=null&&n!==r)return f.from(n,e,t);let i=Eo(r);if(i)return i;if(typeof Symbol< -"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return f. -from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argumen\ -t must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. \ -Received type "+typeof r)}a(Dn,"from");f.from=function(r,e,t){return Dn(r,e,t)}; -Object.setPrototypeOf(f.prototype,Uint8Array.prototype);Object.setPrototypeOf(f, -Uint8Array);function kn(r){if(typeof r!="number")throw new TypeError('"size" arg\ -ument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is\ - invalid for option "size"')}a(kn,"assertSize");function wo(r,e,t){return kn(r), -r<=0?he(r):e!==void 0?typeof t=="string"?he(r).fill(e,t):he(r).fill(e):he(r)}a(wo, -"alloc");f.alloc=function(r,e,t){return wo(r,e,t)};function Ot(r){return kn(r),he( -r<0?0:Ut(r)|0)}a(Ot,"allocUnsafe");f.allocUnsafe=function(r){return Ot(r)};f.allocUnsafeSlow= -function(r){return Ot(r)};function bo(r,e){if((typeof e!="string"||e==="")&&(e="\ -utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=On(r,e)| -0,n=he(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}a(bo,"fromString");function Mt(r){ -let e=r.length<0?0:Ut(r.length)|0,t=he(e);for(let n=0;n= -st)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ -st.toString(16)+" bytes");return r|0}a(Ut,"checked");function xo(r){return+r!=r&& -(r=0),f.alloc(+r)}a(xo,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. -_isBuffer===!0&&e!==f.prototype},"isBuffer");f.compare=a(function(e,t){if(oe(e,Uint8Array)&& -(e=f.from(e,e.offset,e.byteLength)),oe(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)), -!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ - must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t. -length;for(let s=0,o=Math.min(n,i);si.length?(f.isBuffer( -o)||(o=f.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(f.isBuffer( -o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ -fers');s+=o.length}return i},"concat");function On(r,e){if(f.isBuffer(r))return r. -length;if(ArrayBuffer.isView(r)||oe(r,ArrayBuffer))return r.byteLength;if(typeof r!= -"string")throw new TypeError('The "string" argument must be one of type string, \ -Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> -2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ -latin1":case"binary":return t;case"utf8":case"utf-8":return kt(r).length;case"uc\ -s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ -base64":return $n(r).length;default:if(i)return n?-1:kt(r).length;e=(""+e).toLowerCase(), -i=!0}}a(On,"byteLength");f.byteLength=On;function vo(r,e,t){let n=!1;if((e===void 0|| -e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| -(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Fo( -this,e,t);case"utf8":case"utf-8":return Nn(this,e,t);case"ascii":return Lo(this, -e,t);case"latin1":case"binary":return Ro(this,e,t);case"base64":return Po(this,e, -t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mo(this,e,t);default: -if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( -vo,"slowToString");f.prototype._isBuffer=!0;function _e(r,e,t){let n=r[e];r[e]=r[t], -r[t]=n}a(_e,"swap");f.prototype.swap16=a(function(){let e=this.length;if(e%2!==0) -throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t< -e;t+=2)_e(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. -length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ -s");for(let t=0;tt&&(e+=" ... "),""},"inspect");Ln&&(f.prototype[Ln]=f.prototype.inspect);f.prototype.compare= -a(function(e,t,n,i,s){if(oe(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f. -isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ -r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? -e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| -s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; -if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; -let o=s-i,u=n-t,c=Math.min(o,u),h=this.slice(i,s),l=e.slice(t,n);for(let d=0;d2147483647?t=2147483647: -t<-2147483648&&(t=-2147483648),t=+t,qt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), -t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== -"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Rn(r,e,t,n,i);if(typeof e== -"number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. -prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Rn(r, -[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Un,"bid\ -irectionalIndexOf");function Rn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== -void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ -utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,u/=2,t/=2}function c(l,d){ -return s===1?l[d]:l.readUInt16BE(d*s)}a(c,"read");let h;if(i){let l=-1;for(h=t;h< -o;h++)if(c(r,h)===c(e,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===u)return l*s}else l!== --1&&(h-=h-l),l=-1}else for(t+u>o&&(t=o-u),h=t;h>=0;h--){let l=!0;for(let d=0;di&&(n=i)):n=i;let s=e.length;n> -s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)? -(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ -te(string, encoding, offset[, length]) is no longer supported");let s=this.length- -t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( -"Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"\ -hex":return _o(this,e,t,n);case"utf8":case"utf-8":return Ao(this,e,t,n);case"asc\ -ii":case"latin1":case"binary":return Co(this,e,t,n);case"base64":return To(this, -e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Io(this,e,t,n);default: -if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"\ -write");f.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype. -slice.call(this._arr||this,0)}},"toJSON");function Po(r,e,t){return e===0&&t===r. -length?Ft.fromByteArray(r):Ft.fromByteArray(r.slice(e,t))}a(Po,"base64Slice");function Nn(r,e,t){ -t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223? -3:s>191?2:1;if(i+u<=t){let c,h,l,d;switch(u){case 1:s<128&&(o=s);break;case 2:c= -r[i+1],(c&192)===128&&(d=(s&31)<<6|c&63,d>127&&(o=d));break;case 3:c=r[i+1],h=r[i+ -2],(c&192)===128&&(h&192)===128&&(d=(s&15)<<12|(c&63)<<6|h&63,d>2047&&(d<55296|| -d>57343)&&(o=d));break;case 4:c=r[i+1],h=r[i+2],l=r[i+3],(c&192)===128&&(h&192)=== -128&&(l&192)===128&&(d=(s&15)<<18|(c&63)<<12|(h&63)<<6|l&63,d>65535&&d<1114112&& -(o=d))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| -o&1023),n.push(o),i+=u}return Bo(n)}a(Nn,"utf8Slice");var Fn=4096;function Bo(r){ -let e=r.length;if(e<=Fn)return String.fromCharCode.apply(String,r);let t="",n=0; -for(;nn)&&(t=n);let i="";for(let s=e;sn&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError( -"Trying to access beyond buffer length")}a(q,"checkOffset");f.prototype.readUintLE= -f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e], -s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e,t,this. -length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"re\ -adUIntBE");f.prototype.readUint8=f.prototype.readUInt8=a(function(e,t){return e= -e>>>0,t||q(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. -readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]|this[e+ -1]<<8},"readUInt16LE");f.prototype.readUint16BE=f.prototype.readUInt16BE=a(function(e,t){ -return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. -readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. -length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE"); -f.prototype.readUint32BE=f.prototype.readUInt32BE=a(function(e,t){return e=e>>>0, -t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ -readUInt32BE");f.prototype.readBigUInt64LE=ge(a(function(e){e=e>>>0,Le(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=t+ -this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]* -2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,Le(e,"offset");let t=this[e],n=this[e+7]; -(t===void 0||n===void 0)&&We(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* -2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt( -i)<>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");f.prototype. -readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=t,s=1,o=this[e+ ---i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)), -o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this. -length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");f.prototype.readInt16LE= -a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& -32768?n|4294901760:n},"readInt16LE");f.prototype.readInt16BE=a(function(e,t){e=e>>> -0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, -"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. -length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");f.prototype. -readInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+ -1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=ge(a(function(e){ -e=e>>>0,Le(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, -this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt( -i)<>>0,Le(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=(t<< -24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||q(e,4,this.length),Be.read(this,e, -!0,23,4)},"readFloatLE");f.prototype.readFloatBE=a(function(e,t){return e=e>>>0, -t||q(e,4,this.length),Be.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= -a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Be.read(this,e,!0,52,8)},"r\ -eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this. -length),Be.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( -r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e< -s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError( -"Index out of range")}a(Y,"checkInt");f.prototype.writeUintLE=f.prototype.writeUIntLE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;Y(this,e, -t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;Y(this,e,t,n,u,0)}let s=n-1, -o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+n},"writeUI\ -ntBE");f.prototype.writeUint8=f.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||Y(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");f.prototype.writeUint16LE= -f.prototype.writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,2, -65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");f.prototype.writeUint16BE= -f.prototype.writeUInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,2, -65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");f.prototype.writeUint32LE= -f.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,4, -4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+ -4},"writeUInt32LE");f.prototype.writeUint32BE=f.prototype.writeUInt32BE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||Y(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16, -this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function qn(r,e,t,n,i){Gn( -e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8, -r[t++]=s,s=s>>8,r[t++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]= -o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(qn,"wrtBigUInt64LE");function Qn(r,e,t,n,i){ -Gn(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> -8,r[t+5]=s,s=s>>8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+ -3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(Qn,"wrtBigUInt64BE");f. -prototype.writeBigUInt64LE=ge(a(function(e,t=0){return qn(this,e,t,BigInt(0),BigInt( -"0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=ge(a(function(e,t=0){ -return Qn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")); -f.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2, -8*n-1);Y(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntL\ -E");f.prototype.writeIntBE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow( -2,8*n-1);Y(this,e,t,n,c-1,-c)}let s=n-1,o=1,u=0;for(this[t+s]=e&255;--s>=0&&(o*= -256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+n},"w\ -riteIntBE");f.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this, -e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");f.prototype.writeInt16LE= -a(function(e,t,n){return e=+e,t=t>>>0,n||Y(this,e,t,2,32767,-32768),this[t]=e&255, -this[t+1]=e>>>8,t+2},"writeInt16LE");f.prototype.writeInt16BE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||Y(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255, -t+2},"writeInt16BE");f.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t=t>>> -0,n||Y(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]= -e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");f.prototype.writeInt32BE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+ -1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeIn\ -t32BE");f.prototype.writeBigInt64LE=ge(a(function(e,t=0){return qn(this,e,t,-BigInt( -"0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));f.prototype. -writeBigInt64BE=ge(a(function(e,t=0){return Qn(this,e,t,-BigInt("0x8000000000000\ -000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function jn(r,e,t,n,i,s){ -if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError( -"Index out of range")}a(jn,"checkIEEE754");function Wn(r,e,t,n,i){return e=+e,t= -t>>>0,i||jn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Be.write(r,e,t,n, -23,4),t+4}a(Wn,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return Wn( -this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return Wn( -this,e,t,!1,n)},"writeFloatBE");function Hn(r,e,t,n,i){return e=+e,t=t>>>0,i||jn( -r,e,t,8,17976931348623157e292,-17976931348623157e292),Be.write(r,e,t,n,52,8),t+8} -a(Hn,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return Hn(this,e, -t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return Hn( -this,e,t,!1,n)},"writeDoubleBE");f.prototype.copy=a(function(e,t,n,i){if(!f.isBuffer( -e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i= -this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError( -"sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>0, -n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=Mn(String(t)):typeof t=="bigint"&&(i=String(t), -(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Mn(i)),i+="n"),n+=` It\ - must be ${e}. Received ${i}`,n},RangeError);function Mn(r){let e="",t=r.length, -n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0, -t)}${e}`}a(Mn,"addNumericalSeparator");function Do(r,e,t){Le(e,"offset"),(r[e]=== -void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(Do,"checkBounds");function Gn(r,e,t,n,i,s){ -if(r>t||r3?e===0||e===BigInt(0)?u= -`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:u=`>= -(2${o} ** ${(s+1)*8-1}${o}) and \ -< 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new Pe.ERR_OUT_OF_RANGE( -"value",u,r)}Do(n,i,s)}a(Gn,"checkIntBI");function Le(r,e){if(typeof r!="number") -throw new Pe.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Le,"validateNumber");function We(r,e,t){ -throw Math.floor(r)!==r?(Le(r,t),new Pe.ERR_OUT_OF_RANGE(t||"offset","an integer", -r)):e<0?new Pe.ERR_BUFFER_OUT_OF_BOUNDS:new Pe.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? -1:0} and <= ${e}`,r)}a(We,"boundsError");var ko=/[^+/0-9A-Za-z-_]/g;function Oo(r){ -if(r=r.split("=")[0],r=r.trim().replace(ko,""),r.length<2)return"";for(;r.length% -4!==0;)r=r+"=";return r}a(Oo,"base64clean");function kt(r,e){e=e||1/0;let t,n=r. -length,i=null,s=[];for(let o=0;o55295&&t<57344){if(!i){ -if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&& -s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, -189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191, -189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break; -s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>> -6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63| -128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a( -kt,"utf8ToBytes");function Uo(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s} -a(No,"utf16leToBytes");function $n(r){return Ft.toByteArray(Oo(r))}a($n,"base64T\ -oBytes");function ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(ot,"blitBuffer");function oe(r,e){return r instanceof e|| -r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name} -a(oe,"isInstance");function qt(r){return r!==r}a(qt,"numberIsNaN");var qo=function(){ -let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< -16;++i)e[n+i]=r[t]+r[i]}return e}();function ge(r){return typeof BigInt>"u"?Qo:r} -a(ge,"defineBigIntMethod");function Qo(){throw new Error("BigInt not supported")} -a(Qo,"BufferBigIntNotDefined")});var S,E,x,g,y,m,p=z(()=>{"use strict";S=globalThis,E=globalThis.setImmediate??(r=>setTimeout( -r,0)),x=globalThis.clearImmediate??(r=>clearTimeout(r)),g=globalThis.crypto??{}; -g.subtle??(g.subtle={});y=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Vn().Buffer,m=globalThis.process?? -{};m.env??(m.env={});try{m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick= -e.then.bind(e)}});var we=I((th,Qt)=>{"use strict";p();var Fe=typeof Reflect=="object"?Reflect:null, -Kn=Fe&&typeof Fe.apply=="function"?Fe.apply:a(function(e,t,n){return Function.prototype. -apply.call(e,t,n)},"ReflectApply"),at;Fe&&typeof Fe.ownKeys=="function"?at=Fe.ownKeys: -Object.getOwnPropertySymbols?at=a(function(e){return Object.getOwnPropertyNames( -e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):at=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function jo(r){console&&console.warn&& -console.warn(r)}a(jo,"ProcessEmitWarning");var Yn=Number.isNaN||a(function(e){return e!== -e},"NumberIsNaN");function L(){L.init.call(this)}a(L,"EventEmitter");Qt.exports= -L;Qt.exports.once=$o;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount= -0;L.prototype._maxListeners=void 0;var zn=10;function ut(r){if(typeof r!="functi\ -on")throw new TypeError('The "listener" argument must be of type Function. Recei\ -ved type '+typeof r)}a(ut,"checkListener");Object.defineProperty(L,"defaultMaxLi\ -steners",{enumerable:!0,get:a(function(){return zn},"get"),set:a(function(r){if(typeof r!= -"number"||r<0||Yn(r))throw new RangeError('The value of "defaultMaxListeners" is\ - out of range. It must be a non-negative number. Received '+r+".");zn=r},"set")}); -L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). -_events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= -this._maxListeners||void 0};L.prototype.setMaxListeners=a(function(e){if(typeof e!= -"number"||e<0||Yn(e))throw new RangeError('The value of "n" is out of range. It \ -must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, -"setMaxListeners");function Zn(r){return r._maxListeners===void 0?L.defaultMaxListeners: -r._maxListeners}a(Zn,"_getMaxListeners");L.prototype.getMaxListeners=a(function(){ -return Zn(this)},"getMaxListeners");L.prototype.emit=a(function(e){for(var t=[], -n=1;n -0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+ -o.message+")":""));throw u.context=o,u}var c=s[e];if(c===void 0)return!1;if(typeof c== -"function")Kn(c,this,t);else for(var h=c.length,l=ri(c,h),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ -ssible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners a\ -dded. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExce\ -ededWarning",u.emitter=r,u.type=e,u.count=o.length,jo(u)}return r}a(Jn,"_addList\ -ener");L.prototype.addListener=a(function(e,t){return Jn(this,e,t,!1)},"addListe\ -ner");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=a(function(e,t){ -return Jn(this,e,t,!0)},"prependListener");function Wo(){if(!this.fired)return this. -target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? -this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Wo, -"onceWrapper");function Xn(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, -listener:t},i=Wo.bind(n);return i.listener=t,n.wrapFn=i,i}a(Xn,"_onceWrap");L.prototype. -once=a(function(e,t){return ut(t),this.on(e,Xn(this,e,t)),this},"once");L.prototype. -prependOnceListener=a(function(e,t){return ut(t),this.prependListener(e,Xn(this, -e,t)),this},"prependOnceListener");L.prototype.removeListener=a(function(e,t){var n, -i,s,o,u;if(ut(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; -if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): -(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= -"function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o]. -listener,s=o;break}if(s<0)return this;s===0?n.shift():Ho(n,s),n.length===1&&(i[e]= -n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this}, -"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners= -a(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== -void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= -0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), -this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ei(r,e,t){ -var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== -"function"?t?[i.listener||i]:[i]:t?Go(i):ri(i,i.length)}a(ei,"_listeners");L.prototype. -listeners=a(function(e){return ei(this,e,!0)},"listeners");L.prototype.rawListeners= -a(function(e){return ei(this,e,!1)},"rawListeners");L.listenerCount=function(r,e){ -return typeof r.listenerCount=="function"?r.listenerCount(e):ti.call(r,e)};L.prototype. -listenerCount=ti;function ti(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== -"function")return 1;if(t!==void 0)return t.length}return 0}a(ti,"listenerCount"); -L.prototype.eventNames=a(function(){return this._eventsCount>0?at(this._events): -[]},"eventNames");function ri(r,e){for(var t=new Array(e),n=0;nKo});var Ko,Ge=z(()=>{"use strict";p();Ko={}});function $e(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, -o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,3049323471, -3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, -1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, -604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, -3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372, -1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, -3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, -883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, -2361852424,2428436474,2756734187,3204031479,3329325298],b=a((A,w)=>A>>>w|A<<32-w, -"rrot"),C=new Uint32Array(64),B=new Uint8Array(64),j=a(()=>{for(let R=0,G=0;R<16;R++, -G+=4)C[R]=B[G]<<24|B[G+1]<<16|B[G+2]<<8|B[G+3];for(let R=16;R<64;R++){let G=b(C[R- -15],7)^b(C[R-15],18)^C[R-15]>>>3,ue=b(C[R-2],17)^b(C[R-2],19)^C[R-2]>>>10;C[R]=C[R- -16]+G+C[R-7]+ue|0}let A=e,w=t,P=n,V=i,O=s,W=o,ae=u,ee=c;for(let R=0;R<64;R++){let G=b( -O,6)^b(O,11)^b(O,25),ue=O&W^~O&ae,de=ee+G+ue+d[R]+C[R]|0,Ee=b(A,2)^b(A,13)^b(A,22), -ce=A&w^A&P^w&P,Ce=Ee+ce|0;ee=ae,ae=W,W=O,O=V+de|0,V=P,P=w,w=A,A=de+Ce|0}e=e+A|0, -t=t+w|0,n=n+P|0,i=i+V|0,s=s+O|0,o=o+W|0,u=u+ae|0,c=c+ee|0,l=0},"process"),X=a(A=>{ -typeof A=="string"&&(A=new TextEncoder().encode(A));for(let w=0;w{if(B[l++]=128,l==64&&j(),l+8>64){ -for(;l<64;)B[l++]=0;j()}for(;l<58;)B[l++]=0;let A=h*8;B[l++]=A/1099511627776&255, -B[l++]=A/4294967296&255,B[l++]=A>>>24,B[l++]=A>>>16&255,B[l++]=A>>>8&255,B[l++]= -A&255,j();let w=new Uint8Array(32);return w[0]=e>>>24,w[1]=e>>>16&255,w[2]=e>>>8& -255,w[3]=e&255,w[4]=t>>>24,w[5]=t>>>16&255,w[6]=t>>>8&255,w[7]=t&255,w[8]=n>>>24, -w[9]=n>>>16&255,w[10]=n>>>8&255,w[11]=n&255,w[12]=i>>>24,w[13]=i>>>16&255,w[14]= -i>>>8&255,w[15]=i&255,w[16]=s>>>24,w[17]=s>>>16&255,w[18]=s>>>8&255,w[19]=s&255, -w[20]=o>>>24,w[21]=o>>>16&255,w[22]=o>>>8&255,w[23]=o&255,w[24]=u>>>24,w[25]=u>>> -16&255,w[26]=u>>>8&255,w[27]=u&255,w[28]=c>>>24,w[29]=c>>>16&255,w[30]=c>>>8&255, -w[31]=c&255,w},"digest");return r===void 0?{add:X,digest:pe}:(X(r),pe())}var ii=z( -()=>{"use strict";p();a($e,"sha256")});var U,Ve,si=z(()=>{"use strict";p();U=class U{constructor(){_(this,"_dataLength", -0);_(this,"_bufferLength",0);_(this,"_state",new Int32Array(4));_(this,"_buffer", -new ArrayBuffer(68));_(this,"_buffer8");_(this,"_buffer32");this._buffer8=new Uint8Array( -this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){ -return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ -return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U. -hexChars,n=U.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ -o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ -let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| -0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| -0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,n+=(i& -s|~i&o)+t[4]-176418897|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[5]+1200080426|0,o=(o<< -12|o>>>20)+n|0,s+=(o&n|~o&i)+t[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+ -t[7]-45705983|0,i=(i<<22|i>>>10)+s|0,n+=(i&s|~i&o)+t[8]+1770035416|0,n=(n<<7|n>>> -25)+i|0,o+=(n&i|~n&s)+t[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[10]- -42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[11]-1990404162|0,i=(i<<22|i>>>10)+s| -0,n+=(i&s|~i&o)+t[12]+1804603682|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[13]-40341101| -0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,i+= -(s&o|~s&n)+t[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,n+=(i&o|s&~o)+t[1]-165796510| -0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i&~s)+t[6]-1069501632|0,o=(o<<9|o>>>23)+n|0,s+=(o& -i|n&~i)+t[11]+643717713|0,s=(s<<14|s>>>18)+o|0,i+=(s&n|o&~n)+t[0]-373897302|0,i= -(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[5]-701558691|0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i& -~s)+t[10]+38016083|0,o=(o<<9|o>>>23)+n|0,s+=(o&i|n&~i)+t[15]-660478335|0,s=(s<<14| -s>>>18)+o|0,i+=(s&n|o&~n)+t[4]-405537848|0,i=(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[9]+ -568446438|0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i&~s)+t[14]-1019803690|0,o=(o<<9|o>>>23)+ -n|0,s+=(o&i|n&~i)+t[3]-187363961|0,s=(s<<14|s>>>18)+o|0,i+=(s&n|o&~n)+t[8]+1163531501| -0,i=(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[13]-1444681467|0,n=(n<<5|n>>>27)+i|0,o+=(n& -s|i&~s)+t[2]-51403784|0,o=(o<<9|o>>>23)+n|0,s+=(o&i|n&~i)+t[7]+1735328473|0,s=(s<< -14|s>>>18)+o|0,i+=(s&n|o&~n)+t[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,n+=(i^s^o)+ -t[5]-378558|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[8]-2022574463|0,o=(o<<11|o>>>21)+ -n|0,s+=(o^n^i)+t[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+t[14]-35309556| -0,i=(i<<23|i>>>9)+s|0,n+=(i^s^o)+t[1]-1530992060|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+ -t[4]+1272893353|0,o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+t[7]-155497632|0,s=(s<<16|s>>> -16)+o|0,i+=(s^o^n)+t[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,n+=(i^s^o)+t[13]+681279174| -0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[0]-358537222|0,o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+ -t[3]-722521979|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+t[6]+76029189|0,i=(i<<23|i>>>9)+ -s|0,n+=(i^s^o)+t[9]-640364487|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[12]-421815835|0, -o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+t[15]+530742520|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+ -t[2]-995338651|0,i=(i<<23|i>>>9)+s|0,n+=(s^(i|~o))+t[0]-198630844|0,n=(n<<6|n>>> -26)+i|0,o+=(i^(n|~s))+t[7]+1126891415|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[14]- -1416354905|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[5]-57434055|0,i=(i<<21|i>>>11)+ -s|0,n+=(s^(i|~o))+t[12]+1700485571|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[3]-1894986606| -0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^ -(s|~n))+t[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,n+=(s^(i|~o))+t[8]+1873313359|0,n= -(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[15]-30611744|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+ -t[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[13]+1309151649|0,i=(i<<21| -i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[11]- -1120210379|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ -o|0,i+=(o^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| -0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength=0,this._bufferLength= -0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. -_buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296|| -s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)* -1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard\ - supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128, -t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this. -_state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(e){let t=this. -_buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,U._md5cycle( -this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this. -_buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,U._md5cycle(this._state, -n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String. -fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this. -_dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state,i=this. -_state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]= -n[1],i[2]=n[2],i[3]=n[3],s=0;s>2)+1;this._dataLength+= -t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(U.buffer32Identity. -subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)),o<=4294967295) -i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),h=parseInt(u[1],16)||0;i[14]=c,i[15]=h}return U._md5cycle(this._state,i), -e?this._state:U._hex(this._state)}};a(U,"Md5"),_(U,"stateIdentity",new Int32Array( -[1732584193,-271733879,-1732584194,271733878])),_(U,"buffer32Identity",new Int32Array( -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),_(U,"hexChars","0123456789abcdef"),_(U,"hexO\ -ut",[]),_(U,"onePassHasher",new U);Ve=U});var jt={};ie(jt,{createHash:()=>Yo,createHmac:()=>Zo,randomBytes:()=>zo});function zo(r){ -return g.getRandomValues(y.alloc(r))}function Yo(r){if(r==="sha256")return{update:a( -function(e){return{digest:a(function(){return y.from($e(e))},"digest")}},"update")}; -if(r==="md5")return{update:a(function(e){return{digest:a(function(){return typeof e== -"string"?Ve.hashStr(e):Ve.hashByteArray(e)},"digest")}},"update")};throw new Error( -`Hash type '${r}' not supported`)}function Zo(r,e){if(r!=="sha256")throw new Error( -`Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{ -digest:a(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== -"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=$e(e);else if(n< -64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array(64),s=new Uint8Array( -64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ -64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set($e(o), -64),y.from($e(u))},"digest")}},"update")}}var Wt=z(()=>{"use strict";p();ii();si(); -a(zo,"randomBytes");a(Yo,"createHash");a(Zo,"createHmac")});var Gt=I(oi=>{"use strict";p();oi.parse=function(r,e){return new Ht(r,e).parse()}; -var ct=class ct{constructor(e,t){this.source=e,this.transform=t||Jo,this.position= -0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>= -this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== -"\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){ -this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&(t=this.recorded. -join(""),t==="NULL"&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.push( -t),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){ -var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this.consumeDimensions();!this. -isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this.dimension> -1&&(n=new ct(this.source.substr(this.position-1),this.transform),this.entries.push( -n.parse(!0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--, -!this.dimension&&(this.newEntry(),e))return this.entries}else t.value==='"'&&!t. -escaped?(i&&this.newEntry(!0),i=!i):t.value===","&&!i?this.newEntry():this.record( -t.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this. -entries}};a(ct,"ArrayParser");var Ht=ct;function Jo(r){return r}a(Jo,"identity")});var $t=I((wh,ai)=>{p();var Xo=Gt();ai.exports={create:a(function(r,e){return{parse:a( -function(){return Xo.parse(r,e)},"parse")}},"create")}});var hi=I((Eh,ci)=>{"use strict";p();var ea=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -ta=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,ra=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,na=/^-?infinity$/; -ci.exports=a(function(e){if(na.test(e))return Number(e.replace("i","I"));var t=ea. -exec(e);if(!t)return ia(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=ui(i));var s=parseInt( -t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),h=parseInt(t[6],10),l=t[7]; -l=l?1e3*parseFloat(l):0;var d,b=sa(e);return b!=null?(d=new Date(Date.UTC(i,s,o, -u,c,h,l)),Vt(i)&&d.setUTCFullYear(i),b!==0&&d.setTime(d.getTime()-b)):(d=new Date( -i,s,o,u,c,h,l),Vt(i)&&d.setFullYear(i)),d},"parseDate");function ia(r){var e=ta. -exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=ui(t));var i=parseInt(e[2], -10)-1,s=e[3],o=new Date(t,i,s);return Vt(t)&&o.setFullYear(t),o}}a(ia,"getDate"); -function sa(r){if(r.endsWith("+00"))return 0;var e=ra.exec(r.split(" ")[1]);if(e){ -var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(sa,"timeZoneOffset");function ui(r){ -return-(r-1)}a(ui,"bcYearToNegativeYear");function Vt(r){return r>=0&&r<100}a(Vt, -"is0To99")});var fi=I((_h,li)=>{p();li.exports=aa;var oa=Object.prototype.hasOwnProperty;function aa(r){ -for(var e=1;e{"use strict";p();var ua=fi();di.exports=Me;function Me(r){if(!(this instanceof -Me))return new Me(r);ua(this,Sa(r))}a(Me,"PostgresInterval");var ca=["seconds","\ -minutes","hours","days","months","years"];Me.prototype.toPostgres=function(){var r=ca. -filter(this.hasOwnProperty,this);return this.milliseconds&&r.indexOf("seconds")< -0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]||0;return e=== -"seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var ha={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ -M",seconds:"S"},la=["years","months","days"],fa=["hours","minutes","seconds"];Me. -prototype.toISOString=Me.prototype.toISO=function(){var r=la.map(t,this).join(""), -e=fa.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== -"seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/, -"")),i+ha[n]}};var Kt="([+-]?\\d+)",pa=Kt+"\\s+years?",da=Kt+"\\s+mons?",ya=Kt+"\ -\\s+days?",ma="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ga=new RegExp([ -pa,da,ya,ma].map(function(r){return"("+r+")?"}).join("\\s*")),pi={years:2,months:4, -days:6,hours:9,minutes:10,seconds:11,milliseconds:12},wa=["hours","minutes","sec\ -onds","milliseconds"];function ba(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(ba,"parseMilliseconds");function Sa(r){if(!r)return{};var e=ga.exec( -r),t=e[8]==="-";return Object.keys(pi).reduce(function(n,i){var s=pi[i],o=e[s];return!o|| -(o=i==="milliseconds"?ba(o):parseInt(o,10),!o)||(t&&~wa.indexOf(i)&&(o*=-1),n[i]= -o),n},{})}a(Sa,"parse")});var gi=I((Bh,mi)=>{"use strict";p();mi.exports=a(function(e){if(/^\\x/.test(e))return new y( -e.substr(2),"hex");for(var t="",n=0;n{p();var Ke=Gt(),ze=$t(),ht=hi(),bi=yi(),Si=gi();function lt(r){ -return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(lt,"allowNull");function Ei(r){ -return r===null?r:r==="TRUE"||r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"|| -r==="1"}a(Ei,"parseBool");function Ea(r){return r?Ke.parse(r,Ei):null}a(Ea,"pars\ -eBoolArray");function xa(r){return parseInt(r,10)}a(xa,"parseBaseTenInt");function zt(r){ -return r?Ke.parse(r,lt(xa)):null}a(zt,"parseIntegerArray");function va(r){return r? -Ke.parse(r,lt(function(e){return xi(e).trim()})):null}a(va,"parseBigIntegerArray"); -var _a=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!== -null&&(t=Xt(t)),t});return e.parse()},"parsePointArray"),Yt=a(function(r){if(!r) -return null;var e=ze.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); -return e.parse()},"parseFloatArray"),re=a(function(r){if(!r)return null;var e=ze. -create(r);return e.parse()},"parseStringArray"),Zt=a(function(r){if(!r)return null; -var e=ze.create(r,function(t){return t!==null&&(t=ht(t)),t});return e.parse()},"\ -parseDateArray"),Aa=a(function(r){if(!r)return null;var e=ze.create(r,function(t){ -return t!==null&&(t=bi(t)),t});return e.parse()},"parseIntervalArray"),Ca=a(function(r){ -return r?Ke.parse(r,lt(Si)):null},"parseByteAArray"),Jt=a(function(r){return parseInt( -r,10)},"parseInteger"),xi=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: -r},"parseBigInteger"),wi=a(function(r){return r?Ke.parse(r,lt(JSON.parse)):null}, -"parseJsonArray"),Xt=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- -1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Ta=a(function(r){ -if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1,i=2;i{"use strict";p();var Z=1e6;function Pa(r){var e=r.readInt32BE( -0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u, -c,h,l;{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ -u+i;for(c="",h=6-u.length,l=0;l>>0,o=4294967296* -s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l< -h;l++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), -t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l{p();var Ba=Ci(),F=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(C,B,j){ -return C*Math.pow(2,j)+B};var s=t>>3,o=a(function(C){return n?~C&255:C},"inv"),u=255, -c=8-t%8;e>t%8);var h=0;t%8+e>=8&&(h=i(0,o(r[s])& -u,c));for(var l=e+t>>3,d=s+1;d0&& -(h=i(h,o(r[l])>>8-b,b)),h},"parseBits"),Pi=a(function(r,e,t){var n=Math.pow(2,t- -1)-1,i=F(r,1),s=F(r,t,1);if(s===0)return 0;var o=1,u=a(function(h,l,d){h===0&&(h= -1);for(var b=1;b<=d;b++)o/=2,(l&1<0&&(h+=o);return h},"parsePrecisionBits"), -c=F(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: --1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),La=a(function(r){return F(r,1)==1?-1* -(F(r,15,1,!0)+1):F(r,15,1)},"parseInt16"),Ti=a(function(r){return F(r,1)==1?-1*(F( -r,31,1,!0)+1):F(r,31,1)},"parseInt32"),Ra=a(function(r){return Pi(r,23,8)},"pars\ -eFloat32"),Fa=a(function(r){return Pi(r,52,11)},"parseFloat64"),Ma=a(function(r){ -var e=F(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,F(r,16,16)),n=0,i=[], -s=F(r,16),o=0;o>3,(i+=l<<3)>>3), -d;console.log("ERROR: ElementType not implemented: "+h)},"parseElement"),c=a(function(h,l){ -var d=[],b;if(h.length>1){var C=h.shift();for(b=0;b0},"parseBool"),Oa=a(function(r){r(20,Ba),r(21,La),r(23,Ti),r(26, -Ti),r(1700,Ma),r(700,Ra),r(701,Fa),r(16,ka),r(1114,Ii.bind(null,!1)),r(1184,Ii.bind( -null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye),r(1008,Ye),r(1009,Ye),r(25,Da)},"init"); -Bi.exports={init:Oa}});var Fi=I((jh,Ri)=>{p();Ri.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, -REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194, -SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703, -TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033, -BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186, -TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203, -REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220, -PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642, -REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Xe=I(Je=>{p();var Ua=_i(),Na=Li(),qa=$t(),Qa=Fi();Je.getTypeParser=ja;Je.setTypeParser= -Wa;Je.arrayParser=qa;Je.builtins=Qa;var Ze={text:{},binary:{}};function Mi(r){return String( -r)}a(Mi,"noParse");function ja(r,e){return e=e||"text",Ze[e]&&Ze[e][r]||Mi}a(ja, -"getTypeParser");function Wa(r,e,t){typeof e=="function"&&(t=e,e="text"),Ze[e][r]= -t}a(Wa,"setTypeParser");Ua.init(function(r,e){Ze.text[r]=e});Na.init(function(r,e){ -Ze.binary[r]=e})});var et=I((Vh,er)=>{"use strict";p();er.exports={host:"localhost",user:m.platform=== -"win32"?m.env.USERNAME:m.env.USER,database:void 0,password:null,connectionString:void 0, -port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1, -application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, -statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1, -connect_timeout:0,keepalives:1,keepalives_idle:0};var De=Xe(),Ha=De.getTypeParser( -20,"text"),Ga=De.getTypeParser(1016,"text");er.exports.__defineSetter__("parseIn\ -t8",function(r){De.setTypeParser(20,"text",r?De.getTypeParser(23,"text"):Ha),De. -setTypeParser(1016,"text",r?De.getTypeParser(1007,"text"):Ga)})});var tt=I((zh,ki)=>{"use strict";p();var $a=(Wt(),N(jt)),Va=et();function Ka(r){var e=r. -replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Ka,"escapeElement"); -function Di(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> -"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Di(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. -toString("hex"):e+=Ka(ft(r[t]));return e=e+"}",e}a(Di,"arrayString");var ft=a(function(r,e){ -if(r==null)return null;if(r instanceof y)return r;if(ArrayBuffer.isView(r)){var t=y. -from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice( -r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Va.parseInputDatesAsUTC? -Za(r):Ya(r):Array.isArray(r)?Di(r):typeof r=="object"?za(r,e):r.toString()},"pre\ -pareValue");function za(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. -indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+ -r+'" for query');return e.push(r),ft(r.toPostgres(ft),e)}return JSON.stringify(r)} -a(za,"prepareObject");function H(r,e){for(r=""+r;r.length{"use strict";p();var rr=(Wt(),N(jt));function eu(r){if(r.indexOf( -"SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is cur\ -rently supported");let e=rr.randomBytes(18).toString("base64");return{mechanism:"\ -SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"SASLInitialResponse"}} -a(eu,"startSession");function tu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( -"SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!= -"string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a\ - string");let n=iu(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== -r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ -once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serv\ -er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=au(e, -i,n.iteration),o=ke(s,"Client Key"),u=ou(o),c="n=*,r="+r.clientNonce,h="r="+n.nonce+ -",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,d=c+","+h+","+l,b=ke(u,d),C=Ni( -o,b),B=C.toString("base64"),j=ke(s,"Server Key"),X=ke(j,d);r.message="SASLRespon\ -se",r.serverSignature=X.toString("base64"),r.response=l+",p="+B}a(tu,"continueSe\ -ssion");function ru(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ -st message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: S\ -CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=su( -e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: s\ -erver signature does not match")}a(ru,"finalizeSession");function nu(r){if(typeof r!= -"string")throw new TypeError("SASL: text must be a string");return r.split("").map( -(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(nu,"isPrintableC\ -hars");function Oi(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(Oi,"isBase64");function Ui(r){if(typeof r!="string")throw new TypeError( -"SASL: attribute pairs text must be a string");return new Map(r.split(",").map(e=>{ -if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let t=e[0], -n=e.substring(2);return[t,n]}))}a(Ui,"parseAttributePairs");function iu(r){let e=Ui( -r),t=e.get("r");if(t){if(!nu(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ -E: nonce must only contain printable characters")}else throw new Error("SASL: SC\ -RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Oi(n))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("S\ -ASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/. -test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration cou\ -nt")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); -let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(iu,"parseServerFirstMe\ -ssage");function su(r){let t=Ui(r).get("v");if(t){if(!Oi(t))throw new Error("SAS\ -L: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error( -"SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}} -a(su,"parseServerFinalMessage");function Ni(r,e){if(!y.isBuffer(r))throw new TypeError( -"first argument must be a Buffer");if(!y.isBuffer(e))throw new TypeError("second\ - argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer leng\ -ths must match");if(r.length===0)throw new Error("Buffers cannot be empty");return y. -from(r.map((t,n)=>r[n]^e[n]))}a(Ni,"xorBuffers");function ou(r){return rr.createHash( -"sha256").update(r).digest()}a(ou,"sha256");function ke(r,e){return rr.createHmac( -"sha256",r).update(e).digest()}a(ke,"hmacSha256");function au(r,e,t){for(var n=ke( -r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;suu});function uu(...r){return r.join("/")}var ir=z(()=>{ -"use strict";p();a(uu,"join")});var sr={};ie(sr,{stat:()=>cu});function cu(r,e){e(new Error("No filesystem"))}var or=z( -()=>{"use strict";p();a(cu,"stat")});var ar={};ie(ar,{default:()=>hu});var hu,ur=z(()=>{"use strict";p();hu={}});var ji={};ie(ji,{StringDecoder:()=>cr});var hr,cr,Wi=z(()=>{"use strict";p();hr= -class hr{constructor(e){_(this,"td");this.td=new TextDecoder(e)}write(e){return this. -td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}};a(hr,"StringDecoder"); -cr=hr});var Vi=I((ul,$i)=>{"use strict";p();var{Transform:lu}=(ur(),N(ar)),{StringDecoder:fu}=(Wi(),N(ji)), -be=Symbol("last"),pt=Symbol("decoder");function pu(r,e,t){let n;if(this.overflow){ -if(n=this[pt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. -overflow=!1}else this[be]+=this[pt].write(r),n=this[be].split(this.matcher);this[be]= -n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ -t(new Error("maximum buffer reached"));return}t()}a(pu,"transform");function du(r){ -if(this[be]+=this[pt].end(),this[be])try{Gi(this,this.mapper(this[be]))}catch(e){ -return r(e)}r()}a(du,"flush");function Gi(r,e){e!==void 0&&r.push(e)}a(Gi,"push"); -function Hi(r){return r}a(Hi,"noop");function yu(r,e,t){switch(r=r||/\r?\n/,e=e|| -Hi,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== -"object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2: -typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=Hi)}t=Object. -assign({},t),t.autoDestroy=!0,t.transform=pu,t.flush=du,t.readableObjectMode=!0; -let n=new lu(t);return n[be]="",n[pt]=new fu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= -t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){ -this._writableState.errorEmitted=!1,s(i)},n}a(yu,"split");$i.exports=yu});var Yi=I((ll,le)=>{"use strict";p();var Ki=(ir(),N(nr)),mu=(ur(),N(ar)).Stream,gu=Vi(), -zi=(Ge(),N(He)),wu=5432,dt=m.platform==="win32",rt=m.stderr,bu=56,Su=7,Eu=61440, -xu=32768;function vu(r){return(r&Eu)==xu}a(vu,"isRegFile");var Oe=["host","port", -"database","user","password"],lr=Oe.length,_u=Oe[lr-1];function fr(){var r=rt instanceof -mu&&rt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);rt.write(zi.format.apply(zi,e))}}a(fr,"warn");Object.defineProperty(le.exports, -"isWin",{get:a(function(){return dt},"get"),set:a(function(r){dt=r},"set")});le. -exports.warnTo=function(r){var e=rt;return rt=r,e};le.exports.getFileName=function(r){ -var e=r||m.env,t=e.PGPASSFILE||(dt?Ki.join(e.APPDATA||"./","postgresql","pgpass.\ -conf"):Ki.join(e.HOME||"./",".pgpass"));return t};le.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:dt?!0:(e=e||"\ -",vu(r.mode)?r.mode&(bu|Su)?(fr('WARNING: password file "%s" has group or \ -world access; permissions should be u=rw (0600) or less',e),!1):!0:(fr('WARNING:\ - password file "%s" is not a plain file',e),!1))};var Au=le.exports.match=function(r,e){ -return Oe.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||wu)===Number( -e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};le.exports.getPassword=function(r,e,t){ -var n,i=e.pipe(gu());function s(c){var h=Cu(c);h&&Tu(h)&&Au(r,h)&&(n=h[_u],i.end())} -a(s,"onLine");var o=a(function(){e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(), -fr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. -on("data",s).on("end",o).on("error",u)};var Cu=le.exports.parseLine=function(r){ -if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={}, -u=!1,c=a(function(l,d,b){var C=r.substring(d,b);Object.hasOwnProperty.call(m.env, -"PGPASS_NO_DEESCAPE")||(C=C.replace(/\\([:\\])/g,"$1")),o[Oe[l]]=C},"addToObj"), -h=0;h=0&&e==":"&&t!=="\\"&&(c(n,i,h+1),i=h+2,n+=1)}return o=Object.keys(o).length=== -lr?o:null,o},Tu=le.exports.isValidEntry=function(r){for(var e={0:function(o){return o. -length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&& -Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length> -0},4:function(o){return o.length>0}},t=0;t{"use strict";p();var dl=(ir(),N(nr)),Zi=(or(),N(sr)),yt=Yi(); -pr.exports=function(r,e){var t=yt.getFileName();Zi.stat(t,function(n,i){if(n||!yt. -usePgPass(i,t))return e(void 0);var s=Zi.createReadStream(t);yt.getPassword(r,s, -e)})};pr.exports.warnTo=yt.warnTo});var gt=I((gl,Xi)=>{"use strict";p();var Iu=Xe();function mt(r){this._types=r||Iu, -this.text={},this.binary={}}a(mt,"TypeOverrides");mt.prototype.getOverrides=function(r){ -switch(r){case"text":return this.text;case"binary":return this.binary;default:return{}}}; -mt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), -this.getOverrides(e)[r]=t};mt.prototype.getTypeParser=function(r,e){return e=e|| -"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};Xi.exports=mt});var es={};ie(es,{default:()=>Pu});var Pu,ts=z(()=>{"use strict";p();Pu={}});var rs={};ie(rs,{parse:()=>dr});function dr(r,e=!1){let{protocol:t}=new URL(r),n="\ -http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,searchParams:d,hash:b}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( -i),h=decodeURIComponent(h);let C=i+":"+s,B=e?Object.fromEntries(d.entries()):l;return{ -href:r,protocol:t,auth:C,username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,query:B,hash:b}}var yr=z(()=>{"use strict";p();a(dr,"parse")});var is=I((vl,ns)=>{"use strict";p();var Bu=(yr(),N(rs)),mr=(or(),N(sr));function gr(r){ -if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Bu. -parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(r)?encodeURI(r).replace(/\%25(\d\d)/g, -"%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&&(t[n]=t[n][t[n].length- -1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join(":"), -t.port=e.port,e.protocol=="socket:")return t.host=decodeURI(e.pathname),t.database= -e.query.db,t.client_encoding=e.query.encoding,t;t.host||(t.host=e.hostname);var s=e. -pathname;if(!t.host&&s&&/^%2f/i.test(s)){var o=s.split("/");t.host=decodeURIComponent( -o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt(0)==="/"&&(s=s.slice(1)||null), -t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0),t.ssl==="0"&& -(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&& -(t.ssl.cert=mr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=mr.readFileSync( -t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=mr.readFileSync(t.sslrootcert).toString()), -t.sslmode){case"disable":{t.ssl=!1;break}case"prefer":case"require":case"verify-\ -ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized=!1;break}} -return t}a(gr,"parse");ns.exports=gr;gr.parse=gr});var wt=I((Cl,as)=>{"use strict";p();var Lu=(ts(),N(es)),os=et(),ss=is().parse,$=a( -function(r,e,t){return t===void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]), -e[r]||t||os[r]},"val"),Ru=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ -prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify": -return{rejectUnauthorized:!1}}return os.ssl},"readSSLConfigFromEnvironment"),Ue=a( -function(r){return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quo\ -teParamValue"),ne=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Ue(n))},"ad\ -d"),br=class br{constructor(e){e=typeof e=="string"?ss(e):e||{},e.connectionString&& -(e=Object.assign({},e,ss(e.connectionString))),this.user=$("user",e),this.database= -$("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt( -$("port",e),10),this.host=$("host",e),Object.defineProperty(this,"password",{configurable:!0, -enumerable:!1,writable:!0,value:$("password",e)}),this.binary=$("binary",e),this. -options=$("options",e),this.ssl=typeof e.ssl>"u"?Ru():e.ssl,typeof this.ssl=="st\ -ring"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}), -this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this. -client_encoding=$("client_encoding",e),this.replication=$("replication",e),this. -isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=$("applicatio\ -n_name",e,"PGAPPNAME"),this.fallback_application_name=$("fallback_application_na\ -me",e,!1),this.statement_timeout=$("statement_timeout",e,!1),this.lock_timeout=$( -"lock_timeout",e,!1),this.idle_in_transaction_session_timeout=$("idle_in_transac\ -tion_session_timeout",e,!1),this.query_timeout=$("query_timeout",e,!1),e.connectionTimeoutMillis=== -void 0?this.connect_timeout=m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math. -floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive=== -!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle= -Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[]; -ne(t,this,"user"),ne(t,this,"password"),ne(t,this,"port"),ne(t,this,"application\ -_name"),ne(t,this,"fallback_application_name"),ne(t,this,"connect_timeout"),ne(t, -this,"options");var n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this. -ssl}:{};if(ne(t,n,"sslmode"),ne(t,n,"sslca"),ne(t,n,"sslkey"),ne(t,n,"sslcert"), -ne(t,n,"sslrootcert"),this.database&&t.push("dbname="+Ue(this.database)),this.replication&& -t.push("replication="+Ue(this.replication)),this.host&&t.push("host="+Ue(this.host)), -this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("cli\ -ent_encoding="+Ue(this.client_encoding)),Lu.lookup(this.host,function(i,s){return i? -e(i,null):(t.push("hostaddr="+Ue(s)),e(null,t.join(" ")))})}};a(br,"ConnectionPa\ -rameters");var wr=br;as.exports=wr});var hs=I((Pl,cs)=>{"use strict";p();var Fu=Xe(),us=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, -Er=class Er{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, -this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null, -this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=us.exec(e.text):t=us.exec(e.command),t&&(this.command=t[1],t[3]?(this. -oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt( -t[2],10)))}_parseRowAsArray(e){for(var t=new Array(e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Mu}=we(),ls=hs(),fs=tt(),vr=class vr extends Mu{constructor(e,t,n){ -super(),e=fs.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this. -rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal= -e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,m.domain&&e.callback&& -(this.callback=m.domain.bind(e.callback)),this._result=new ls(this._rowMode,this. -types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= -!1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this. -text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&& -(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ls( -this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ -this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this. -callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){ -try{t=this._result.parseRow(e.fields)}catch(n){this._canceledDueToError=n;return} -this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){ -this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){ -this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._canceledDueToError, -this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("er\ -ror",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError( -this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(t){ -m.nextTick(()=>{throw t})}this.emit("end",this._results)}submit(e){if(typeof this. -text!="string"&&typeof this.name!="string")return new Error("A query must have e\ -ither text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this. -name];return this.text&&t&&this.text!==t?new Error(`Prepared statements must be \ -unique - '${this.name}' was used for a different statement`):this.values&&!Array. -isArray(this.values)?new Error("Query values must be an array"):(this.requiresPreparation()? -this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this. -name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute( -{portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement= -!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types}); -try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this. -binary,valueMapper:fs.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( -{type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(vr,"Query"); -var xr=vr;ps.exports=xr});var gs={};ie(gs,{Socket:()=>Ae,isIP:()=>Du});function Du(r){return 0}var ms,ys,v, -Ae,bt=z(()=>{"use strict";p();ms=Ie(we(),1);a(Du,"isIP");ys=/^[^.]+\./,v=class v extends ms.EventEmitter{constructor(){ -super(...arguments);_(this,"opts",{});_(this,"connecting",!1);_(this,"pending",!0); -_(this,"writable",!0);_(this,"encrypted",!1);_(this,"authorized",!1);_(this,"des\ -troyed",!1);_(this,"ws",null);_(this,"writeBuffer");_(this,"tlsState",0);_(this, -"tlsRead");_(this,"tlsWrite")}static get poolQueryViaFetch(){return v.opts.poolQueryViaFetch?? -v.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){v.opts.poolQueryViaFetch= -t}static get fetchEndpoint(){return v.opts.fetchEndpoint??v.defaults.fetchEndpoint}static set fetchEndpoint(t){ -v.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ -console.warn("The `fetchConnectionCache` option is deprecated (now always `true`\ -)")}static get fetchFunction(){return v.opts.fetchFunction??v.defaults.fetchFunction}static set fetchFunction(t){ -v.opts.fetchFunction=t}static get webSocketConstructor(){return v.opts.webSocketConstructor?? -v.defaults.webSocketConstructor}static set webSocketConstructor(t){v.opts.webSocketConstructor= -t}get webSocketConstructor(){return this.opts.webSocketConstructor??v.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return v.opts.wsProxy??v.defaults. -wsProxy}static set wsProxy(t){v.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? -v.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return v. -opts.coalesceWrites??v.defaults.coalesceWrites}static set coalesceWrites(t){v.opts. -coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??v.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return v.opts.useSecureWebSocket?? -v.defaults.useSecureWebSocket}static set useSecureWebSocket(t){v.opts.useSecureWebSocket= -t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??v.useSecureWebSocket}set useSecureWebSocket(t){ -this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return v.opts.forceDisablePgSSL?? -v.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){v.opts.forceDisablePgSSL= -t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??v.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return v.opts.disableSNI?? -v.defaults.disableSNI}static set disableSNI(t){v.opts.disableSNI=t}get disableSNI(){ -return this.opts.disableSNI??v.disableSNI}set disableSNI(t){this.opts.disableSNI= -t}static get pipelineConnect(){return v.opts.pipelineConnect??v.defaults.pipelineConnect}static set pipelineConnect(t){ -v.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? -v.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return v.opts.subtls??v.defaults.subtls}static set subtls(t){v.opts.subtls=t}get subtls(){ -return this.opts.subtls??v.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ -return v.opts.pipelineTLS??v.defaults.pipelineTLS}static set pipelineTLS(t){v.opts. -pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??v.pipelineTLS}set pipelineTLS(t){ -this.opts.pipelineTLS=t}static get rootCerts(){return v.opts.rootCerts??v.defaults. -rootCerts}static set rootCerts(t){v.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??v.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ -let i=this.wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configur\ -ed. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#ws\ -proxy-string--host-string-port-number--string--string");return typeof i=="functi\ -on"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){ -return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("\ -connect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"), -this.emit("ready")},"handleWebSocketOpen"),o=a((c,h=!1)=>{c.binaryType="arraybuf\ -fer",c.addEventListener("error",l=>{this.emit("error",l),this.emit("close")}),c. -addEventListener("message",l=>{if(this.tlsState===0){let d=y.from(l.data);this.emit( -"data",d)}}),c.addEventListener("close",()=>{this.emit("close")}),h?s():c.addEventListener( -"open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="st\ -ring"?parseInt(t,10):t)}catch(c){this.emit("error",c),this.emit("close");return} -try{let h=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== -void 0)this.ws=new this.webSocketConstructor(h),o(this.ws);else try{this.ws=new WebSocket( -h),o(this.ws)}catch{this.ws=new __unstable_WebSocket(h),o(this.ws)}}catch(c){let l=(this. -useSecureWebSocket?"https:":"http:")+"//"+u;fetch(l,{headers:{Upgrade:"websocket"}}). -then(d=>{if(this.ws=d.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, -!0)}).catch(d=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ - connect to the database failed. Please refer to https://github.com/neondatabase\ -/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined\ -. Details: ${d.message}`)),this.emit("close")})}}async startTls(t){if(this.subtls=== -void 0)throw new Error("For Postgres SSL connections, you must set `neonConfig.s\ -ubtls` to the subtls library. See https://github.com/neondatabase/serverless/blo\ -b/main/CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. -fromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i.read.bind( -i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o,{useSNI:!this. -disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead= -u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit( -"secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let t=await this. -tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data",n)}}}rawWrite(t){ -if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer===void 0)this. -writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer=void 0}, -0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this.writeBuffer), -n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf8",i=s=>{}){return t. -length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this.tlsState===0?(this. -rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write( -t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){return this. -write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed=!0,this. -end()}};a(v,"Socket"),_(v,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{ -let s;return i?.jwtAuth?s=t.replace(ys,"apiauth."):s=t.replace(ys,"api."),"https\ -://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0, -wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, -pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1}), -_(v,"opts",{});Ae=v});var Jr=I(T=>{"use strict";p();Object.defineProperty(T,"__esModule",{value:!0});T. -NoticeMessage=T.DataRowMessage=T.CommandCompleteMessage=T.ReadyForQueryMessage=T. -NotificationResponseMessage=T.BackendKeyDataMessage=T.AuthenticationMD5Password= -T.ParameterStatusMessage=T.ParameterDescriptionMessage=T.RowDescriptionMessage=T. -Field=T.CopyResponse=T.CopyDataMessage=T.DatabaseError=T.copyDone=T.emptyQuery=T. -replicationStart=T.portalSuspended=T.noData=T.closeComplete=T.bindComplete=T.parseComplete= -void 0;T.parseComplete={name:"parseComplete",length:5};T.bindComplete={name:"bin\ -dComplete",length:5};T.closeComplete={name:"closeComplete",length:5};T.noData={name:"\ -noData",length:5};T.portalSuspended={name:"portalSuspended",length:5};T.replicationStart= -{name:"replicationStart",length:4};T.emptyQuery={name:"emptyQuery",length:4};T.copyDone= -{name:"copyDone",length:4};var Ur=class Ur extends Error{constructor(e,t,n){super( -e),this.length=t,this.name=n}};a(Ur,"DatabaseError");var _r=Ur;T.DatabaseError=_r; -var Nr=class Nr{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; -a(Nr,"CopyDataMessage");var Ar=Nr;T.CopyDataMessage=Ar;var qr=class qr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(qr,"Co\ -pyResponse");var Cr=qr;T.CopyResponse=Cr;var Qr=class Qr{constructor(e,t,n,i,s,o,u){ -this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s, -this.dataTypeModifier=o,this.format=u}};a(Qr,"Field");var Tr=Qr;T.Field=Tr;var jr=class jr{constructor(e,t){ -this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=new Array( -this.fieldCount)}};a(jr,"RowDescriptionMessage");var Ir=jr;T.RowDescriptionMessage= -Ir;var Wr=class Wr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= -"parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(Wr,"P\ -arameterDescriptionMessage");var Pr=Wr;T.ParameterDescriptionMessage=Pr;var Hr=class Hr{constructor(e,t,n){ -this.length=e,this.parameterName=t,this.parameterValue=n,this.name="parameterSta\ -tus"}};a(Hr,"ParameterStatusMessage");var Br=Hr;T.ParameterStatusMessage=Br;var Gr=class Gr{constructor(e,t){ -this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a(Gr,"Authenti\ -cationMD5Password");var Lr=Gr;T.AuthenticationMD5Password=Lr;var $r=class $r{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a($r, -"BackendKeyDataMessage");var Rr=$r;T.BackendKeyDataMessage=Rr;var Vr=class Vr{constructor(e,t,n,i){ -this.length=e,this.processId=t,this.channel=n,this.payload=i,this.name="notifica\ -tion"}};a(Vr,"NotificationResponseMessage");var Fr=Vr;T.NotificationResponseMessage= -Fr;var Kr=class Kr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ -ForQuery"}};a(Kr,"ReadyForQueryMessage");var Mr=Kr;T.ReadyForQueryMessage=Mr;var zr=class zr{constructor(e,t){ -this.length=e,this.text=t,this.name="commandComplete"}};a(zr,"CommandCompleteMes\ -sage");var Dr=zr;T.CommandCompleteMessage=Dr;var Yr=class Yr{constructor(e,t){this. -length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Yr,"Data\ -RowMessage");var kr=Yr;T.DataRowMessage=kr;var Zr=class Zr{constructor(e,t){this. -length=e,this.message=t,this.name="notice"}};a(Zr,"NoticeMessage");var Or=Zr;T.NoticeMessage= -Or});var ws=I(St=>{"use strict";p();Object.defineProperty(St,"__esModule",{value:!0}); -St.Writer=void 0;var en=class en{constructor(e=256){this.size=e,this.offset=5,this. -headerPosition=0,this.buffer=y.allocUnsafe(e)}ensure(e){var t=this.buffer.length- -this.offset;if(t>1)+e;this.buffer=y.allocUnsafe( -i),n.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]= -e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>> -8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2), -this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){ -if(!e)this.ensure(1);else{var t=y.byteLength(e);this.ensure(t+1),this.buffer.write( -e,this.offset,"utf-8"),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=""){ -var t=y.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this. -offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset), -this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this. -offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)} -return this.buffer.slice(e?0:5,this.offset)}flush(e){var t=this.join(e);return this. -offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(en,"Wr\ -iter");var Xr=en;St.Writer=Xr});var Ss=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0}); -xt.serialize=void 0;var tn=ws(),M=new tn.Writer,ku=a(r=>{M.addInt16(3).addInt16( -0);for(let n of Object.keys(r))M.addCString(n).addCString(r[n]);M.addCString("cl\ -ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new tn. -Writer().addInt32(t).add(e).flush()},"startup"),Ou=a(()=>{let r=y.allocUnsafe(8); -return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Uu=a(r=>M. -addCString(r).flush(112),"password"),Nu=a(function(r,e){return M.addCString(r).addInt32( -y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),qu=a( -function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),Qu=a( -r=>M.addCString(r).flush(81),"query"),bs=[],ju=a(r=>{let e=r.name||"";e.length>63&& -(console.error("Warning! Postgres only supports 63 characters for query names."), -console.error("You supplied %s (%s)",e,e.length),console.error("This can cause c\ -onflicts and silent errors executing queries"));let t=r.types||bs;for(var n=t.length, -i=M.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| -"",n=r.binary||!1,i=r.values||bs,s=i.length;return M.addCString(e).addCString(t), -M.addInt16(s),Wu(i,r.valueMapper),M.addInt16(s),M.add(Ne.flush()),M.addInt16(n?1: -0),M.flush(66)},"bind"),Gu=y.from([69,0,0,0,9,0,0,0,0,0]),$u=a(r=>{if(!r||!r.portal&& -!r.rows)return Gu;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. -allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]= -0,s.writeUInt32BE(t,s.length-4),s},"execute"),Vu=a((r,e)=>{let t=y.allocUnsafe(16); -return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678,6),t.writeInt32BE( -r,8),t.writeInt32BE(e,12),t},"cancel"),rn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. -allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i}, -"cstringMessage"),Ku=M.addCString("P").flush(68),zu=M.addCString("S").flush(68), -Yu=a(r=>r.name?rn(68,`${r.type}${r.name||""}`):r.type==="P"?Ku:zu,"describe"),Zu=a( -r=>{let e=`${r.type}${r.name||""}`;return rn(67,e)},"close"),Ju=a(r=>M.add(r).flush( -100),"copyData"),Xu=a(r=>rn(102,r),"copyFail"),Et=a(r=>y.from([r,0,0,0,4]),"code\ -OnlyBuffer"),ec=Et(72),tc=Et(83),rc=Et(88),nc=Et(99),ic={startup:ku,password:Uu, -requestSsl:Ou,sendSASLInitialResponseMessage:Nu,sendSCRAMClientFinalMessage:qu,query:Qu, -parse:ju,bind:Hu,execute:$u,describe:Yu,close:Zu,flush:a(()=>ec,"flush"),sync:a( -()=>tc,"sync"),end:a(()=>rc,"end"),copyData:Ju,copyDone:a(()=>nc,"copyDone"),copyFail:Xu, -cancel:Vu};xt.serialize=ic});var Es=I(vt=>{"use strict";p();Object.defineProperty(vt,"__esModule",{value:!0}); -vt.BufferReader=void 0;var sc=y.allocUnsafe(0),sn=class sn{constructor(e=0){this. -offset=e,this.buffer=sc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. -buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+= -2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this. -buffer.readInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer. -toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){ -let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. -toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this. -offset+e);return this.offset+=e,t}};a(sn,"BufferReader");var nn=sn;vt.BufferReader= -nn});var _s=I(_t=>{"use strict";p();Object.defineProperty(_t,"__esModule",{value:!0}); -_t.Parser=void 0;var D=Jr(),oc=Es(),on=1,ac=4,xs=on+ac,vs=y.allocUnsafe(0),un=class un{constructor(e){ -if(this.buffer=vs,this.bufferLength=0,this.bufferOffset=0,this.reader=new oc.BufferReader, -e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?. -mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength, -i=this.bufferOffset;for(;i+xs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+on),u=on+o;if(u+i<=n){let c=this.handlePacket(i+xs,s,o,this.buffer);t(c),i+=u}else -break}i===n?(this.buffer=vs,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength= -n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+ -e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let i;if(t<=this.buffer. -byteLength&&this.bufferOffset>=this.bufferLength)i=this.buffer;else{let s=this.buffer. -byteLength*2;for(;t>=s;)s*=2;i=y.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset, -this.bufferOffset+this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this. -buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer= -e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){switch(t){case 50: -return D.bindComplete;case 49:return D.parseComplete;case 51:return D.closeComplete;case 110: -return D.noData;case 115:return D.portalSuspended;case 99:return D.copyDone;case 87: -return D.replicationStart;case 73:return D.emptyQuery;case 68:return this.parseDataRowMessage( -e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this. -parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e, -n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this. -parseParameterStatusMessage(e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69: -return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessage( -e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this. -parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e, -n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData( -e,n,i);default:return new D.DatabaseError("received invalid response: "+t.toString( -16),n,"error")}}parseReadyForQueryMessage(e,t,n){this.reader.setBuffer(e,n);let i=this. -reader.string(1);return new D.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new D.CommandCompleteMessage( -t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new D.CopyDataMessage( -t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyInRespons\ -e")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ -se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!== -0,o=this.reader.int16(),u=new D.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(Se,"__esModule",{value:!0}); -Se.DatabaseError=Se.serialize=Se.parse=void 0;var uc=Jr();Object.defineProperty( -Se,"DatabaseError",{enumerable:!0,get:a(function(){return uc.DatabaseError},"get")}); -var cc=Ss();Object.defineProperty(Se,"serialize",{enumerable:!0,get:a(function(){ -return cc.serialize},"get")});var hc=_s();function lc(r,e){let t=new hc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(lc,"parse");Se. -parse=lc});var As={};ie(As,{connect:()=>fc});function fc({socket:r,servername:e}){return r. -startTls(e),r}var Cs=z(()=>{"use strict";p();a(fc,"connect")});var fn=I((nf,Ps)=>{"use strict";p();var Ts=(bt(),N(gs)),pc=we().EventEmitter,{parse:dc, -serialize:Q}=cn(),Is=Q.flush(),yc=Q.sync(),mc=Q.end(),ln=class ln extends pc{constructor(e){ -super(),e=e||{},this.stream=e.stream||new Ts.Socket,this._keepAlive=e.keepAlive, -this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer= -!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage= -!1;var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){ -var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e, -t),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0, -n._keepAliveInitialDelayMillis),n.emit("connect")});let i=a(function(s){n._ending&& -(s.code==="ECONNRESET"||s.code==="EPIPE")||n.emit("error",s)},"reportStreamError"); -if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this. -ssl)return this.attachListeners(this.stream);this.stream.once("data",function(s){ -var o=s.toString("utf8");switch(o){case"S":break;case"N":return n.stream.end(),n. -emit("error",new Error("The server does not support SSL connections"));default:return n. -stream.end(),n.emit("error",new Error("There was an error establishing an SSL co\ -nnection"))}var u=(Cs(),N(As));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( -c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Ts.isIP(t)===0&&(c.servername=t);try{ -n.stream=u.connect(c)}catch(h){return n.emit("error",h)}n.attachListeners(n.stream), -n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{ -this.emit("end")}),dc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(Q.requestSsl())}startup(e){ -this.stream.write(Q.startup(e))}cancel(e,t){this._send(Q.cancel(e,t))}password(e){ -this._send(Q.password(e))}sendSASLInitialResponseMessage(e,t){this._send(Q.sendSASLInitialResponseMessage( -e,t))}sendSCRAMClientFinalMessage(e){this._send(Q.sendSCRAMClientFinalMessage(e))}_send(e){ -return this.stream.writable?this.stream.write(e):!1}query(e){this._send(Q.query( -e))}parse(e){this._send(Q.parse(e))}bind(e){this._send(Q.bind(e))}execute(e){this. -_send(Q.execute(e))}flush(){this.stream.writable&&this.stream.write(Is)}sync(){this. -_ending=!0,this._send(Is),this._send(yc)}ref(){this.stream.ref()}unref(){this.stream. -unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this. -stream.end();return}return this.stream.write(mc,()=>{this.stream.end()})}close(e){ -this._send(Q.close(e))}describe(e){this._send(Q.describe(e))}sendCopyFromChunk(e){ -this._send(Q.copyData(e))}endCopyFrom(){this._send(Q.copyDone())}sendCopyFail(e){ -this._send(Q.copyFail(e))}};a(ln,"Connection");var hn=ln;Ps.exports=hn});var Rs=I((uf,Ls)=>{"use strict";p();var gc=we().EventEmitter,af=(Ge(),N(He)),wc=tt(), -pn=Qi(),bc=Ji(),Sc=gt(),Ec=wt(),Bs=ds(),xc=et(),vc=fn(),dn=class dn extends gc{constructor(e){ -super(),this.connectionParameters=new Ec(e),this.user=this.connectionParameters. -user,this.database=this.connectionParameters.database,this.port=this.connectionParameters. -port,this.host=this.connectionParameters.host,Object.defineProperty(this,"passwo\ -rd",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), -this.replication=this.connectionParameters.replication;var t=e||{};this._Promise= -t.Promise||S.Promise,this._types=new Sc(t.types),this._ending=!1,this._connecting= -!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection= -t.connection||new vc({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. -keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. -connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t. -binary||xc.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. -ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), -this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=a( -n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError");this.activeQuery&& -(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue. -length=0}_connect(e){var t=this,n=this.connection;if(this._connectionCallback=e, -this._connecting||this._connected){let i=new Error("Client has already been conn\ -ected. You cannot reuse a client.");m.nextTick(()=>{e(i)});return}this._connecting= -!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle= -setTimeout(()=>{n._ending=!0,n.stream.destroy(new Error("timeout expired"))},this. -_connectionTimeoutMillis)),this.host&&this.host.indexOf("/")===0?n.connect(this. -host+"/.s.PGSQL."+this.port):n.connect(this.port,this.host),n.on("connect",function(){ -t.ssl?n.requestSsl():n.startup(t.getStartupConf())}),n.on("sslconnect",function(){ -n.startup(t.getStartupConf())}),this._attachListeners(n),n.once("end",()=>{let i=this. -_ending?new Error("Connection terminated"):new Error("Connection terminated unex\ -pectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this. -_ending||(this._connecting&&!this._connectionError?this._connectionCallback?this. -_connectionCallback(i):this._handleErrorEvent(i):this._connectionError||this._handleErrorEvent( -i)),m.nextTick(()=>{this.emit("end")})})}connect(e){if(e){this._connect(e);return} -return new this._Promise((t,n)=>{this._connect(i=>{i?n(i):t()})})}_attachListeners(e){ -e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)), -e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("a\ -uthenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLCont\ -inue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this. -_handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData. -bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage", -this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery. -bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this. -_handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)), -e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery", -this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete. -bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("cop\ -yInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData. -bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){ -let t=this.connection;typeof this.password=="function"?this._Promise.resolve().then( -()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("erro\ -r",new TypeError("Password must be a string"));return}this.connectionParameters. -password=this.password=n}else this.connectionParameters.password=this.password=null; -e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():bc(this.connectionParameters, -n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ -this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){ -this._checkPgPass(()=>{let t=wc.postgresMd5PasswordHash(this.user,this.password, -e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{ -this.saslSession=pn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){ -pn.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage( -this.saslSession.response)}_handleAuthSASLFinal(e){pn.finalizeSession(this.saslSession, -e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID, -this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting= -!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&& -(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("c\ -onnect"));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&& -t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){ -if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle), -this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){ -if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1, -this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting) -return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t){this._handleErrorEvent( -e);return}this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){ -this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow( -e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){ -this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this. -activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this. -activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this. -activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse( -this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){ -this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){ -var e=this.connectionParameters,t={user:e.user,database:e.database},n=e.application_name|| -e.fallback_application_name;return n&&(t.application_name=n),e.replication&&(t.replication= -""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout, -10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&& -(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout, -10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var n=this. -connection;this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+ -this.port):n.connect(this.port,this.host),n.on("connect",function(){n.cancel(e.processID, -e.secretKey)})}else e.queryQueue.indexOf(t)!==-1&&e.queryQueue.splice(e.queryQueue. -indexOf(t),1)}setTypeParser(e,t,n){return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){ -return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g, -'""')+'"'}escapeLiteral(e){for(var t=!1,n="'",i=0;i{this.activeQuery.handleError(e,this.connection),this.readyForQuery= -!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this. -emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError("Client\ - was passed a null or undefined query");return typeof e.submit=="function"?(o=e. -query_timeout||this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&& -(i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new Bs( -e,t,n),i.callback||(s=new this._Promise((h,l)=>{i.callback=(d,b)=>d?l(d):h(b)}))), -o&&(c=i.callback,u=setTimeout(()=>{var h=new Error("Query read timeout");m.nextTick( -()=>{i.handleError(h,this.connection)}),c(h),i.callback=()=>{};var l=this.queryQueue. -indexOf(i);l>-1&&this.queryQueue.splice(l,1),this._pulseQueryQueue()},o),i.callback= -(h,l)=>{clearTimeout(u),c(h,l)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& -!i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(m. -nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"), -this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick( -()=>{i.handleError(new Error("Client has encountered a connection error and is n\ -ot queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.connection. -unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(e)e();else return this. -_Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream. -destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};a(dn,"Client");var At=dn;At.Query= -Bs;Ls.exports=At});var ks=I((lf,Ds)=>{"use strict";p();var _c=we().EventEmitter,Fs=a(function(){},"\ -NOOP"),Ms=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, -"removeWhere"),gn=class gn{constructor(e,t,n){this.client=e,this.idleListener=t, -this.timeoutId=n}};a(gn,"IdleItem");var yn=gn,wn=class wn{constructor(e){this.callback= -e}};a(wn,"PendingItem");var qe=wn;function Ac(){throw new Error("Release called \ -on client which has already been released to the pool.")}a(Ac,"throwOnDoubleRele\ -ase");function Ct(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ -o?t(o):n(u)},"cb"),s=new r(function(o,u){n=o,t=u}).catch(o=>{throw Error.captureStackTrace( -o),o});return{callback:i,result:s}}a(Ct,"promisify");function Cc(r,e){return a(function t(n){ -n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log("additional clien\ -t error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)}, -"idleListener")}a(Cc,"makeIdleListener");var bn=class bn extends _c{constructor(e,t){ -super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty( -this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}), -e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}), -this.options.max=this.options.max||this.options.poolSize||10,this.options.maxUses= -this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle|| -!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this. -options.log||function(){},this.Client=this.options.Client||t||Tt().Client,this.Promise= -this.options.Promise||S.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. -options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet, -this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){ -return this._clients.length>=this.options.max}_pulseQueue(){if(this.log("pulse q\ -ueue"),this.ended){this.log("pulse queue ended");return}if(this.ending){this.log( -"pulse queue on ending"),this._idle.length&&this._idle.slice().map(t=>{this._remove( -t.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this. -_pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&& -this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this. -_idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener; -return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e); -throw new Error("unexpected condition")}_remove(e){let t=Ms(this._idle,n=>n.client=== -e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(n=>n!== -e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Can\ -not use a pool after calling end on the pool");return e?e(i):this.Promise.reject( -i)}let t=Ct(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. -_idle.length&&m.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis) -return this._pendingQueue.push(new qe(t.callback)),n;let i=a((u,c,h)=>{clearTimeout( -o),t.callback(u,c,h)},"queueCallback"),s=new qe(i),o=setTimeout(()=>{Ms(this._pendingQueue, -u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when try\ -ing to connect"))},this.options.connectionTimeoutMillis);return this._pendingQueue. -push(s),n}return this.newClient(new qe(t.callback)),n}newClient(e){let t=new this. -Client(this.options);this._clients.push(t);let n=Cc(this,t);this.log("checking c\ -lient timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{ -this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): -t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"), -t.connect(o=>{if(i&&clearTimeout(i),t.on("error",n),o)this.log("client failed to\ - connect",o),this._clients=this._clients.filter(u=>u!==t),s&&(o.message="Connect\ -ion terminated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback( -o,void 0,Fs);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== -0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. -_expired.add(t),this._idle.findIndex(h=>h.client===t)!==-1&&this._acquireClient( -t,new qe((h,l,d)=>d()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( -"end",()=>clearTimeout(u))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ -i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n), -e.removeListener("error",n),t.timedOut?i&&this.options.verify?this.options.verify( -e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,Fs);t.callback(void 0,e,e.release)}):t.callback(void 0, -e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Ac(),n=!0,this._release(e, -t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1, -this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= -this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove ex\ -pended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e)){ -this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue(); -return}let s;this.options.idleTimeoutMillis&&(s=setTimeout(()=>{this.log("remove\ - idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&& -s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new yn(e,t,s)), -this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Ct(this.Promise,e); -return E(function(){return s.callback(new Error("Passing a function as the first\ - parameter to pool.query is not supported"))}),s.result}typeof t=="function"&&(n= -t,t=void 0);let i=Ct(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) -return n(s);let u=!1,c=a(h=>{u||(u=!0,o.release(h),n(h))},"onError");o.once("err\ -or",c),this.log("dispatching query");try{o.query(e,t,(h,l)=>{if(this.log("query \ -dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(h),h?n(h):n(void 0, -l)})}catch(h){return o.release(h),n(h)}}),i.result}end(e){if(this.log("ending"), -this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=Ct(this.Promise,e);return this._endCallback= -t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue. -length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients. -reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients. -length}};a(bn,"Pool");var mn=bn;Ds.exports=mn});var Os={};ie(Os,{default:()=>Tc});var Tc,Us=z(()=>{"use strict";p();Tc={}});var Ns=I((yf,Ic)=>{Ic.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ - client - pure javascript & libpq with the same API",keywords:["database","libpq", -"pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/bri\ -anc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-post\ -gres.git",directory:"packages/pg"},author:"Brian Carlson ",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0", -"pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-ty\ -pes":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"\ -4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{ -"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS\ -.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c\ -7b9a5491a178655"}});var js=I((mf,Qs)=>{"use strict";p();var qs=we().EventEmitter,Pc=(Ge(),N(He)),Sn=tt(), -Qe=Qs.exports=function(r,e,t){qs.call(this),r=Sn.normalizeQueryConfig(r,e,t),this. -text=r.text,this.values=r.values,this.name=r.name,this.callback=r.callback,this. -state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1,this.on("\ -newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Pc.inherits( -Qe,qs);var Bc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ -age",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"\ -dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"\ -routine"};Qe.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); -if(e)for(var t in e){var n=Bc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. -emit("error",r),this.state="error"};Qe.prototype.then=function(r,e){return this. -_getPromise().then(r,e)};Qe.prototype.catch=function(r){return this._getPromise(). -catch(r)};Qe.prototype._getPromise=function(){return this._promise?this._promise: -(this._promise=new Promise(function(r,e){this._once("end",r),this._once("error", -e)}.bind(this)),this._promise)};Qe.prototype.submit=function(r){this.state="runn\ -ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a( -function(s,o,u){if(r.native.arrayMode=!1,E(function(){e.emit("_done")}),s)return e. -handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,h)=>{c.forEach(l=>{e.emit( -"row",l,u[h])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( -"end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind( -t)),this.name){this.name.length>63&&(console.error("Warning! Postgres only suppo\ -rts 63 characters for query names."),console.error("You supplied %s (%s)",this.name, -this.name.length),console.error("This can cause conflicts and silent errors exec\ -uting queries"));var n=(this.values||[]).map(Sn.prepareValue);if(r.namedQueries[this. -name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Pre\ -pared statements must be unique - '${this.name}' was used for a different statem\ -ent`);return t(s)}return r.native.execute(this.name,n,t)}return r.native.prepare( -this.name,this.text,n.length,function(s){return s?t(s):(r.namedQueries[e.name]=e. -text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray(this. -values)){let s=new Error("Query values must be an array");return t(s)}var i=this. -values.map(Sn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. -text,t)}});var $s=I((Sf,Gs)=>{"use strict";p();var Lc=(Us(),N(Os)),Rc=gt(),bf=Ns(),Ws=we(). -EventEmitter,Fc=(Ge(),N(He)),Mc=wt(),Hs=js(),J=Gs.exports=function(r){Ws.call(this), -r=r||{},this._Promise=r.Promise||S.Promise,this._types=new Rc(r.types),this.native= -new Lc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= -!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Mc( -r);this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, -writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port= -e.port,this.namedQueries={}};J.Query=Hs;Fc.inherits(J,Ws);J.prototype._errorAllQueries= -function(r){let e=a(t=>{m.nextTick(()=>{t.native=this.native,t.handleError(r)})}, -"enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= -null),this._queryQueue.forEach(e),this._queryQueue.length=0};J.prototype._connect= -function(r){var e=this;if(this._connecting){m.nextTick(()=>r(new Error("Client h\ -as already been connected. You cannot reuse a client.")));return}this._connecting= -!0,this.connectionParameters.getLibpqConnectionString(function(t,n){if(t)return r( -t);e.native.connect(n,function(i){if(i)return e.native.end(),r(i);e._connected=!0, -e.native.on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("er\ -ror",s)}),e.native.on("notification",function(s){e.emit("notification",{channel:s. -relname,payload:s.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),r()})})};J. -prototype.connect=function(r){if(r){this._connect(r);return}return new this._Promise( -(e,t)=>{this._connect(n=>{n?t(n):e()})})};J.prototype.query=function(r,e,t){var n, -i,s,o,u;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ -ery");if(typeof r.submit=="function")s=r.query_timeout||this.connectionParameters. -query_timeout,i=n=r,typeof e=="function"&&(r.callback=e);else if(s=this.connectionParameters. -query_timeout,n=new Hs(r,e,t),!n.callback){let c,h;i=new this._Promise((l,d)=>{c= -l,h=d}),n.callback=(l,d)=>l?h(l):c(d)}return s&&(u=n.callback,o=setTimeout(()=>{ -var c=new Error("Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}), -u(c),n.callback=()=>{};var h=this._queryQueue.indexOf(n);h>-1&&this._queryQueue. -splice(h,1),this._pulseQueryQueue()},s),n.callback=(c,h)=>{clearTimeout(o),u(c,h)}), -this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( -new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push( -n),this._pulseQueryQueue(),i):(n.native=this.native,m.nextTick(()=>{n.handleError( -new Error("Client has encountered a connection error and is not queryable"))}),i)}; -J.prototype.end=function(r){var e=this;this._ending=!0,this._connected||this.once( -"connect",this.end.bind(this,r));var t;return r||(t=new this._Promise(function(n,i){ -r=a(s=>s?i(s):n(),"cb")})),this.native.end(function(){e._errorAllQueries(new Error( -"Connection terminated")),m.nextTick(()=>{e.emit("end"),r&&r()})}),t};J.prototype. -_hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="\ -error"&&this._activeQuery.state!=="end"};J.prototype._pulseQueryQueue=function(r){ -if(this._connected&&!this._hasActiveQuery()){var e=this._queryQueue.shift();if(!e){ -r||this.emit("drain");return}this._activeQuery=e,e.submit(this);var t=this;e.once( -"_done",function(){t._pulseQueryQueue()})}};J.prototype.cancel=function(r){this. -_activeQuery===r?this.native.cancel(function(){}):this._queryQueue.indexOf(r)!== --1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};J.prototype.ref=function(){}; -J.prototype.unref=function(){};J.prototype.setTypeParser=function(r,e,t){return this. -_types.setTypeParser(r,e,t)};J.prototype.getTypeParser=function(r,e){return this. -_types.getTypeParser(r,e)}});var En=I((vf,Vs)=>{"use strict";p();Vs.exports=$s()});var Tt=I((Af,nt)=>{"use strict";p();var Dc=Rs(),kc=et(),Oc=fn(),Uc=ks(),{DatabaseError:Nc}=cn(), -qc=a(r=>{var e;return e=class extends Uc{constructor(n){super(n,r)}},a(e,"BoundP\ -ool"),e},"poolFactory"),xn=a(function(r){this.defaults=kc,this.Client=r,this.Query= -this.Client.Query,this.Pool=qc(this.Client),this._pools=[],this.Connection=Oc,this. -types=Xe(),this.DatabaseError=Nc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?nt. -exports=new xn(En()):(nt.exports=new xn(Dc),Object.defineProperty(nt.exports,"na\ -tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new xn(En())}catch(e){ -if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(nt.exports,"\ -native",{value:r}),r}}))});p();var Pt=Ie(Tt());bt();p();bt();yr();var Ys=Ie(tt()),Zs=Ie(gt());var It=class It extends Error{constructor(t){super(t);_(this,"name","NeonDbError"); -_(this,"severity");_(this,"code");_(this,"detail");_(this,"hint");_(this,"positi\ -on");_(this,"internalPosition");_(this,"internalQuery");_(this,"where");_(this,"\ -schema");_(this,"table");_(this,"column");_(this,"dataType");_(this,"constraint"); -_(this,"file");_(this,"line");_(this,"routine");_(this,"sourceError");"captureSt\ -ackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace( -this,It)}};a(It,"NeonDbError");var fe=It,Ks="transaction() expects an array of q\ -ueries, or a function returning an array of queries",Qc=["severity","code","deta\ -il","hint","position","internalPosition","internalQuery","where","schema","table", -"column","dataType","constraint","file","line","routine"];function Js(r,{arrayMode:e, -fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,queryCallback:u, -resultCallback:c,authToken:h}={}){if(!r)throw new Error("No database connection \ -string was provided to `neon()`. Perhaps an environment variable has not been se\ -t?");let l;try{l=dr(r)}catch{throw new Error("Database connection string provide\ -d to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:d, -username:b,hostname:C,port:B,pathname:j}=l;if(d!=="postgres:"&&d!=="postgresql:"|| -!b||!C||!j)throw new Error("Database connection string format for `neon()` shoul\ -d be: postgresql://user:password@host.tld/dbname?option=value");function X(A,...w){ -let P,V;if(typeof A=="string")P=A,V=w[1],w=w[0]??[];else{P="";for(let W=0;W(0,Ys.prepareValue)(W));let O={query:P, -params:w};return u&&u(O),jc(pe,O,V)}a(X,"resolve"),X.transaction=async(A,w)=>{if(typeof A== -"function"&&(A=A(X)),!Array.isArray(A))throw new Error(Ks);A.forEach(O=>{if(O[Symbol. -toStringTag]!=="NeonQueryPromise")throw new Error(Ks)});let P=A.map(O=>O.parameterizedQuery), -V=A.map(O=>O.opts??{});return pe(P,V,w)};async function pe(A,w,P){let{fetchEndpoint:V, -fetchFunction:O}=Ae,W=typeof V=="function"?V(C,B,{jwtAuth:h!==void 0}):V,ae=Array. -isArray(A)?{queries:A}:A,ee=n??{},R=e??!1,G=t??!1,ue=i,de=s,Ee=o;P!==void 0&&(P. -fetchOptions!==void 0&&(ee={...ee,...P.fetchOptions}),P.arrayMode!==void 0&&(R=P. -arrayMode),P.fullResults!==void 0&&(G=P.fullResults),P.isolationLevel!==void 0&& -(ue=P.isolationLevel),P.readOnly!==void 0&&(de=P.readOnly),P.deferrable!==void 0&& -(Ee=P.deferrable)),w!==void 0&&!Array.isArray(w)&&w.fetchOptions!==void 0&&(ee={ -...ee,...w.fetchOptions});let ce={"Neon-Connection-String":r,"Neon-Raw-Text-Outp\ -ut":"true","Neon-Array-Mode":"true"},Ce=await Wc(h);Ce&&(ce.Authorization=`Beare\ -r ${Ce}`),Array.isArray(A)&&(ue!==void 0&&(ce["Neon-Batch-Isolation-Level"]=ue), -de!==void 0&&(ce["Neon-Batch-Read-Only"]=String(de)),Ee!==void 0&&(ce["Neon-Batc\ -h-Deferrable"]=String(Ee)));let ye;try{ye=await(O??fetch)(W,{method:"POST",body:JSON. -stringify(ae),headers:ce,...ee})}catch(K){let k=new fe(`Error connecting to data\ -base: ${K.message}`);throw k.sourceError=K,k}if(ye.ok){let K=await ye.json();if(Array. -isArray(A)){let k=K.results;if(!Array.isArray(k))throw new fe("Neon internal err\ -or: unexpected result format");return k.map((me,xe)=>{let Bt=w[xe]??{},to=Bt.arrayMode?? -R,ro=Bt.fullResults??G;return zs(me,{arrayMode:to,fullResults:ro,parameterizedQuery:A[xe], -resultCallback:c,types:Bt.types})})}else{let k=w??{},me=k.arrayMode??R,xe=k.fullResults?? -G;return zs(K,{arrayMode:me,fullResults:xe,parameterizedQuery:A,resultCallback:c, -types:k.types})}}else{let{status:K}=ye;if(K===400){let k=await ye.json(),me=new fe( -k.message);for(let xe of Qc)me[xe]=k[xe]??void 0;throw me}else{let k=await ye.text(); -throw new fe(`Server error (HTTP status ${K}): ${k}`)}}}return a(pe,"execute"),X} -a(Js,"neon");function jc(r,e,t){return{[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e, -opts:t,then:a((n,i)=>r(e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"), -finally:a(n=>r(e,t).finally(n),"finally")}}a(jc,"createNeonQueryPromise");function zs(r,{ -arrayMode:e,fullResults:t,parameterizedQuery:n,resultCallback:i,types:s}){let o=new Zs.default( -s),u=r.fields.map(l=>l.name),c=r.fields.map(l=>o.getTypeParser(l.dataTypeID)),h=e=== -!0?r.rows.map(l=>l.map((d,b)=>d===null?null:c[b](d))):r.rows.map(l=>Object.fromEntries( -l.map((d,b)=>[u[b],d===null?null:c[b](d)])));return i&&i(n,r,h,{arrayMode:e,fullResults:t}), -t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=h,r._parsers=c,r._types=o,r):h}a(zs,"\ -processQueryResult");async function Wc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new fe("Error ge\ -tting auth token.");throw e instanceof Error&&(t=new fe(`Error getting auth toke\ -n: ${e.message}`)),t}}a(Wc,"getAuthToken");var eo=Ie(wt()),je=Ie(Tt());var _n=class _n extends Pt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ -return this.connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&& -(this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&&console.warn("\ -SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string\ - + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = tru\ -e). Double encryption will increase latency and CPU usage. It may be appropriate\ - to disable SSL in the Postgres connection parameters or set forceDisablePgSSL =\ - true.");let i=this.config?.host!==void 0||this.config?.connectionString!==void 0|| -m.env.PGHOST!==void 0,s=m.env.USER??m.env.USERNAME;if(!i&&this.host==="localhost"&& -this.user===s&&this.database===s&&this.password===null)throw new Error(`No datab\ -ase host or connection string was set, and key parameters have default values (h\ -ost: localhost, user: ${s}, db: ${s}, password: null). Is an environment variabl\ -e missing? Alternatively, if you intended to connect with these parameters, plea\ -se set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&& -this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let h=this. -connection;if(u&&h.on("connect",()=>h.stream.emit("data","S")),c){h.removeAllListeners( -"authenticationCleartextPassword"),h.removeAllListeners("readyForQuery"),h.once( -"readyForQuery",()=>h.on("readyForQuery",this._handleReadyForQuery.bind(this))); -let l=this.ssl?"sslconnect":"connect";h.on(l,()=>{this._handleAuthCleartextPassword(), -this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){let n=this. -saslSession,i=this.password,s=t.data;if(n.message!=="SASLInitialResponse"||typeof i!= -"string"||typeof s!="string")throw new Error("SASL: protocol error");let o=Object. -fromEntries(s.split(",").map(K=>{if(!/^.=/.test(K))throw new Error("SASL: Invali\ -d attribute pair entry");let k=K[0],me=K.substring(2);return[k,me]})),u=o.r,c=o. -s,h=o.i;if(!u||!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-\ -MESSAGE: nonce missing/unprintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ -64");if(!h||!/^[1-9][0-9]*$/.test(h))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ -ESSAGE: missing/invalid iteration count");if(!u.startsWith(n.clientNonce))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); -if(u.length===n.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ -SAGE: server nonce is too short");let l=parseInt(h,10),d=y.from(c,"base64"),b=new TextEncoder, -C=b.encode(i),B=await g.subtle.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-25\ -6"}},!1,["sign"]),j=new Uint8Array(await g.subtle.sign("HMAC",B,y.concat([d,y.from( -[0,0,0,1])]))),X=j;for(var pe=0;peX[k]^j[k]));let A=X,w=await g.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),P=new Uint8Array(await g. -subtle.sign("HMAC",w,b.encode("Client Key"))),V=await g.subtle.digest("SHA-256", -P),O="n=*,r="+n.clientNonce,W="r="+u+",s="+c+",i="+l,ae="c=biws,r="+u,ee=O+","+W+ -","+ae,R=await g.subtle.importKey("raw",V,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]);var G=new Uint8Array(await g.subtle.sign("HMAC",R,b.encode(ee))),ue=y. -from(P.map((K,k)=>P[k]^G[k])),de=ue.toString("base64");let Ee=await g.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),ce=await g.subtle.sign( -"HMAC",Ee,b.encode("Server Key")),Ce=await g.subtle.importKey("raw",ce,{name:"HM\ -AC",hash:{name:"SHA-256"}},!1,["sign"]);var ye=y.from(await g.subtle.sign("HMAC", -Ce,b.encode(ee)));n.message="SASLResponse",n.serverSignature=ye.toString("base64"), -n.response=ae+",p="+de,this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}};a(_n,"NeonClient");var vn=_n;function Hc(r,e){if(e)return{callback:e, -result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u});return{callback:i,result:s}}a(Hc,"promisify");var An=class An extends Pt.Pool{constructor(){ -super(...arguments);_(this,"Client",vn);_(this,"hasFetchUnsupportedListeners",!1)}on(t,n){ -return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ -if(!Ae.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function") -return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Hc(this.Promise, -i);i=s.callback;try{let o=new eo.default(this.options),u=encodeURIComponent,c=encodeURI, -h=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`,l=typeof t== -"string"?t:t.text,d=n??t.values??[];Js(h,{fullResults:!0,arrayMode:t.rowMode==="\ -array"})(l,d,{types:t.types??this.options?.types}).then(C=>i(void 0,C)).catch(C=>i( -C))}catch(o){i(o)}return s.result}};a(An,"NeonPool");var Xs=An;var export_ClientBase=je.ClientBase;var export_Connection=je.Connection;var export_DatabaseError=je.DatabaseError; -var export_Query=je.Query;var export_defaults=je.defaults;var export_types=je.types; -export{vn as Client,export_ClientBase as ClientBase,export_Connection as Connection, -export_DatabaseError as DatabaseError,fe as NeonDbError,Xs as Pool,export_Query as Query, -export_defaults as defaults,Js as neon,Ae as neonConfig,export_types as types}; -/*! Bundled license information: - -ieee754/index.js: - (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) - -buffer/index.js: - (*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - *) -*/ diff --git a/node_modules/@neondatabase/serverless/package.json b/node_modules/@neondatabase/serverless/package.json deleted file mode 100644 index c2ac194b951ec1a31710a893a5266633e7a308ad..0000000000000000000000000000000000000000 --- a/node_modules/@neondatabase/serverless/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@neondatabase/serverless", - "version": "0.10.1", - "author": "Neon", - "description": "node-postgres for serverless environments from neon.tech", - "exports": { - "require": "./index.js", - "import": "./index.mjs" - }, - "license": "MIT", - "homepage": "https://neon.tech", - "repository": { - "type": "git", - "url": "https://github.com/neondatabase/serverless" - }, - "keywords": [ - "Neon", - "serverless", - "Postgres", - "PostgreSQL", - "pg", - "database", - "SQL", - "edge", - "workers", - "Cloudflare", - "Vercel", - "RDBMS", - "WebSocket", - "https" - ], - "dependencies": { - "@types/pg": "8.11.6" - } -} diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE deleted file mode 100644 index 65a999460170355f6383b8f122da09e66e485165..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md deleted file mode 100644 index e0b218b9f090cbf38b4a75f1f6b83b46bf8e4476..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# @nodelib/fs.scandir - -> List files and directories inside the specified directory. - -## :bulb: Highlights - -The package is aimed at obtaining information about entries in the directory. - -* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). -* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). -* :link: Can safely work with broken symbolic links. - -## Install - -```console -npm install @nodelib/fs.scandir -``` - -## Usage - -```ts -import * as fsScandir from '@nodelib/fs.scandir'; - -fsScandir.scandir('path', (error, stats) => { /* … */ }); -``` - -## API - -### .scandir(path, [optionsOrSettings], callback) - -Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. - -```ts -fsScandir.scandir('path', (error, entries) => { /* … */ }); -fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); -fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); -``` - -### .scandirSync(path, [optionsOrSettings]) - -Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. - -```ts -const entries = fsScandir.scandirSync('path'); -const entries = fsScandir.scandirSync('path', {}); -const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsScandir.Settings({ followSymbolicLinks: false }); - -const entries = fsScandir.scandirSync('path', settings); -``` - -## Entry - -* `name` — The name of the entry (`unknown.txt`). -* `path` — The path of the entry relative to call directory (`root/unknown.txt`). -* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. -* `stats` (optional) — An instance of `fs.Stats` class. - -For example, the `scandir` call for `tools` directory with one directory inside: - -```ts -{ - dirent: Dirent { name: 'typedoc', /* … */ }, - name: 'typedoc', - path: 'tools/typedoc' -} -``` - -## Options - -### stats - -* Type: `boolean` -* Default: `false` - -Adds an instance of `fs.Stats` class to the [`Entry`](#entry). - -> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? - -### followSymbolicLinks - -* Type: `boolean` -* Default: `false` - -Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. - -### `pathSegmentSeparator` - -* Type: `string` -* Default: `path.sep` - -By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. - -### `fs` - -* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; - readdir?: typeof fs.readdir; - readdirSync?: typeof fs.readdirSync; -} - -const settings = new fsScandir.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## `old` and `modern` mode - -This package has two modes that are used depending on the environment and parameters of use. - -### old - -* Node.js below `10.10` or when the `stats` option is enabled - -When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). - -### modern - -* Node.js 10.10+ and the `stats` option is disabled - -In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. - -This mode makes fewer calls to the file system. It's faster. - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts deleted file mode 100644 index 827f1db09aac5d9f6b2e63d56a509ae67faaf0e6..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type * as fsStat from '@nodelib/fs.stat'; -import type { Dirent, ErrnoException } from '../types'; -export interface ReaddirAsynchronousMethod { - (filepath: string, options: { - withFileTypes: true; - }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; - (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; -} -export interface ReaddirSynchronousMethod { - (filepath: string, options: { - withFileTypes: true; - }): Dirent[]; - (filepath: string): string[]; -} -export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { - readdir: ReaddirAsynchronousMethod; - readdirSync: ReaddirSynchronousMethod; -}; -export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js deleted file mode 100644 index f0fe022023e6dfd5b56c33f2bac6d2d3b180e1c5..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts deleted file mode 100644 index 33f17497d43b391287e2c9fc65d1c7cb4668ea50..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * IS `true` for Node.js 10.10 and greater. - */ -export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js deleted file mode 100644 index 7e3d4411f751e190be8794b687e9fa60ef5fae06..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; -const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); -if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { - throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); -} -const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); -const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); -const SUPPORTED_MAJOR_VERSION = 10; -const SUPPORTED_MINOR_VERSION = 10; -const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; -const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; -/** - * IS `true` for Node.js 10.10 and greater. - */ -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts deleted file mode 100644 index b9da83ed172315106269d96bb9043c922af68cc5..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; -import * as async from './providers/async'; -import Settings, { Options } from './settings'; -import type { Dirent, Entry } from './types'; -declare type AsyncCallback = async.AsyncCallback; -declare function scandir(path: string, callback: AsyncCallback): void; -declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace scandir { - function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; -export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js deleted file mode 100644 index 99c70d3d635f73d2704b02695933770401b14d37..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Settings = exports.scandirSync = exports.scandir = void 0; -const async = require("./providers/async"); -const sync = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function scandir(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - async.read(path, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.scandir = scandir; -function scandirSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.scandirSync = scandirSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts deleted file mode 100644 index 5829676df7e302e14b87edf2d99c04b58384d0af..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import type Settings from '../settings'; -import type { Entry } from '../types'; -export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; -export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; -export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; -export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js deleted file mode 100644 index e8e2f0a9cba94ed06b7762f2846ab88330aaa44e..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/async.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = require("@nodelib/fs.stat"); -const rpl = require("run-parallel"); -const constants_1 = require("../constants"); -const utils = require("../utils"); -const common = require("./common"); -function read(directory, settings, callback) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - readdirWithFileTypes(directory, settings, callback); - return; - } - readdir(directory, settings, callback); -} -exports.read = read; -function readdirWithFileTypes(directory, settings, callback) { - settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const entries = dirents.map((dirent) => ({ - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - })); - if (!settings.followSymbolicLinks) { - callSuccessCallback(callback, entries); - return; - } - const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); - rpl(tasks, (rplError, rplEntries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, rplEntries); - }); - }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function makeRplTaskEntry(entry, settings) { - return (done) => { - if (!entry.dirent.isSymbolicLink()) { - done(null, entry); - return; - } - settings.fs.stat(entry.path, (statError, stats) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - done(statError); - return; - } - done(null, entry); - return; - } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - done(null, entry); - }); - }; -} -function readdir(directory, settings, callback) { - settings.fs.readdir(directory, (readdirError, names) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const tasks = names.map((name) => { - const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - return (done) => { - fsStat.stat(path, settings.fsStatSettings, (error, stats) => { - if (error !== null) { - done(error); - return; - } - const entry = { - name, - path, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - done(null, entry); - }); - }; - }); - rpl(tasks, (rplError, entries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, entries); - }); - }); -} -exports.readdir = readdir; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts deleted file mode 100644 index 2b4d08b57a0de23a030b494abbb236239638b122..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js deleted file mode 100644 index 8724cb59afe97cdfebdf6b50bdf36534537e781c..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/common.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.joinPathSegments = void 0; -function joinPathSegments(a, b, separator) { - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts deleted file mode 100644 index e05c8f072cb5766844c31f6d8424c692f0caacac..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type Settings from '../settings'; -import type { Entry } from '../types'; -export declare function read(directory: string, settings: Settings): Entry[]; -export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; -export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js deleted file mode 100644 index 146db3434f42252e4071db1624074a666fe21b4a..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/sync.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = require("@nodelib/fs.stat"); -const constants_1 = require("../constants"); -const utils = require("../utils"); -const common = require("./common"); -function read(directory, settings) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings); - } - return readdir(directory, settings); -} -exports.read = read; -function readdirWithFileTypes(directory, settings) { - const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); - return dirents.map((dirent) => { - const entry = { - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { - try { - const stats = settings.fs.statSync(entry.path); - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - } - catch (error) { - if (settings.throwErrorOnBrokenSymbolicLink) { - throw error; - } - } - } - return entry; - }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function readdir(directory, settings) { - const names = settings.fs.readdirSync(directory); - return names.map((name) => { - const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - const stats = fsStat.statSync(entryPath, settings.fsStatSettings); - const entry = { - name, - path: entryPath, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - return entry; - }); -} -exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts deleted file mode 100644 index a0db11559914a553d8e2da52b612bf48f2d5dd74..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/settings.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as fsStat from '@nodelib/fs.stat'; -import * as fs from './adapters/fs'; -export interface Options { - followSymbolicLinks?: boolean; - fs?: Partial; - pathSegmentSeparator?: string; - stats?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly followSymbolicLinks: boolean; - readonly fs: fs.FileSystemAdapter; - readonly pathSegmentSeparator: string; - readonly stats: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - readonly fsStatSettings: fsStat.Settings; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js deleted file mode 100644 index 15a3e8cde7704afdc4d66723ac440c2acb7e3519..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/settings.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsStat = require("@nodelib/fs.stat"); -const fs = require("./adapters/fs"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.stats = this._getValue(this._options.stats, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - this.fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this.followSymbolicLinks, - fs: this.fs, - throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts deleted file mode 100644 index f326c5e5e41f3288779c97c777e782e5642aed1f..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -import type * as fs from 'fs'; -export interface Entry { - dirent: Dirent; - name: string; - path: string; - stats?: Stats; -} -export declare type Stats = fs.Stats; -export declare type ErrnoException = NodeJS.ErrnoException; -export interface Dirent { - isBlockDevice: () => boolean; - isCharacterDevice: () => boolean; - isDirectory: () => boolean; - isFIFO: () => boolean; - isFile: () => boolean; - isSocket: () => boolean; - isSymbolicLink: () => boolean; - name: string; -} diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js deleted file mode 100644 index c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts deleted file mode 100644 index bb863f1573e99fe2fe287dcdd8d22c075dd014e1..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Dirent, Stats } from '../types'; -export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js deleted file mode 100644 index ace7c74d63f6da763b2711a4119d6005f5c3b187..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts deleted file mode 100644 index 1b41954e79d847e0f085ce4235b8ee62fddb1977..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as fs from './fs'; -export { fs }; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js deleted file mode 100644 index f5de129f47b80353304d3219c96f73f59a390397..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fs = void 0; -const fs = require("./fs"); -exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json deleted file mode 100644 index d3a89241b3c1891339651dfdeb9495813587e289..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.scandir/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@nodelib/fs.scandir", - "version": "2.1.5", - "description": "List files and directories inside the specified directory", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "scandir", - "readdir", - "dirent" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4", - "@types/run-parallel": "^1.1.0" - }, - "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" -} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE deleted file mode 100644 index 65a999460170355f6383b8f122da09e66e485165..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md deleted file mode 100644 index 686f0471d40f2f522e53db44f5a5b7a73a65e9df..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# @nodelib/fs.stat - -> Get the status of a file with some features. - -## :bulb: Highlights - -Wrapper around standard method `fs.lstat` and `fs.stat` with some features. - -* :beginner: Normally follows symbolic link. -* :gear: Can safely work with broken symbolic link. - -## Install - -```console -npm install @nodelib/fs.stat -``` - -## Usage - -```ts -import * as fsStat from '@nodelib/fs.stat'; - -fsStat.stat('path', (error, stats) => { /* … */ }); -``` - -## API - -### .stat(path, [optionsOrSettings], callback) - -Returns an instance of `fs.Stats` class for provided path with standard callback-style. - -```ts -fsStat.stat('path', (error, stats) => { /* … */ }); -fsStat.stat('path', {}, (error, stats) => { /* … */ }); -fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); -``` - -### .statSync(path, [optionsOrSettings]) - -Returns an instance of `fs.Stats` class for provided path. - -```ts -const stats = fsStat.stat('path'); -const stats = fsStat.stat('path', {}); -const stats = fsStat.stat('path', new fsStat.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settings) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsStat.Settings({ followSymbolicLink: false }); - -const stats = fsStat.stat('path', settings); -``` - -## Options - -### `followSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. - -### `markSymbolicLink` - -* Type: `boolean` -* Default: `false` - -Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). - -> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -### `fs` - -* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; -} - -const settings = new fsStat.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts deleted file mode 100644 index 3af759c95fb85c927bc8204a49c5eaca37d691d2..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import * as fs from 'fs'; -import type { ErrnoException } from '../types'; -export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; -export declare type StatSynchronousMethod = (path: string) => fs.Stats; -export interface FileSystemAdapter { - lstat: StatAsynchronousMethod; - stat: StatAsynchronousMethod; - lstatSync: StatSynchronousMethod; - statSync: StatSynchronousMethod; -} -export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js deleted file mode 100644 index 8dc08c8ca1f1c72aa9622352ca5d55f65198767d..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/adapters/fs.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts deleted file mode 100644 index f95db995c7f8fd07939359f4885835eebcd9e0fc..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; -import * as async from './providers/async'; -import Settings, { Options } from './settings'; -import type { Stats } from './types'; -declare type AsyncCallback = async.AsyncCallback; -declare function stat(path: string, callback: AsyncCallback): void; -declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace stat { - function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; -export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js deleted file mode 100644 index b23f7510d050fe830d40765ad49fe72b21ebef5b..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.statSync = exports.stat = exports.Settings = void 0; -const async = require("./providers/async"); -const sync = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function stat(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - async.read(path, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.stat = stat; -function statSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.statSync = statSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts deleted file mode 100644 index 85423ce11e2efb74a86e9477405e1976fec6b7c5..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Settings from '../settings'; -import type { ErrnoException, Stats } from '../types'; -export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; -export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js deleted file mode 100644 index 983ff0e6cb79f6e4442be70c43e79c6b406dd9bb..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/async.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.read = void 0; -function read(path, settings, callback) { - settings.fs.lstat(path, (lstatError, lstat) => { - if (lstatError !== null) { - callFailureCallback(callback, lstatError); - return; - } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - callSuccessCallback(callback, lstat); - return; - } - settings.fs.stat(path, (statError, stat) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - callFailureCallback(callback, statError); - return; - } - callSuccessCallback(callback, lstat); - return; - } - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; - } - callSuccessCallback(callback, stat); - }); - }); -} -exports.read = read; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts deleted file mode 100644 index 428c3d792b385664fe3fe4770c46e558d7ca5285..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type Settings from '../settings'; -import type { Stats } from '../types'; -export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js deleted file mode 100644 index 1521c3616eaee4439c5cd1a855c97d029d4dab38..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/sync.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.read = void 0; -function read(path, settings) { - const lstat = settings.fs.lstatSync(path); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return lstat; - } - try { - const stat = settings.fs.statSync(path); - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; - } - return stat; - } - catch (error) { - if (!settings.throwErrorOnBrokenSymbolicLink) { - return lstat; - } - throw error; - } -} -exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts deleted file mode 100644 index f4b3d444302ff6b5715a79341156f61350bd0a1b..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/settings.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as fs from './adapters/fs'; -export interface Options { - followSymbolicLink?: boolean; - fs?: Partial; - markSymbolicLink?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly followSymbolicLink: boolean; - readonly fs: fs.FileSystemAdapter; - readonly markSymbolicLink: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js deleted file mode 100644 index 111ec09ca6491ae6d8d9a9c9bdcb32c8408afcc4..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/settings.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = require("./adapters/fs"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts deleted file mode 100644 index 74c08ed2f7a1201d2e28453602b83241d83ade82..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -import type * as fs from 'fs'; -export declare type Stats = fs.Stats; -export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js deleted file mode 100644 index c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json deleted file mode 100644 index f2540c2894ea9181f73274a493df0dc3789d6128..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.stat/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@nodelib/fs.stat", - "version": "2.0.5", - "description": "Get the status of a file with some features", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "stat" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4" - }, - "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" -} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE deleted file mode 100644 index 65a999460170355f6383b8f122da09e66e485165..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md deleted file mode 100644 index 6ccc08db4a10bca492f2db7b547b98a7f22a4e8c..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# @nodelib/fs.walk - -> A library for efficiently walking a directory recursively. - -## :bulb: Highlights - -* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). -* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). -* :gear: Built-in directories/files and error filtering system. -* :link: Can safely work with broken symbolic links. - -## Install - -```console -npm install @nodelib/fs.walk -``` - -## Usage - -```ts -import * as fsWalk from '@nodelib/fs.walk'; - -fsWalk.walk('path', (error, entries) => { /* … */ }); -``` - -## API - -### .walk(path, [optionsOrSettings], callback) - -Reads the directory recursively and asynchronously. Requires a callback function. - -> :book: If you want to use the Promise API, use `util.promisify`. - -```ts -fsWalk.walk('path', (error, entries) => { /* … */ }); -fsWalk.walk('path', {}, (error, entries) => { /* … */ }); -fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); -``` - -### .walkStream(path, [optionsOrSettings]) - -Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. - -```ts -const stream = fsWalk.walkStream('path'); -const stream = fsWalk.walkStream('path', {}); -const stream = fsWalk.walkStream('path', new fsWalk.Settings()); -``` - -### .walkSync(path, [optionsOrSettings]) - -Reads the directory recursively and synchronously. Returns an array of entries. - -```ts -const entries = fsWalk.walkSync('path'); -const entries = fsWalk.walkSync('path', {}); -const entries = fsWalk.walkSync('path', new fsWalk.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settings) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsWalk.Settings({ followSymbolicLinks: true }); - -const entries = fsWalk.walkSync('path', settings); -``` - -## Entry - -* `name` — The name of the entry (`unknown.txt`). -* `path` — The path of the entry relative to call directory (`root/unknown.txt`). -* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. -* [`stats`] — An instance of `fs.Stats` class. - -## Options - -### basePath - -* Type: `string` -* Default: `undefined` - -By default, all paths are built relative to the root path. You can use this option to set custom root path. - -In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. - -```ts -fsWalk.walkSync('root'); // → ['root/file.txt'] -fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] -``` - -### concurrency - -* Type: `number` -* Default: `Infinity` - -The maximum number of concurrent calls to `fs.readdir`. - -> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). - -### deepFilter - -* Type: [`DeepFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that indicates whether the directory will be read deep or not. - -```ts -// Skip all directories that starts with `node_modules` -const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); -``` - -### entryFilter - -* Type: [`EntryFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that indicates whether the entry will be included to results or not. - -```ts -// Exclude all `.js` files from results -const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); -``` - -### errorFilter - -* Type: [`ErrorFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that allows you to skip errors that occur when reading directories. - -For example, you can skip `ENOENT` errors if required: - -```ts -// Skip all ENOENT errors -const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; -``` - -### stats - -* Type: `boolean` -* Default: `false` - -Adds an instance of `fs.Stats` class to the [`Entry`](#entry). - -> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. - -### followSymbolicLinks - -* Type: `boolean` -* Default: `false` - -Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -### `pathSegmentSeparator` - -* Type: `string` -* Default: `path.sep` - -By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. - -### `fs` - -* Type: `FileSystemAdapter` -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat: typeof fs.lstat; - stat: typeof fs.stat; - lstatSync: typeof fs.lstatSync; - statSync: typeof fs.statSync; - readdir: typeof fs.readdir; - readdirSync: typeof fs.readdirSync; -} - -const settings = new fsWalk.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts deleted file mode 100644 index 8864c7bff5d8cb4a3db399a957f5eb49031d3248..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -import type { Readable } from 'stream'; -import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; -import { AsyncCallback } from './providers/async'; -import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; -import type { Entry } from './types'; -declare function walk(directory: string, callback: AsyncCallback): void; -declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace walk { - function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; -declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; -export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js deleted file mode 100644 index 15207874afa1dadac7f7655545b4b1f75ee87a78..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; -const async_1 = require("./providers/async"); -const stream_1 = require("./providers/stream"); -const sync_1 = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); - return; - } - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); -} -exports.walk = walk; -function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); -} -exports.walkSync = walkSync; -function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); -} -exports.walkStream = walkStream; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts deleted file mode 100644 index 0f6717d780f64fd49f31ba1cfccabb40eb5aafea..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import AsyncReader from '../readers/async'; -import type Settings from '../settings'; -import type { Entry, Errno } from '../types'; -export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; -export default class AsyncProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: AsyncReader; - private readonly _storage; - constructor(_root: string, _settings: Settings); - read(callback: AsyncCallback): void; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js deleted file mode 100644 index 51d3be51a85d46c5ab53f5b7d92675996d02887c..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/async.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const async_1 = require("../readers/async"); -class AsyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._storage = []; - } - read(callback) { - this._reader.onError((error) => { - callFailureCallback(callback, error); - }); - this._reader.onEntry((entry) => { - this._storage.push(entry); - }); - this._reader.onEnd(() => { - callSuccessCallback(callback, this._storage); - }); - this._reader.read(); - } -} -exports.default = AsyncProvider; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, entries) { - callback(null, entries); -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts deleted file mode 100644 index 874f60c5a10b2f8fdfca1725fc1e8ff335e7549c..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import AsyncProvider from './async'; -import StreamProvider from './stream'; -import SyncProvider from './sync'; -export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js deleted file mode 100644 index 4c2529ce8a385a0215ddf188b8a46163b2e18842..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/index.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; -const async_1 = require("./async"); -exports.AsyncProvider = async_1.default; -const stream_1 = require("./stream"); -exports.StreamProvider = stream_1.default; -const sync_1 = require("./sync"); -exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts deleted file mode 100644 index 294185f85dc59d2a40eec8b0fea2d87958e41cdf..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { Readable } from 'stream'; -import AsyncReader from '../readers/async'; -import type Settings from '../settings'; -export default class StreamProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: AsyncReader; - protected readonly _stream: Readable; - constructor(_root: string, _settings: Settings); - read(): Readable; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js deleted file mode 100644 index 51298b0f58f14b0c9b9f36061cdd0c0b950ba2f3..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/stream.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = require("stream"); -const async_1 = require("../readers/async"); -class StreamProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._stream = new stream_1.Readable({ - objectMode: true, - read: () => { }, - destroy: () => { - if (!this._reader.isDestroyed) { - this._reader.destroy(); - } - } - }); - } - read() { - this._reader.onError((error) => { - this._stream.emit('error', error); - }); - this._reader.onEntry((entry) => { - this._stream.push(entry); - }); - this._reader.onEnd(() => { - this._stream.push(null); - }); - this._reader.read(); - return this._stream; - } -} -exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts deleted file mode 100644 index 551c42e41293756691160855d122f365710ac007..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import SyncReader from '../readers/sync'; -import type Settings from '../settings'; -import type { Entry } from '../types'; -export default class SyncProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: SyncReader; - constructor(_root: string, _settings: Settings); - read(): Entry[]; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js deleted file mode 100644 index faab6ca2ad4262e2d9d5539b8c6ce0017090fd29..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/sync.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = require("../readers/sync"); -class SyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new sync_1.default(this._root, this._settings); - } - read() { - return this._reader.read(); - } -} -exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts deleted file mode 100644 index 9acf4e6c25f383ab22f55ff79a7f2022f6238773..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import * as fsScandir from '@nodelib/fs.scandir'; -import type Settings from '../settings'; -import type { Entry, Errno } from '../types'; -import Reader from './reader'; -declare type EntryEventCallback = (entry: Entry) => void; -declare type ErrorEventCallback = (error: Errno) => void; -declare type EndEventCallback = () => void; -export default class AsyncReader extends Reader { - protected readonly _settings: Settings; - protected readonly _scandir: typeof fsScandir.scandir; - protected readonly _emitter: EventEmitter; - private readonly _queue; - private _isFatalError; - private _isDestroyed; - constructor(_root: string, _settings: Settings); - read(): EventEmitter; - get isDestroyed(): boolean; - destroy(): void; - onEntry(callback: EntryEventCallback): void; - onError(callback: ErrorEventCallback): void; - onEnd(callback: EndEventCallback): void; - private _pushToQueue; - private _worker; - private _handleError; - private _handleEntry; - private _emitEntry; -} -export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js deleted file mode 100644 index ebe8dd5735858b58c0d6a38cdb925c85c7c03651..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/async.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = require("events"); -const fsScandir = require("@nodelib/fs.scandir"); -const fastq = require("fastq"); -const common = require("./common"); -const reader_1 = require("./reader"); -class AsyncReader extends reader_1.default { - constructor(_root, _settings) { - super(_root, _settings); - this._settings = _settings; - this._scandir = fsScandir.scandir; - this._emitter = new events_1.EventEmitter(); - this._queue = fastq(this._worker.bind(this), this._settings.concurrency); - this._isFatalError = false; - this._isDestroyed = false; - this._queue.drain = () => { - if (!this._isFatalError) { - this._emitter.emit('end'); - } - }; - } - read() { - this._isFatalError = false; - this._isDestroyed = false; - setImmediate(() => { - this._pushToQueue(this._root, this._settings.basePath); - }); - return this._emitter; - } - get isDestroyed() { - return this._isDestroyed; - } - destroy() { - if (this._isDestroyed) { - throw new Error('The reader is already destroyed'); - } - this._isDestroyed = true; - this._queue.killAndDrain(); - } - onEntry(callback) { - this._emitter.on('entry', callback); - } - onError(callback) { - this._emitter.once('error', callback); - } - onEnd(callback) { - this._emitter.once('end', callback); - } - _pushToQueue(directory, base) { - const queueItem = { directory, base }; - this._queue.push(queueItem, (error) => { - if (error !== null) { - this._handleError(error); - } - }); - } - _worker(item, done) { - this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { - if (error !== null) { - done(error, undefined); - return; - } - for (const entry of entries) { - this._handleEntry(entry, item.base); - } - done(null, undefined); - }); - } - _handleError(error) { - if (this._isDestroyed || !common.isFatalError(this._settings, error)) { - return; - } - this._isFatalError = true; - this._isDestroyed = true; - this._emitter.emit('error', error); - } - _handleEntry(entry, base) { - if (this._isDestroyed || this._isFatalError) { - return; - } - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._emitEntry(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); - } - } - _emitEntry(entry) { - this._emitter.emit('entry', entry); - } -} -exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts deleted file mode 100644 index 5985f97c402e5a92edf987d791821650c9b66f3b..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FilterFunction } from '../settings'; -import type Settings from '../settings'; -import type { Errno } from '../types'; -export declare function isFatalError(settings: Settings, error: Errno): boolean; -export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; -export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; -export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js deleted file mode 100644 index a93572f48a79ecd394339f6b27768a3b49332912..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/common.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; -function isFatalError(settings, error) { - if (settings.errorFilter === null) { - return true; - } - return !settings.errorFilter(error); -} -exports.isFatalError = isFatalError; -function isAppliedFilter(filter, value) { - return filter === null || filter(value); -} -exports.isAppliedFilter = isAppliedFilter; -function replacePathSegmentSeparator(filepath, separator) { - return filepath.split(/[/\\]/).join(separator); -} -exports.replacePathSegmentSeparator = replacePathSegmentSeparator; -function joinPathSegments(a, b, separator) { - if (a === '') { - return b; - } - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts deleted file mode 100644 index e1f383b25192216249d67456b437f7ea0ae5db24..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type Settings from '../settings'; -export default class Reader { - protected readonly _root: string; - protected readonly _settings: Settings; - constructor(_root: string, _settings: Settings); -} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js deleted file mode 100644 index 782f07cbfab62ff2469f26b2fc98050a38b21f27..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/reader.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const common = require("./common"); -class Reader { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); - } -} -exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts deleted file mode 100644 index af410335363f14e3d0bdd44054917e08c6ba57ad..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as fsScandir from '@nodelib/fs.scandir'; -import type { Entry } from '../types'; -import Reader from './reader'; -export default class SyncReader extends Reader { - protected readonly _scandir: typeof fsScandir.scandirSync; - private readonly _storage; - private readonly _queue; - read(): Entry[]; - private _pushToQueue; - private _handleQueue; - private _handleDirectory; - private _handleError; - private _handleEntry; - private _pushToStorage; -} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js deleted file mode 100644 index 9a8d5a6f1e18e826bc8930d03b5ef9e05b8738b3..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/sync.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fsScandir = require("@nodelib/fs.scandir"); -const common = require("./common"); -const reader_1 = require("./reader"); -class SyncReader extends reader_1.default { - constructor() { - super(...arguments); - this._scandir = fsScandir.scandirSync; - this._storage = []; - this._queue = new Set(); - } - read() { - this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return this._storage; - } - _pushToQueue(directory, base) { - this._queue.add({ directory, base }); - } - _handleQueue() { - for (const item of this._queue.values()) { - this._handleDirectory(item.directory, item.base); - } - } - _handleDirectory(directory, base) { - try { - const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { - this._handleEntry(entry, base); - } - } - catch (error) { - this._handleError(error); - } - } - _handleError(error) { - if (!common.isFatalError(this._settings, error)) { - return; - } - throw error; - } - _handleEntry(entry, base) { - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._pushToStorage(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); - } - } - _pushToStorage(entry) { - this._storage.push(entry); - } -} -exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts deleted file mode 100644 index d1c4b45f6b52bd167482312568a4ba7f4b9bba74..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/settings.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as fsScandir from '@nodelib/fs.scandir'; -import type { Entry, Errno } from './types'; -export declare type FilterFunction = (value: T) => boolean; -export declare type DeepFilterFunction = FilterFunction; -export declare type EntryFilterFunction = FilterFunction; -export declare type ErrorFilterFunction = FilterFunction; -export interface Options { - basePath?: string; - concurrency?: number; - deepFilter?: DeepFilterFunction; - entryFilter?: EntryFilterFunction; - errorFilter?: ErrorFilterFunction; - followSymbolicLinks?: boolean; - fs?: Partial; - pathSegmentSeparator?: string; - stats?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly basePath?: string; - readonly concurrency: number; - readonly deepFilter: DeepFilterFunction | null; - readonly entryFilter: EntryFilterFunction | null; - readonly errorFilter: ErrorFilterFunction | null; - readonly pathSegmentSeparator: string; - readonly fsScandirSettings: fsScandir.Settings; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js deleted file mode 100644 index d7a85c81eeecf8fd230e6fecedc9550bddb2ff93..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/settings.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsScandir = require("@nodelib/fs.scandir"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.basePath = this._getValue(this._options.basePath, undefined); - this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); - this.deepFilter = this._getValue(this._options.deepFilter, null); - this.entryFilter = this._getValue(this._options.entryFilter, null); - this.errorFilter = this._getValue(this._options.errorFilter, null); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.fsScandirSettings = new fsScandir.Settings({ - followSymbolicLinks: this._options.followSymbolicLinks, - fs: this._options.fs, - pathSegmentSeparator: this._options.pathSegmentSeparator, - stats: this._options.stats, - throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts deleted file mode 100644 index 6ee9bd3f9bf81ccaf9abde0f329e38b075344056..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import type * as scandir from '@nodelib/fs.scandir'; -export declare type Entry = scandir.Entry; -export declare type Errno = NodeJS.ErrnoException; -export interface QueueItem { - directory: string; - base?: string; -} diff --git a/node_modules/@nodelib/fs.walk/out/types/index.js b/node_modules/@nodelib/fs.walk/out/types/index.js deleted file mode 100644 index c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json deleted file mode 100644 index 86bfce48b59e41fa4985ac837c5ba8a9dacabe37..0000000000000000000000000000000000000000 --- a/node_modules/@nodelib/fs.walk/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@nodelib/fs.walk", - "version": "1.2.8", - "description": "A library for efficiently walking a directory recursively", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "walk", - "scanner", - "crawler" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*", - "!out/**/tests/**" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4" - }, - "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" -} diff --git a/node_modules/@pkgjs/parseargs/.editorconfig b/node_modules/@pkgjs/parseargs/.editorconfig deleted file mode 100644 index b1401639051d7cb6d9453bd87c9e6649ba518240..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Copied from Node.js to ease compatibility in PR. -[*] -charset = utf-8 -end_of_line = lf -indent_size = 2 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true -quote_type = single diff --git a/node_modules/@pkgjs/parseargs/CHANGELOG.md b/node_modules/@pkgjs/parseargs/CHANGELOG.md deleted file mode 100644 index 2adc7d3273d50d51625aa9d83ef3b672417f1677..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/CHANGELOG.md +++ /dev/null @@ -1,147 +0,0 @@ -# Changelog - -## [0.11.0](https://github.com/pkgjs/parseargs/compare/v0.10.0...v0.11.0) (2022-10-08) - - -### Features - -* add `default` option parameter ([#142](https://github.com/pkgjs/parseargs/issues/142)) ([cd20847](https://github.com/pkgjs/parseargs/commit/cd20847a00b2f556aa9c085ac83b942c60868ec1)) - -## [0.10.0](https://github.com/pkgjs/parseargs/compare/v0.9.1...v0.10.0) (2022-07-21) - - -### Features - -* add parsed meta-data to returned properties ([#129](https://github.com/pkgjs/parseargs/issues/129)) ([91bfb4d](https://github.com/pkgjs/parseargs/commit/91bfb4d3f7b6937efab1b27c91c45d1205f1497e)) - -## [0.9.1](https://github.com/pkgjs/parseargs/compare/v0.9.0...v0.9.1) (2022-06-20) - - -### Bug Fixes - -* **runtime:** support node 14+ ([#135](https://github.com/pkgjs/parseargs/issues/135)) ([6a1c5a6](https://github.com/pkgjs/parseargs/commit/6a1c5a6f7cadf2f035e004027e2742e3c4ce554b)) - -## [0.9.0](https://github.com/pkgjs/parseargs/compare/v0.8.0...v0.9.0) (2022-05-23) - - -### ⚠ BREAKING CHANGES - -* drop handling of electron arguments (#121) - -### Code Refactoring - -* drop handling of electron arguments ([#121](https://github.com/pkgjs/parseargs/issues/121)) ([a2ffd53](https://github.com/pkgjs/parseargs/commit/a2ffd537c244a062371522b955acb45a404fc9f2)) - -## [0.8.0](https://github.com/pkgjs/parseargs/compare/v0.7.1...v0.8.0) (2022-05-16) - - -### ⚠ BREAKING CHANGES - -* switch type:string option arguments to greedy, but with error for suspect cases in strict mode (#88) -* positionals now opt-in when strict:true (#116) -* create result.values with null prototype (#111) - -### Features - -* create result.values with null prototype ([#111](https://github.com/pkgjs/parseargs/issues/111)) ([9d539c3](https://github.com/pkgjs/parseargs/commit/9d539c3d57f269c160e74e0656ad4fa84ff92ec2)) -* positionals now opt-in when strict:true ([#116](https://github.com/pkgjs/parseargs/issues/116)) ([3643338](https://github.com/pkgjs/parseargs/commit/364333826b746e8a7dc5505b4b22fd19ac51df3b)) -* switch type:string option arguments to greedy, but with error for suspect cases in strict mode ([#88](https://github.com/pkgjs/parseargs/issues/88)) ([c2b5e72](https://github.com/pkgjs/parseargs/commit/c2b5e72161991dfdc535909f1327cc9b970fe7e8)) - -### [0.7.1](https://github.com/pkgjs/parseargs/compare/v0.7.0...v0.7.1) (2022-04-15) - - -### Bug Fixes - -* resist pollution ([#106](https://github.com/pkgjs/parseargs/issues/106)) ([ecf2dec](https://github.com/pkgjs/parseargs/commit/ecf2dece0a9f2a76d789384d5d71c68ffe64022a)) - -## [0.7.0](https://github.com/pkgjs/parseargs/compare/v0.6.0...v0.7.0) (2022-04-13) - - -### Features - -* Add strict mode to parser ([#74](https://github.com/pkgjs/parseargs/issues/74)) ([8267d02](https://github.com/pkgjs/parseargs/commit/8267d02083a87b8b8a71fcce08348d1e031ea91c)) - -## [0.6.0](https://github.com/pkgjs/parseargs/compare/v0.5.0...v0.6.0) (2022-04-11) - - -### ⚠ BREAKING CHANGES - -* rework results to remove redundant `flags` property and store value true for boolean options (#83) -* switch to existing ERR_INVALID_ARG_VALUE (#97) - -### Code Refactoring - -* rework results to remove redundant `flags` property and store value true for boolean options ([#83](https://github.com/pkgjs/parseargs/issues/83)) ([be153db](https://github.com/pkgjs/parseargs/commit/be153dbed1d488cb7b6e27df92f601ba7337713d)) -* switch to existing ERR_INVALID_ARG_VALUE ([#97](https://github.com/pkgjs/parseargs/issues/97)) ([084a23f](https://github.com/pkgjs/parseargs/commit/084a23f9fde2da030b159edb1c2385f24579ce40)) - -## [0.5.0](https://github.com/pkgjs/parseargs/compare/v0.4.0...v0.5.0) (2022-04-10) - - -### ⚠ BREAKING CHANGES - -* Require type to be specified for each supplied option (#95) - -### Features - -* Require type to be specified for each supplied option ([#95](https://github.com/pkgjs/parseargs/issues/95)) ([02cd018](https://github.com/pkgjs/parseargs/commit/02cd01885b8aaa59f2db8308f2d4479e64340068)) - -## [0.4.0](https://github.com/pkgjs/parseargs/compare/v0.3.0...v0.4.0) (2022-03-12) - - -### ⚠ BREAKING CHANGES - -* parsing, revisit short option groups, add support for combined short and value (#75) -* restructure configuration to take options bag (#63) - -### Code Refactoring - -* parsing, revisit short option groups, add support for combined short and value ([#75](https://github.com/pkgjs/parseargs/issues/75)) ([a92600f](https://github.com/pkgjs/parseargs/commit/a92600fa6c214508ab1e016fa55879a314f541af)) -* restructure configuration to take options bag ([#63](https://github.com/pkgjs/parseargs/issues/63)) ([b412095](https://github.com/pkgjs/parseargs/commit/b4120957d90e809ee8b607b06e747d3e6a6b213e)) - -## [0.3.0](https://github.com/pkgjs/parseargs/compare/v0.2.0...v0.3.0) (2022-02-06) - - -### Features - -* **parser:** support short-option groups ([#59](https://github.com/pkgjs/parseargs/issues/59)) ([882067b](https://github.com/pkgjs/parseargs/commit/882067bc2d7cbc6b796f8e5a079a99bc99d4e6ba)) - -## [0.2.0](https://github.com/pkgjs/parseargs/compare/v0.1.1...v0.2.0) (2022-02-05) - - -### Features - -* basic support for shorts ([#50](https://github.com/pkgjs/parseargs/issues/50)) ([a2f36d7](https://github.com/pkgjs/parseargs/commit/a2f36d7da4145af1c92f76806b7fe2baf6beeceb)) - - -### Bug Fixes - -* always store value for a=b ([#43](https://github.com/pkgjs/parseargs/issues/43)) ([a85e8dc](https://github.com/pkgjs/parseargs/commit/a85e8dc06379fd2696ee195cc625de8fac6aee42)) -* support single dash as positional ([#49](https://github.com/pkgjs/parseargs/issues/49)) ([d795bf8](https://github.com/pkgjs/parseargs/commit/d795bf877d068fd67aec381f30b30b63f97109ad)) - -### [0.1.1](https://github.com/pkgjs/parseargs/compare/v0.1.0...v0.1.1) (2022-01-25) - - -### Bug Fixes - -* only use arrays in results for multiples ([#42](https://github.com/pkgjs/parseargs/issues/42)) ([c357584](https://github.com/pkgjs/parseargs/commit/c357584847912506319ed34a0840080116f4fd65)) - -## 0.1.0 (2022-01-22) - - -### Features - -* expand scenarios covered by default arguments for environments ([#20](https://github.com/pkgjs/parseargs/issues/20)) ([582ada7](https://github.com/pkgjs/parseargs/commit/582ada7be0eca3a73d6e0bd016e7ace43449fa4c)) -* update readme and include contributing guidelines ([8edd6fc](https://github.com/pkgjs/parseargs/commit/8edd6fc863cd705f6fac732724159ebe8065a2b0)) - - -### Bug Fixes - -* do not strip excess leading dashes on long option names ([#21](https://github.com/pkgjs/parseargs/issues/21)) ([f848590](https://github.com/pkgjs/parseargs/commit/f848590ebf3249ed5979ff47e003fa6e1a8ec5c0)) -* name & readme ([3f057c1](https://github.com/pkgjs/parseargs/commit/3f057c1b158a1bdbe878c64b57460c58e56e465f)) -* package.json values ([9bac300](https://github.com/pkgjs/parseargs/commit/9bac300e00cd76c77076bf9e75e44f8929512da9)) -* update readme name ([957d8d9](https://github.com/pkgjs/parseargs/commit/957d8d96e1dcb48297c0a14345d44c0123b2883e)) - - -### Build System - -* first release as minor ([421c6e2](https://github.com/pkgjs/parseargs/commit/421c6e2569a8668ad14fac5a5af5be60479a7571)) diff --git a/node_modules/@pkgjs/parseargs/LICENSE b/node_modules/@pkgjs/parseargs/LICENSE deleted file mode 100644 index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/@pkgjs/parseargs/README.md b/node_modules/@pkgjs/parseargs/README.md deleted file mode 100644 index 0a041927e8b90ced15a56f9ac841afcbe72d8453..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/README.md +++ /dev/null @@ -1,413 +0,0 @@ - -# parseArgs - -[![Coverage][coverage-image]][coverage-url] - -Polyfill of `util.parseArgs()` - -## `util.parseArgs([config])` - - - -> Stability: 1 - Experimental - -* `config` {Object} Used to provide arguments for parsing and to configure - the parser. `config` supports the following properties: - * `args` {string\[]} array of argument strings. **Default:** `process.argv` - with `execPath` and `filename` removed. - * `options` {Object} Used to describe arguments known to the parser. - Keys of `options` are the long names of options and values are an - {Object} accepting the following properties: - * `type` {string} Type of argument, which must be either `boolean` or `string`. - * `multiple` {boolean} Whether this option can be provided multiple - times. If `true`, all values will be collected in an array. If - `false`, values for the option are last-wins. **Default:** `false`. - * `short` {string} A single character alias for the option. - * `default` {string | boolean | string\[] | boolean\[]} The default option - value when it is not set by args. It must be of the same type as the - the `type` property. When `multiple` is `true`, it must be an array. - * `strict` {boolean} Should an error be thrown when unknown arguments - are encountered, or when arguments are passed that do not match the - `type` configured in `options`. - **Default:** `true`. - * `allowPositionals` {boolean} Whether this command accepts positional - arguments. - **Default:** `false` if `strict` is `true`, otherwise `true`. - * `tokens` {boolean} Return the parsed tokens. This is useful for extending - the built-in behavior, from adding additional checks through to reprocessing - the tokens in different ways. - **Default:** `false`. - -* Returns: {Object} The parsed command line arguments: - * `values` {Object} A mapping of parsed option names with their {string} - or {boolean} values. - * `positionals` {string\[]} Positional arguments. - * `tokens` {Object\[] | undefined} See [parseArgs tokens](#parseargs-tokens) - section. Only returned if `config` includes `tokens: true`. - -Provides a higher level API for command-line argument parsing than interacting -with `process.argv` directly. Takes a specification for the expected arguments -and returns a structured object with the parsed options and positionals. - -```mjs -import { parseArgs } from 'node:util'; -const args = ['-f', '--bar', 'b']; -const options = { - foo: { - type: 'boolean', - short: 'f' - }, - bar: { - type: 'string' - } -}; -const { - values, - positionals -} = parseArgs({ args, options }); -console.log(values, positionals); -// Prints: [Object: null prototype] { foo: true, bar: 'b' } [] -``` - -```cjs -const { parseArgs } = require('node:util'); -const args = ['-f', '--bar', 'b']; -const options = { - foo: { - type: 'boolean', - short: 'f' - }, - bar: { - type: 'string' - } -}; -const { - values, - positionals -} = parseArgs({ args, options }); -console.log(values, positionals); -// Prints: [Object: null prototype] { foo: true, bar: 'b' } [] -``` - -`util.parseArgs` is experimental and behavior may change. Join the -conversation in [pkgjs/parseargs][] to contribute to the design. - -### `parseArgs` `tokens` - -Detailed parse information is available for adding custom behaviours by -specifying `tokens: true` in the configuration. -The returned tokens have properties describing: - -* all tokens - * `kind` {string} One of 'option', 'positional', or 'option-terminator'. - * `index` {number} Index of element in `args` containing token. So the - source argument for a token is `args[token.index]`. -* option tokens - * `name` {string} Long name of option. - * `rawName` {string} How option used in args, like `-f` of `--foo`. - * `value` {string | undefined} Option value specified in args. - Undefined for boolean options. - * `inlineValue` {boolean | undefined} Whether option value specified inline, - like `--foo=bar`. -* positional tokens - * `value` {string} The value of the positional argument in args (i.e. `args[index]`). -* option-terminator token - -The returned tokens are in the order encountered in the input args. Options -that appear more than once in args produce a token for each use. Short option -groups like `-xy` expand to a token for each option. So `-xxx` produces -three tokens. - -For example to use the returned tokens to add support for a negated option -like `--no-color`, the tokens can be reprocessed to change the value stored -for the negated option. - -```mjs -import { parseArgs } from 'node:util'; - -const options = { - 'color': { type: 'boolean' }, - 'no-color': { type: 'boolean' }, - 'logfile': { type: 'string' }, - 'no-logfile': { type: 'boolean' }, -}; -const { values, tokens } = parseArgs({ options, tokens: true }); - -// Reprocess the option tokens and overwrite the returned values. -tokens - .filter((token) => token.kind === 'option') - .forEach((token) => { - if (token.name.startsWith('no-')) { - // Store foo:false for --no-foo - const positiveName = token.name.slice(3); - values[positiveName] = false; - delete values[token.name]; - } else { - // Resave value so last one wins if both --foo and --no-foo. - values[token.name] = token.value ?? true; - } - }); - -const color = values.color; -const logfile = values.logfile ?? 'default.log'; - -console.log({ logfile, color }); -``` - -```cjs -const { parseArgs } = require('node:util'); - -const options = { - 'color': { type: 'boolean' }, - 'no-color': { type: 'boolean' }, - 'logfile': { type: 'string' }, - 'no-logfile': { type: 'boolean' }, -}; -const { values, tokens } = parseArgs({ options, tokens: true }); - -// Reprocess the option tokens and overwrite the returned values. -tokens - .filter((token) => token.kind === 'option') - .forEach((token) => { - if (token.name.startsWith('no-')) { - // Store foo:false for --no-foo - const positiveName = token.name.slice(3); - values[positiveName] = false; - delete values[token.name]; - } else { - // Resave value so last one wins if both --foo and --no-foo. - values[token.name] = token.value ?? true; - } - }); - -const color = values.color; -const logfile = values.logfile ?? 'default.log'; - -console.log({ logfile, color }); -``` - -Example usage showing negated options, and when an option is used -multiple ways then last one wins. - -```console -$ node negate.js -{ logfile: 'default.log', color: undefined } -$ node negate.js --no-logfile --no-color -{ logfile: false, color: false } -$ node negate.js --logfile=test.log --color -{ logfile: 'test.log', color: true } -$ node negate.js --no-logfile --logfile=test.log --color --no-color -{ logfile: 'test.log', color: false } -``` - ------ - - -## Table of Contents -- [`util.parseArgs([config])`](#utilparseargsconfig) -- [Scope](#scope) -- [Version Matchups](#version-matchups) -- [🚀 Getting Started](#-getting-started) -- [🙌 Contributing](#-contributing) -- [💡 `process.mainArgs` Proposal](#-processmainargs-proposal) - - [Implementation:](#implementation) -- [📃 Examples](#-examples) -- [F.A.Qs](#faqs) -- [Links & Resources](#links--resources) - ------ - -## Scope - -It is already possible to build great arg parsing modules on top of what Node.js provides; the prickly API is abstracted away by these modules. Thus, process.parseArgs() is not necessarily intended for library authors; it is intended for developers of simple CLI tools, ad-hoc scripts, deployed Node.js applications, and learning materials. - -It is exceedingly difficult to provide an API which would both be friendly to these Node.js users while being extensible enough for libraries to build upon. We chose to prioritize these use cases because these are currently not well-served by Node.js' API. - ----- - -## Version Matchups - -| Node.js | @pkgjs/parseArgs | -| -- | -- | -| [v18.3.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [v0.9.1](https://github.com/pkgjs/parseargs/tree/v0.9.1#utilparseargsconfig) | -| [v16.17.0](https://nodejs.org/dist/latest-v16.x/docs/api/util.html#utilparseargsconfig), [v18.7.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [0.10.0](https://github.com/pkgjs/parseargs/tree/v0.10.0#utilparseargsconfig) | - ----- - -## 🚀 Getting Started - -1. **Install dependencies.** - - ```bash - npm install - ``` - -2. **Open the index.js file and start editing!** - -3. **Test your code by calling parseArgs through our test file** - - ```bash - npm test - ``` - ----- - -## 🙌 Contributing - -Any person who wants to contribute to the initiative is welcome! Please first read the [Contributing Guide](CONTRIBUTING.md) - -Additionally, reading the [`Examples w/ Output`](#-examples-w-output) section of this document will be the best way to familiarize yourself with the target expected behavior for parseArgs() once it is fully implemented. - -This package was implemented using [tape](https://www.npmjs.com/package/tape) as its test harness. - ----- - -## 💡 `process.mainArgs` Proposal - -> Note: This can be moved forward independently of the `util.parseArgs()` proposal/work. - -### Implementation: - -```javascript -process.mainArgs = process.argv.slice(process._exec ? 1 : 2) -``` - ----- - -## 📃 Examples - -```js -const { parseArgs } = require('@pkgjs/parseargs'); -``` - -```js -const { parseArgs } = require('@pkgjs/parseargs'); -// specify the options that may be used -const options = { - foo: { type: 'string'}, - bar: { type: 'boolean' }, -}; -const args = ['--foo=a', '--bar']; -const { values, positionals } = parseArgs({ args, options }); -// values = { foo: 'a', bar: true } -// positionals = [] -``` - -```js -const { parseArgs } = require('@pkgjs/parseargs'); -// type:string & multiple -const options = { - foo: { - type: 'string', - multiple: true, - }, -}; -const args = ['--foo=a', '--foo', 'b']; -const { values, positionals } = parseArgs({ args, options }); -// values = { foo: [ 'a', 'b' ] } -// positionals = [] -``` - -```js -const { parseArgs } = require('@pkgjs/parseargs'); -// shorts -const options = { - foo: { - short: 'f', - type: 'boolean' - }, -}; -const args = ['-f', 'b']; -const { values, positionals } = parseArgs({ args, options, allowPositionals: true }); -// values = { foo: true } -// positionals = ['b'] -``` - -```js -const { parseArgs } = require('@pkgjs/parseargs'); -// unconfigured -const options = {}; -const args = ['-f', '--foo=a', '--bar', 'b']; -const { values, positionals } = parseArgs({ strict: false, args, options, allowPositionals: true }); -// values = { f: true, foo: 'a', bar: true } -// positionals = ['b'] -``` - ----- - -## F.A.Qs - -- Is `cmd --foo=bar baz` the same as `cmd baz --foo=bar`? - - yes -- Does the parser execute a function? - - no -- Does the parser execute one of several functions, depending on input? - - no -- Can subcommands take options that are distinct from the main command? - - no -- Does it output generated help when no options match? - - no -- Does it generated short usage? Like: `usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]` - - no (no usage/help at all) -- Does the user provide the long usage text? For each option? For the whole command? - - no -- Do subcommands (if implemented) have their own usage output? - - no -- Does usage print if the user runs `cmd --help`? - - no -- Does it set `process.exitCode`? - - no -- Does usage print to stderr or stdout? - - N/A -- Does it check types? (Say, specify that an option is a boolean, number, etc.) - - no -- Can an option have more than one type? (string or false, for example) - - no -- Can the user define a type? (Say, `type: path` to call `path.resolve()` on the argument.) - - no -- Does a `--foo=0o22` mean 0, 22, 18, or "0o22"? - - `"0o22"` -- Does it coerce types? - - no -- Does `--no-foo` coerce to `--foo=false`? For all options? Only boolean options? - - no, it sets `{values:{'no-foo': true}}` -- Is `--foo` the same as `--foo=true`? Only for known booleans? Only at the end? - - no, they are not the same. There is no special handling of `true` as a value so it is just another string. -- Does it read environment variables? Ie, is `FOO=1 cmd` the same as `cmd --foo=1`? - - no -- Do unknown arguments raise an error? Are they parsed? Are they treated as positional arguments? - - no, they are parsed, not treated as positionals -- Does `--` signal the end of options? - - yes -- Is `--` included as a positional? - - no -- Is `program -- foo` the same as `program foo`? - - yes, both store `{positionals:['foo']}` -- Does the API specify whether a `--` was present/relevant? - - no -- Is `-bar` the same as `--bar`? - - no, `-bar` is a short option or options, with expansion logic that follows the - [Utility Syntax Guidelines in POSIX.1-2017](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html). `-bar` expands to `-b`, `-a`, `-r`. -- Is `---foo` the same as `--foo`? - - no - - the first is a long option named `'-foo'` - - the second is a long option named `'foo'` -- Is `-` a positional? ie, `bash some-test.sh | tap -` - - yes - -## Links & Resources - -* [Initial Tooling Issue](https://github.com/nodejs/tooling/issues/19) -* [Initial Proposal](https://github.com/nodejs/node/pull/35015) -* [parseArgs Proposal](https://github.com/nodejs/node/pull/42675) - -[coverage-image]: https://img.shields.io/nycrc/pkgjs/parseargs -[coverage-url]: https://github.com/pkgjs/parseargs/blob/main/.nycrc -[pkgjs/parseargs]: https://github.com/pkgjs/parseargs diff --git a/node_modules/@pkgjs/parseargs/examples/is-default-value.js b/node_modules/@pkgjs/parseargs/examples/is-default-value.js deleted file mode 100644 index 0a67972b71d135a4b75953d2fe2b43bf9a0c585e..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/examples/is-default-value.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -// This example shows how to understand if a default value is used or not. - -// 1. const { parseArgs } = require('node:util'); // from node -// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package -const { parseArgs } = require('..'); // in repo - -const options = { - file: { short: 'f', type: 'string', default: 'FOO' }, -}; - -const { values, tokens } = parseArgs({ options, tokens: true }); - -const isFileDefault = !tokens.some((token) => token.kind === 'option' && - token.name === 'file' -); - -console.log(values); -console.log(`Is the file option [${values.file}] the default value? ${isFileDefault}`); - -// Try the following: -// node is-default-value.js -// node is-default-value.js -f FILE -// node is-default-value.js --file FILE diff --git a/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js b/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js deleted file mode 100644 index 943e643ee9553b3877b6b7ed58e69dcb9e94fb39..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -// This is an example of using tokens to add a custom behaviour. -// -// Require the use of `=` for long options and values by blocking -// the use of space separated values. -// So allow `--foo=bar`, and not allow `--foo bar`. -// -// Note: this is not a common behaviour, most CLIs allow both forms. - -// 1. const { parseArgs } = require('node:util'); // from node -// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package -const { parseArgs } = require('..'); // in repo - -const options = { - file: { short: 'f', type: 'string' }, - log: { type: 'string' }, -}; - -const { values, tokens } = parseArgs({ options, tokens: true }); - -const badToken = tokens.find((token) => token.kind === 'option' && - token.value != null && - token.rawName.startsWith('--') && - !token.inlineValue -); -if (badToken) { - throw new Error(`Option value for '${badToken.rawName}' must be inline, like '${badToken.rawName}=VALUE'`); -} - -console.log(values); - -// Try the following: -// node limit-long-syntax.js -f FILE --log=LOG -// node limit-long-syntax.js --file FILE diff --git a/node_modules/@pkgjs/parseargs/examples/negate.js b/node_modules/@pkgjs/parseargs/examples/negate.js deleted file mode 100644 index b6634690a4a0c03d4c50239bc16fa38440dea5ae..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/examples/negate.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -// This example is used in the documentation. - -// How might I add my own support for --no-foo? - -// 1. const { parseArgs } = require('node:util'); // from node -// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package -const { parseArgs } = require('..'); // in repo - -const options = { - 'color': { type: 'boolean' }, - 'no-color': { type: 'boolean' }, - 'logfile': { type: 'string' }, - 'no-logfile': { type: 'boolean' }, -}; -const { values, tokens } = parseArgs({ options, tokens: true }); - -// Reprocess the option tokens and overwrite the returned values. -tokens - .filter((token) => token.kind === 'option') - .forEach((token) => { - if (token.name.startsWith('no-')) { - // Store foo:false for --no-foo - const positiveName = token.name.slice(3); - values[positiveName] = false; - delete values[token.name]; - } else { - // Resave value so last one wins if both --foo and --no-foo. - values[token.name] = token.value ?? true; - } - }); - -const color = values.color; -const logfile = values.logfile ?? 'default.log'; - -console.log({ logfile, color }); - -// Try the following: -// node negate.js -// node negate.js --no-logfile --no-color -// negate.js --logfile=test.log --color -// node negate.js --no-logfile --logfile=test.log --color --no-color diff --git a/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js b/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js deleted file mode 100644 index 0c324688af03058fcd0a8b0b5dbdcb188e902f50..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -// This is an example of using tokens to add a custom behaviour. -// -// Throw an error if an option is used more than once. - -// 1. const { parseArgs } = require('node:util'); // from node -// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package -const { parseArgs } = require('..'); // in repo - -const options = { - ding: { type: 'boolean', short: 'd' }, - beep: { type: 'boolean', short: 'b' } -}; -const { values, tokens } = parseArgs({ options, tokens: true }); - -const seenBefore = new Set(); -tokens.forEach((token) => { - if (token.kind !== 'option') return; - if (seenBefore.has(token.name)) { - throw new Error(`option '${token.name}' used multiple times`); - } - seenBefore.add(token.name); -}); - -console.log(values); - -// Try the following: -// node no-repeated-options --ding --beep -// node no-repeated-options --beep -b -// node no-repeated-options -ddd diff --git a/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs b/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs deleted file mode 100644 index 8ab7367b8bbb1120db7fc9f9365353af0ab9377e..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs +++ /dev/null @@ -1,41 +0,0 @@ -// This is an example of using tokens to add a custom behaviour. -// -// This adds a option order check so that --some-unstable-option -// may only be used after --enable-experimental-options -// -// Note: this is not a common behaviour, the order of different options -// does not usually matter. - -import { parseArgs } from '../index.js'; - -function findTokenIndex(tokens, target) { - return tokens.findIndex((token) => token.kind === 'option' && - token.name === target - ); -} - -const experimentalName = 'enable-experimental-options'; -const unstableName = 'some-unstable-option'; - -const options = { - [experimentalName]: { type: 'boolean' }, - [unstableName]: { type: 'boolean' }, -}; - -const { values, tokens } = parseArgs({ options, tokens: true }); - -const experimentalIndex = findTokenIndex(tokens, experimentalName); -const unstableIndex = findTokenIndex(tokens, unstableName); -if (unstableIndex !== -1 && - ((experimentalIndex === -1) || (unstableIndex < experimentalIndex))) { - throw new Error(`'--${experimentalName}' must be specified before '--${unstableName}'`); -} - -console.log(values); - -/* eslint-disable max-len */ -// Try the following: -// node ordered-options.mjs -// node ordered-options.mjs --some-unstable-option -// node ordered-options.mjs --some-unstable-option --enable-experimental-options -// node ordered-options.mjs --enable-experimental-options --some-unstable-option diff --git a/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js b/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js deleted file mode 100644 index eff04c2a60fa21dffb1b293c27068d0a0af3c963..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -// This example is used in the documentation. - -// 1. const { parseArgs } = require('node:util'); // from node -// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package -const { parseArgs } = require('..'); // in repo - -const args = ['-f', '--bar', 'b']; -const options = { - foo: { - type: 'boolean', - short: 'f' - }, - bar: { - type: 'string' - } -}; -const { - values, - positionals -} = parseArgs({ args, options }); -console.log(values, positionals); - -// Try the following: -// node simple-hard-coded.js diff --git a/node_modules/@pkgjs/parseargs/index.js b/node_modules/@pkgjs/parseargs/index.js deleted file mode 100644 index b1004c7b72f271f4f529b1597d643a9272e3cf06..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/index.js +++ /dev/null @@ -1,396 +0,0 @@ -'use strict'; - -const { - ArrayPrototypeForEach, - ArrayPrototypeIncludes, - ArrayPrototypeMap, - ArrayPrototypePush, - ArrayPrototypePushApply, - ArrayPrototypeShift, - ArrayPrototypeSlice, - ArrayPrototypeUnshiftApply, - ObjectEntries, - ObjectPrototypeHasOwnProperty: ObjectHasOwn, - StringPrototypeCharAt, - StringPrototypeIndexOf, - StringPrototypeSlice, - StringPrototypeStartsWith, -} = require('./internal/primordials'); - -const { - validateArray, - validateBoolean, - validateBooleanArray, - validateObject, - validateString, - validateStringArray, - validateUnion, -} = require('./internal/validators'); - -const { - kEmptyObject, -} = require('./internal/util'); - -const { - findLongOptionForShort, - isLoneLongOption, - isLoneShortOption, - isLongOptionAndValue, - isOptionValue, - isOptionLikeValue, - isShortOptionAndValue, - isShortOptionGroup, - useDefaultValueOption, - objectGetOwn, - optionsGetOwn, -} = require('./utils'); - -const { - codes: { - ERR_INVALID_ARG_VALUE, - ERR_PARSE_ARGS_INVALID_OPTION_VALUE, - ERR_PARSE_ARGS_UNKNOWN_OPTION, - ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, - }, -} = require('./internal/errors'); - -function getMainArgs() { - // Work out where to slice process.argv for user supplied arguments. - - // Check node options for scenarios where user CLI args follow executable. - const execArgv = process.execArgv; - if (ArrayPrototypeIncludes(execArgv, '-e') || - ArrayPrototypeIncludes(execArgv, '--eval') || - ArrayPrototypeIncludes(execArgv, '-p') || - ArrayPrototypeIncludes(execArgv, '--print')) { - return ArrayPrototypeSlice(process.argv, 1); - } - - // Normally first two arguments are executable and script, then CLI arguments - return ArrayPrototypeSlice(process.argv, 2); -} - -/** - * In strict mode, throw for possible usage errors like --foo --bar - * - * @param {object} token - from tokens as available from parseArgs - */ -function checkOptionLikeValue(token) { - if (!token.inlineValue && isOptionLikeValue(token.value)) { - // Only show short example if user used short option. - const example = StringPrototypeStartsWith(token.rawName, '--') ? - `'${token.rawName}=-XYZ'` : - `'--${token.name}=-XYZ' or '${token.rawName}-XYZ'`; - const errorMessage = `Option '${token.rawName}' argument is ambiguous. -Did you forget to specify the option argument for '${token.rawName}'? -To specify an option argument starting with a dash use ${example}.`; - throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(errorMessage); - } -} - -/** - * In strict mode, throw for usage errors. - * - * @param {object} config - from config passed to parseArgs - * @param {object} token - from tokens as available from parseArgs - */ -function checkOptionUsage(config, token) { - if (!ObjectHasOwn(config.options, token.name)) { - throw new ERR_PARSE_ARGS_UNKNOWN_OPTION( - token.rawName, config.allowPositionals); - } - - const short = optionsGetOwn(config.options, token.name, 'short'); - const shortAndLong = `${short ? `-${short}, ` : ''}--${token.name}`; - const type = optionsGetOwn(config.options, token.name, 'type'); - if (type === 'string' && typeof token.value !== 'string') { - throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(`Option '${shortAndLong} ' argument missing`); - } - // (Idiomatic test for undefined||null, expecting undefined.) - if (type === 'boolean' && token.value != null) { - throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(`Option '${shortAndLong}' does not take an argument`); - } -} - - -/** - * Store the option value in `values`. - * - * @param {string} longOption - long option name e.g. 'foo' - * @param {string|undefined} optionValue - value from user args - * @param {object} options - option configs, from parseArgs({ options }) - * @param {object} values - option values returned in `values` by parseArgs - */ -function storeOption(longOption, optionValue, options, values) { - if (longOption === '__proto__') { - return; // No. Just no. - } - - // We store based on the option value rather than option type, - // preserving the users intent for author to deal with. - const newValue = optionValue ?? true; - if (optionsGetOwn(options, longOption, 'multiple')) { - // Always store value in array, including for boolean. - // values[longOption] starts out not present, - // first value is added as new array [newValue], - // subsequent values are pushed to existing array. - // (note: values has null prototype, so simpler usage) - if (values[longOption]) { - ArrayPrototypePush(values[longOption], newValue); - } else { - values[longOption] = [newValue]; - } - } else { - values[longOption] = newValue; - } -} - -/** - * Store the default option value in `values`. - * - * @param {string} longOption - long option name e.g. 'foo' - * @param {string - * | boolean - * | string[] - * | boolean[]} optionValue - default value from option config - * @param {object} values - option values returned in `values` by parseArgs - */ -function storeDefaultOption(longOption, optionValue, values) { - if (longOption === '__proto__') { - return; // No. Just no. - } - - values[longOption] = optionValue; -} - -/** - * Process args and turn into identified tokens: - * - option (along with value, if any) - * - positional - * - option-terminator - * - * @param {string[]} args - from parseArgs({ args }) or mainArgs - * @param {object} options - option configs, from parseArgs({ options }) - */ -function argsToTokens(args, options) { - const tokens = []; - let index = -1; - let groupCount = 0; - - const remainingArgs = ArrayPrototypeSlice(args); - while (remainingArgs.length > 0) { - const arg = ArrayPrototypeShift(remainingArgs); - const nextArg = remainingArgs[0]; - if (groupCount > 0) - groupCount--; - else - index++; - - // Check if `arg` is an options terminator. - // Guideline 10 in https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html - if (arg === '--') { - // Everything after a bare '--' is considered a positional argument. - ArrayPrototypePush(tokens, { kind: 'option-terminator', index }); - ArrayPrototypePushApply( - tokens, ArrayPrototypeMap(remainingArgs, (arg) => { - return { kind: 'positional', index: ++index, value: arg }; - }) - ); - break; // Finished processing args, leave while loop. - } - - if (isLoneShortOption(arg)) { - // e.g. '-f' - const shortOption = StringPrototypeCharAt(arg, 1); - const longOption = findLongOptionForShort(shortOption, options); - let value; - let inlineValue; - if (optionsGetOwn(options, longOption, 'type') === 'string' && - isOptionValue(nextArg)) { - // e.g. '-f', 'bar' - value = ArrayPrototypeShift(remainingArgs); - inlineValue = false; - } - ArrayPrototypePush( - tokens, - { kind: 'option', name: longOption, rawName: arg, - index, value, inlineValue }); - if (value != null) ++index; - continue; - } - - if (isShortOptionGroup(arg, options)) { - // Expand -fXzy to -f -X -z -y - const expanded = []; - for (let index = 1; index < arg.length; index++) { - const shortOption = StringPrototypeCharAt(arg, index); - const longOption = findLongOptionForShort(shortOption, options); - if (optionsGetOwn(options, longOption, 'type') !== 'string' || - index === arg.length - 1) { - // Boolean option, or last short in group. Well formed. - ArrayPrototypePush(expanded, `-${shortOption}`); - } else { - // String option in middle. Yuck. - // Expand -abfFILE to -a -b -fFILE - ArrayPrototypePush(expanded, `-${StringPrototypeSlice(arg, index)}`); - break; // finished short group - } - } - ArrayPrototypeUnshiftApply(remainingArgs, expanded); - groupCount = expanded.length; - continue; - } - - if (isShortOptionAndValue(arg, options)) { - // e.g. -fFILE - const shortOption = StringPrototypeCharAt(arg, 1); - const longOption = findLongOptionForShort(shortOption, options); - const value = StringPrototypeSlice(arg, 2); - ArrayPrototypePush( - tokens, - { kind: 'option', name: longOption, rawName: `-${shortOption}`, - index, value, inlineValue: true }); - continue; - } - - if (isLoneLongOption(arg)) { - // e.g. '--foo' - const longOption = StringPrototypeSlice(arg, 2); - let value; - let inlineValue; - if (optionsGetOwn(options, longOption, 'type') === 'string' && - isOptionValue(nextArg)) { - // e.g. '--foo', 'bar' - value = ArrayPrototypeShift(remainingArgs); - inlineValue = false; - } - ArrayPrototypePush( - tokens, - { kind: 'option', name: longOption, rawName: arg, - index, value, inlineValue }); - if (value != null) ++index; - continue; - } - - if (isLongOptionAndValue(arg)) { - // e.g. --foo=bar - const equalIndex = StringPrototypeIndexOf(arg, '='); - const longOption = StringPrototypeSlice(arg, 2, equalIndex); - const value = StringPrototypeSlice(arg, equalIndex + 1); - ArrayPrototypePush( - tokens, - { kind: 'option', name: longOption, rawName: `--${longOption}`, - index, value, inlineValue: true }); - continue; - } - - ArrayPrototypePush(tokens, { kind: 'positional', index, value: arg }); - } - - return tokens; -} - -const parseArgs = (config = kEmptyObject) => { - const args = objectGetOwn(config, 'args') ?? getMainArgs(); - const strict = objectGetOwn(config, 'strict') ?? true; - const allowPositionals = objectGetOwn(config, 'allowPositionals') ?? !strict; - const returnTokens = objectGetOwn(config, 'tokens') ?? false; - const options = objectGetOwn(config, 'options') ?? { __proto__: null }; - // Bundle these up for passing to strict-mode checks. - const parseConfig = { args, strict, options, allowPositionals }; - - // Validate input configuration. - validateArray(args, 'args'); - validateBoolean(strict, 'strict'); - validateBoolean(allowPositionals, 'allowPositionals'); - validateBoolean(returnTokens, 'tokens'); - validateObject(options, 'options'); - ArrayPrototypeForEach( - ObjectEntries(options), - ({ 0: longOption, 1: optionConfig }) => { - validateObject(optionConfig, `options.${longOption}`); - - // type is required - const optionType = objectGetOwn(optionConfig, 'type'); - validateUnion(optionType, `options.${longOption}.type`, ['string', 'boolean']); - - if (ObjectHasOwn(optionConfig, 'short')) { - const shortOption = optionConfig.short; - validateString(shortOption, `options.${longOption}.short`); - if (shortOption.length !== 1) { - throw new ERR_INVALID_ARG_VALUE( - `options.${longOption}.short`, - shortOption, - 'must be a single character' - ); - } - } - - const multipleOption = objectGetOwn(optionConfig, 'multiple'); - if (ObjectHasOwn(optionConfig, 'multiple')) { - validateBoolean(multipleOption, `options.${longOption}.multiple`); - } - - const defaultValue = objectGetOwn(optionConfig, 'default'); - if (defaultValue !== undefined) { - let validator; - switch (optionType) { - case 'string': - validator = multipleOption ? validateStringArray : validateString; - break; - - case 'boolean': - validator = multipleOption ? validateBooleanArray : validateBoolean; - break; - } - validator(defaultValue, `options.${longOption}.default`); - } - } - ); - - // Phase 1: identify tokens - const tokens = argsToTokens(args, options); - - // Phase 2: process tokens into parsed option values and positionals - const result = { - values: { __proto__: null }, - positionals: [], - }; - if (returnTokens) { - result.tokens = tokens; - } - ArrayPrototypeForEach(tokens, (token) => { - if (token.kind === 'option') { - if (strict) { - checkOptionUsage(parseConfig, token); - checkOptionLikeValue(token); - } - storeOption(token.name, token.value, options, result.values); - } else if (token.kind === 'positional') { - if (!allowPositionals) { - throw new ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL(token.value); - } - ArrayPrototypePush(result.positionals, token.value); - } - }); - - // Phase 3: fill in default values for missing args - ArrayPrototypeForEach(ObjectEntries(options), ({ 0: longOption, - 1: optionConfig }) => { - const mustSetDefault = useDefaultValueOption(longOption, - optionConfig, - result.values); - if (mustSetDefault) { - storeDefaultOption(longOption, - objectGetOwn(optionConfig, 'default'), - result.values); - } - }); - - - return result; -}; - -module.exports = { - parseArgs, -}; diff --git a/node_modules/@pkgjs/parseargs/internal/errors.js b/node_modules/@pkgjs/parseargs/internal/errors.js deleted file mode 100644 index e1b237b5b16395895e310d18d0733410c940d17a..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/internal/errors.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -class ERR_INVALID_ARG_TYPE extends TypeError { - constructor(name, expected, actual) { - super(`${name} must be ${expected} got ${actual}`); - this.code = 'ERR_INVALID_ARG_TYPE'; - } -} - -class ERR_INVALID_ARG_VALUE extends TypeError { - constructor(arg1, arg2, expected) { - super(`The property ${arg1} ${expected}. Received '${arg2}'`); - this.code = 'ERR_INVALID_ARG_VALUE'; - } -} - -class ERR_PARSE_ARGS_INVALID_OPTION_VALUE extends Error { - constructor(message) { - super(message); - this.code = 'ERR_PARSE_ARGS_INVALID_OPTION_VALUE'; - } -} - -class ERR_PARSE_ARGS_UNKNOWN_OPTION extends Error { - constructor(option, allowPositionals) { - const suggestDashDash = allowPositionals ? `. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${JSON.stringify(option)}` : ''; - super(`Unknown option '${option}'${suggestDashDash}`); - this.code = 'ERR_PARSE_ARGS_UNKNOWN_OPTION'; - } -} - -class ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL extends Error { - constructor(positional) { - super(`Unexpected argument '${positional}'. This command does not take positional arguments`); - this.code = 'ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL'; - } -} - -module.exports = { - codes: { - ERR_INVALID_ARG_TYPE, - ERR_INVALID_ARG_VALUE, - ERR_PARSE_ARGS_INVALID_OPTION_VALUE, - ERR_PARSE_ARGS_UNKNOWN_OPTION, - ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, - } -}; diff --git a/node_modules/@pkgjs/parseargs/internal/primordials.js b/node_modules/@pkgjs/parseargs/internal/primordials.js deleted file mode 100644 index 63e23ab117a9ccd324f792113c7a62e2f17e8ea2..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/internal/primordials.js +++ /dev/null @@ -1,393 +0,0 @@ -/* -This file is copied from https://github.com/nodejs/node/blob/v14.19.3/lib/internal/per_context/primordials.js -under the following license: - -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -*/ - -'use strict'; - -/* eslint-disable node-core/prefer-primordials */ - -// This file subclasses and stores the JS builtins that come from the VM -// so that Node.js's builtin modules do not need to later look these up from -// the global proxy, which can be mutated by users. - -// Use of primordials have sometimes a dramatic impact on performance, please -// benchmark all changes made in performance-sensitive areas of the codebase. -// See: https://github.com/nodejs/node/pull/38248 - -const primordials = {}; - -const { - defineProperty: ReflectDefineProperty, - getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor, - ownKeys: ReflectOwnKeys, -} = Reflect; - -// `uncurryThis` is equivalent to `func => Function.prototype.call.bind(func)`. -// It is using `bind.bind(call)` to avoid using `Function.prototype.bind` -// and `Function.prototype.call` after it may have been mutated by users. -const { apply, bind, call } = Function.prototype; -const uncurryThis = bind.bind(call); -primordials.uncurryThis = uncurryThis; - -// `applyBind` is equivalent to `func => Function.prototype.apply.bind(func)`. -// It is using `bind.bind(apply)` to avoid using `Function.prototype.bind` -// and `Function.prototype.apply` after it may have been mutated by users. -const applyBind = bind.bind(apply); -primordials.applyBind = applyBind; - -// Methods that accept a variable number of arguments, and thus it's useful to -// also create `${prefix}${key}Apply`, which uses `Function.prototype.apply`, -// instead of `Function.prototype.call`, and thus doesn't require iterator -// destructuring. -const varargsMethods = [ - // 'ArrayPrototypeConcat' is omitted, because it performs the spread - // on its own for arrays and array-likes with a truthy - // @@isConcatSpreadable symbol property. - 'ArrayOf', - 'ArrayPrototypePush', - 'ArrayPrototypeUnshift', - // 'FunctionPrototypeCall' is omitted, since there's 'ReflectApply' - // and 'FunctionPrototypeApply'. - 'MathHypot', - 'MathMax', - 'MathMin', - 'StringPrototypeConcat', - 'TypedArrayOf', -]; - -function getNewKey(key) { - return typeof key === 'symbol' ? - `Symbol${key.description[7].toUpperCase()}${key.description.slice(8)}` : - `${key[0].toUpperCase()}${key.slice(1)}`; -} - -function copyAccessor(dest, prefix, key, { enumerable, get, set }) { - ReflectDefineProperty(dest, `${prefix}Get${key}`, { - value: uncurryThis(get), - enumerable - }); - if (set !== undefined) { - ReflectDefineProperty(dest, `${prefix}Set${key}`, { - value: uncurryThis(set), - enumerable - }); - } -} - -function copyPropsRenamed(src, dest, prefix) { - for (const key of ReflectOwnKeys(src)) { - const newKey = getNewKey(key); - const desc = ReflectGetOwnPropertyDescriptor(src, key); - if ('get' in desc) { - copyAccessor(dest, prefix, newKey, desc); - } else { - const name = `${prefix}${newKey}`; - ReflectDefineProperty(dest, name, desc); - if (varargsMethods.includes(name)) { - ReflectDefineProperty(dest, `${name}Apply`, { - // `src` is bound as the `this` so that the static `this` points - // to the object it was defined on, - // e.g.: `ArrayOfApply` gets a `this` of `Array`: - value: applyBind(desc.value, src), - }); - } - } - } -} - -function copyPropsRenamedBound(src, dest, prefix) { - for (const key of ReflectOwnKeys(src)) { - const newKey = getNewKey(key); - const desc = ReflectGetOwnPropertyDescriptor(src, key); - if ('get' in desc) { - copyAccessor(dest, prefix, newKey, desc); - } else { - const { value } = desc; - if (typeof value === 'function') { - desc.value = value.bind(src); - } - - const name = `${prefix}${newKey}`; - ReflectDefineProperty(dest, name, desc); - if (varargsMethods.includes(name)) { - ReflectDefineProperty(dest, `${name}Apply`, { - value: applyBind(value, src), - }); - } - } - } -} - -function copyPrototype(src, dest, prefix) { - for (const key of ReflectOwnKeys(src)) { - const newKey = getNewKey(key); - const desc = ReflectGetOwnPropertyDescriptor(src, key); - if ('get' in desc) { - copyAccessor(dest, prefix, newKey, desc); - } else { - const { value } = desc; - if (typeof value === 'function') { - desc.value = uncurryThis(value); - } - - const name = `${prefix}${newKey}`; - ReflectDefineProperty(dest, name, desc); - if (varargsMethods.includes(name)) { - ReflectDefineProperty(dest, `${name}Apply`, { - value: applyBind(value), - }); - } - } - } -} - -// Create copies of configurable value properties of the global object -[ - 'Proxy', - 'globalThis', -].forEach((name) => { - // eslint-disable-next-line no-restricted-globals - primordials[name] = globalThis[name]; -}); - -// Create copies of URI handling functions -[ - decodeURI, - decodeURIComponent, - encodeURI, - encodeURIComponent, -].forEach((fn) => { - primordials[fn.name] = fn; -}); - -// Create copies of the namespace objects -[ - 'JSON', - 'Math', - 'Proxy', - 'Reflect', -].forEach((name) => { - // eslint-disable-next-line no-restricted-globals - copyPropsRenamed(global[name], primordials, name); -}); - -// Create copies of intrinsic objects -[ - 'Array', - 'ArrayBuffer', - 'BigInt', - 'BigInt64Array', - 'BigUint64Array', - 'Boolean', - 'DataView', - 'Date', - 'Error', - 'EvalError', - 'Float32Array', - 'Float64Array', - 'Function', - 'Int16Array', - 'Int32Array', - 'Int8Array', - 'Map', - 'Number', - 'Object', - 'RangeError', - 'ReferenceError', - 'RegExp', - 'Set', - 'String', - 'Symbol', - 'SyntaxError', - 'TypeError', - 'URIError', - 'Uint16Array', - 'Uint32Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'WeakMap', - 'WeakSet', -].forEach((name) => { - // eslint-disable-next-line no-restricted-globals - const original = global[name]; - primordials[name] = original; - copyPropsRenamed(original, primordials, name); - copyPrototype(original.prototype, primordials, `${name}Prototype`); -}); - -// Create copies of intrinsic objects that require a valid `this` to call -// static methods. -// Refs: https://www.ecma-international.org/ecma-262/#sec-promise.all -[ - 'Promise', -].forEach((name) => { - // eslint-disable-next-line no-restricted-globals - const original = global[name]; - primordials[name] = original; - copyPropsRenamedBound(original, primordials, name); - copyPrototype(original.prototype, primordials, `${name}Prototype`); -}); - -// Create copies of abstract intrinsic objects that are not directly exposed -// on the global object. -// Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object -[ - { name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) }, - { name: 'ArrayIterator', original: { - prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()), - } }, - { name: 'StringIterator', original: { - prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()), - } }, -].forEach(({ name, original }) => { - primordials[name] = original; - // The static %TypedArray% methods require a valid `this`, but can't be bound, - // as they need a subclass constructor as the receiver: - copyPrototype(original, primordials, name); - copyPrototype(original.prototype, primordials, `${name}Prototype`); -}); - -/* eslint-enable node-core/prefer-primordials */ - -const { - ArrayPrototypeForEach, - FunctionPrototypeCall, - Map, - ObjectFreeze, - ObjectSetPrototypeOf, - Set, - SymbolIterator, - WeakMap, - WeakSet, -} = primordials; - -// Because these functions are used by `makeSafe`, which is exposed -// on the `primordials` object, it's important to use const references -// to the primordials that they use: -const createSafeIterator = (factory, next) => { - class SafeIterator { - constructor(iterable) { - this._iterator = factory(iterable); - } - next() { - return next(this._iterator); - } - [SymbolIterator]() { - return this; - } - } - ObjectSetPrototypeOf(SafeIterator.prototype, null); - ObjectFreeze(SafeIterator.prototype); - ObjectFreeze(SafeIterator); - return SafeIterator; -}; - -primordials.SafeArrayIterator = createSafeIterator( - primordials.ArrayPrototypeSymbolIterator, - primordials.ArrayIteratorPrototypeNext -); -primordials.SafeStringIterator = createSafeIterator( - primordials.StringPrototypeSymbolIterator, - primordials.StringIteratorPrototypeNext -); - -const copyProps = (src, dest) => { - ArrayPrototypeForEach(ReflectOwnKeys(src), (key) => { - if (!ReflectGetOwnPropertyDescriptor(dest, key)) { - ReflectDefineProperty( - dest, - key, - ReflectGetOwnPropertyDescriptor(src, key)); - } - }); -}; - -const makeSafe = (unsafe, safe) => { - if (SymbolIterator in unsafe.prototype) { - const dummy = new unsafe(); - let next; // We can reuse the same `next` method. - - ArrayPrototypeForEach(ReflectOwnKeys(unsafe.prototype), (key) => { - if (!ReflectGetOwnPropertyDescriptor(safe.prototype, key)) { - const desc = ReflectGetOwnPropertyDescriptor(unsafe.prototype, key); - if ( - typeof desc.value === 'function' && - desc.value.length === 0 && - SymbolIterator in (FunctionPrototypeCall(desc.value, dummy) ?? {}) - ) { - const createIterator = uncurryThis(desc.value); - next = next ?? uncurryThis(createIterator(dummy).next); - const SafeIterator = createSafeIterator(createIterator, next); - desc.value = function() { - return new SafeIterator(this); - }; - } - ReflectDefineProperty(safe.prototype, key, desc); - } - }); - } else { - copyProps(unsafe.prototype, safe.prototype); - } - copyProps(unsafe, safe); - - ObjectSetPrototypeOf(safe.prototype, null); - ObjectFreeze(safe.prototype); - ObjectFreeze(safe); - return safe; -}; -primordials.makeSafe = makeSafe; - -// Subclass the constructors because we need to use their prototype -// methods later. -// Defining the `constructor` is necessary here to avoid the default -// constructor which uses the user-mutable `%ArrayIteratorPrototype%.next`. -primordials.SafeMap = makeSafe( - Map, - class SafeMap extends Map { - constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } -); -primordials.SafeWeakMap = makeSafe( - WeakMap, - class SafeWeakMap extends WeakMap { - constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } -); -primordials.SafeSet = makeSafe( - Set, - class SafeSet extends Set { - constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } -); -primordials.SafeWeakSet = makeSafe( - WeakSet, - class SafeWeakSet extends WeakSet { - constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } -); - -ObjectSetPrototypeOf(primordials, null); -ObjectFreeze(primordials); - -module.exports = primordials; diff --git a/node_modules/@pkgjs/parseargs/internal/util.js b/node_modules/@pkgjs/parseargs/internal/util.js deleted file mode 100644 index b9b8fe5b8d7c02ec295f7b7b01d0bf3ef9fbccf1..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/internal/util.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -// This is a placeholder for util.js in node.js land. - -const { - ObjectCreate, - ObjectFreeze, -} = require('./primordials'); - -const kEmptyObject = ObjectFreeze(ObjectCreate(null)); - -module.exports = { - kEmptyObject, -}; diff --git a/node_modules/@pkgjs/parseargs/internal/validators.js b/node_modules/@pkgjs/parseargs/internal/validators.js deleted file mode 100644 index b5ac4fb501eff454ad583570027f8b1aa044ca43..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/internal/validators.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -// This file is a proxy of the original file located at: -// https://github.com/nodejs/node/blob/main/lib/internal/validators.js -// Every addition or modification to this file must be evaluated -// during the PR review. - -const { - ArrayIsArray, - ArrayPrototypeIncludes, - ArrayPrototypeJoin, -} = require('./primordials'); - -const { - codes: { - ERR_INVALID_ARG_TYPE - } -} = require('./errors'); - -function validateString(value, name) { - if (typeof value !== 'string') { - throw new ERR_INVALID_ARG_TYPE(name, 'String', value); - } -} - -function validateUnion(value, name, union) { - if (!ArrayPrototypeIncludes(union, value)) { - throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value); - } -} - -function validateBoolean(value, name) { - if (typeof value !== 'boolean') { - throw new ERR_INVALID_ARG_TYPE(name, 'Boolean', value); - } -} - -function validateArray(value, name) { - if (!ArrayIsArray(value)) { - throw new ERR_INVALID_ARG_TYPE(name, 'Array', value); - } -} - -function validateStringArray(value, name) { - validateArray(value, name); - for (let i = 0; i < value.length; i++) { - validateString(value[i], `${name}[${i}]`); - } -} - -function validateBooleanArray(value, name) { - validateArray(value, name); - for (let i = 0; i < value.length; i++) { - validateBoolean(value[i], `${name}[${i}]`); - } -} - -/** - * @param {unknown} value - * @param {string} name - * @param {{ - * allowArray?: boolean, - * allowFunction?: boolean, - * nullable?: boolean - * }} [options] - */ -function validateObject(value, name, options) { - const useDefaultOptions = options == null; - const allowArray = useDefaultOptions ? false : options.allowArray; - const allowFunction = useDefaultOptions ? false : options.allowFunction; - const nullable = useDefaultOptions ? false : options.nullable; - if ((!nullable && value === null) || - (!allowArray && ArrayIsArray(value)) || - (typeof value !== 'object' && ( - !allowFunction || typeof value !== 'function' - ))) { - throw new ERR_INVALID_ARG_TYPE(name, 'Object', value); - } -} - -module.exports = { - validateArray, - validateObject, - validateString, - validateStringArray, - validateUnion, - validateBoolean, - validateBooleanArray, -}; diff --git a/node_modules/@pkgjs/parseargs/package.json b/node_modules/@pkgjs/parseargs/package.json deleted file mode 100644 index 0bcc05c0d4a3ec6b9616824c5ed25feb899d76ec..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@pkgjs/parseargs", - "version": "0.11.0", - "description": "Polyfill of future proposal for `util.parseArgs()`", - "engines": { - "node": ">=14" - }, - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "scripts": { - "coverage": "c8 --check-coverage tape 'test/*.js'", - "test": "c8 tape 'test/*.js'", - "posttest": "eslint .", - "fix": "npm run posttest -- --fix" - }, - "repository": { - "type": "git", - "url": "git@github.com:pkgjs/parseargs.git" - }, - "keywords": [], - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/pkgjs/parseargs/issues" - }, - "homepage": "https://github.com/pkgjs/parseargs#readme", - "devDependencies": { - "c8": "^7.10.0", - "eslint": "^8.2.0", - "eslint-plugin-node-core": "iansu/eslint-plugin-node-core", - "tape": "^5.2.2" - } -} diff --git a/node_modules/@pkgjs/parseargs/utils.js b/node_modules/@pkgjs/parseargs/utils.js deleted file mode 100644 index d7f420a2339246233300ad2cdb2619f79261e4b8..0000000000000000000000000000000000000000 --- a/node_modules/@pkgjs/parseargs/utils.js +++ /dev/null @@ -1,198 +0,0 @@ -'use strict'; - -const { - ArrayPrototypeFind, - ObjectEntries, - ObjectPrototypeHasOwnProperty: ObjectHasOwn, - StringPrototypeCharAt, - StringPrototypeIncludes, - StringPrototypeStartsWith, -} = require('./internal/primordials'); - -const { - validateObject, -} = require('./internal/validators'); - -// These are internal utilities to make the parsing logic easier to read, and -// add lots of detail for the curious. They are in a separate file to allow -// unit testing, although that is not essential (this could be rolled into -// main file and just tested implicitly via API). -// -// These routines are for internal use, not for export to client. - -/** - * Return the named property, but only if it is an own property. - */ -function objectGetOwn(obj, prop) { - if (ObjectHasOwn(obj, prop)) - return obj[prop]; -} - -/** - * Return the named options property, but only if it is an own property. - */ -function optionsGetOwn(options, longOption, prop) { - if (ObjectHasOwn(options, longOption)) - return objectGetOwn(options[longOption], prop); -} - -/** - * Determines if the argument may be used as an option value. - * @example - * isOptionValue('V') // returns true - * isOptionValue('-v') // returns true (greedy) - * isOptionValue('--foo') // returns true (greedy) - * isOptionValue(undefined) // returns false - */ -function isOptionValue(value) { - if (value == null) return false; - - // Open Group Utility Conventions are that an option-argument - // is the argument after the option, and may start with a dash. - return true; // greedy! -} - -/** - * Detect whether there is possible confusion and user may have omitted - * the option argument, like `--port --verbose` when `port` of type:string. - * In strict mode we throw errors if value is option-like. - */ -function isOptionLikeValue(value) { - if (value == null) return false; - - return value.length > 1 && StringPrototypeCharAt(value, 0) === '-'; -} - -/** - * Determines if `arg` is just a short option. - * @example '-f' - */ -function isLoneShortOption(arg) { - return arg.length === 2 && - StringPrototypeCharAt(arg, 0) === '-' && - StringPrototypeCharAt(arg, 1) !== '-'; -} - -/** - * Determines if `arg` is a lone long option. - * @example - * isLoneLongOption('a') // returns false - * isLoneLongOption('-a') // returns false - * isLoneLongOption('--foo') // returns true - * isLoneLongOption('--foo=bar') // returns false - */ -function isLoneLongOption(arg) { - return arg.length > 2 && - StringPrototypeStartsWith(arg, '--') && - !StringPrototypeIncludes(arg, '=', 3); -} - -/** - * Determines if `arg` is a long option and value in the same argument. - * @example - * isLongOptionAndValue('--foo') // returns false - * isLongOptionAndValue('--foo=bar') // returns true - */ -function isLongOptionAndValue(arg) { - return arg.length > 2 && - StringPrototypeStartsWith(arg, '--') && - StringPrototypeIncludes(arg, '=', 3); -} - -/** - * Determines if `arg` is a short option group. - * - * See Guideline 5 of the [Open Group Utility Conventions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html). - * One or more options without option-arguments, followed by at most one - * option that takes an option-argument, should be accepted when grouped - * behind one '-' delimiter. - * @example - * isShortOptionGroup('-a', {}) // returns false - * isShortOptionGroup('-ab', {}) // returns true - * // -fb is an option and a value, not a short option group - * isShortOptionGroup('-fb', { - * options: { f: { type: 'string' } } - * }) // returns false - * isShortOptionGroup('-bf', { - * options: { f: { type: 'string' } } - * }) // returns true - * // -bfb is an edge case, return true and caller sorts it out - * isShortOptionGroup('-bfb', { - * options: { f: { type: 'string' } } - * }) // returns true - */ -function isShortOptionGroup(arg, options) { - if (arg.length <= 2) return false; - if (StringPrototypeCharAt(arg, 0) !== '-') return false; - if (StringPrototypeCharAt(arg, 1) === '-') return false; - - const firstShort = StringPrototypeCharAt(arg, 1); - const longOption = findLongOptionForShort(firstShort, options); - return optionsGetOwn(options, longOption, 'type') !== 'string'; -} - -/** - * Determine if arg is a short string option followed by its value. - * @example - * isShortOptionAndValue('-a', {}); // returns false - * isShortOptionAndValue('-ab', {}); // returns false - * isShortOptionAndValue('-fFILE', { - * options: { foo: { short: 'f', type: 'string' }} - * }) // returns true - */ -function isShortOptionAndValue(arg, options) { - validateObject(options, 'options'); - - if (arg.length <= 2) return false; - if (StringPrototypeCharAt(arg, 0) !== '-') return false; - if (StringPrototypeCharAt(arg, 1) === '-') return false; - - const shortOption = StringPrototypeCharAt(arg, 1); - const longOption = findLongOptionForShort(shortOption, options); - return optionsGetOwn(options, longOption, 'type') === 'string'; -} - -/** - * Find the long option associated with a short option. Looks for a configured - * `short` and returns the short option itself if a long option is not found. - * @example - * findLongOptionForShort('a', {}) // returns 'a' - * findLongOptionForShort('b', { - * options: { bar: { short: 'b' } } - * }) // returns 'bar' - */ -function findLongOptionForShort(shortOption, options) { - validateObject(options, 'options'); - const longOptionEntry = ArrayPrototypeFind( - ObjectEntries(options), - ({ 1: optionConfig }) => objectGetOwn(optionConfig, 'short') === shortOption - ); - return longOptionEntry?.[0] ?? shortOption; -} - -/** - * Check if the given option includes a default value - * and that option has not been set by the input args. - * - * @param {string} longOption - long option name e.g. 'foo' - * @param {object} optionConfig - the option configuration properties - * @param {object} values - option values returned in `values` by parseArgs - */ -function useDefaultValueOption(longOption, optionConfig, values) { - return objectGetOwn(optionConfig, 'default') !== undefined && - values[longOption] === undefined; -} - -module.exports = { - findLongOptionForShort, - isLoneLongOption, - isLoneShortOption, - isLongOptionAndValue, - isOptionValue, - isOptionLikeValue, - isShortOptionAndValue, - isShortOptionGroup, - useDefaultValueOption, - objectGetOwn, - optionsGetOwn, -}; diff --git a/node_modules/@tailwindcss/typography/LICENSE b/node_modules/@tailwindcss/typography/LICENSE deleted file mode 100644 index d6a82290738a9f78946cbcb4594535d6984086dd..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Tailwind Labs, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@tailwindcss/typography/README.md b/node_modules/@tailwindcss/typography/README.md deleted file mode 100644 index a4d73c53ffe636ba906d4a79a9ba35cf8e540a48..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/README.md +++ /dev/null @@ -1,398 +0,0 @@ -

- - - - - Tailwind CSS Typography - - -

- -The official Tailwind CSS Typography plugin provides a set of `prose` classes you can use to add beautiful typographic defaults to any vanilla HTML you don’t control, like HTML rendered from Markdown, or pulled from a CMS. - -```html -
{{ markdown }}
-``` - -To see what it looks like in action, check out our [live demo](https://play.tailwindcss.com/uj1vGACRJA?layout=preview) on Tailwind Play. - ---- - -## Installation - -Install the plugin from npm: - -```shell -npm install -D @tailwindcss/typography -``` - -Then add the plugin to your `tailwind.config.js` file: - -```js -/** @type {import('tailwindcss').Config} */ -module.exports = { - theme: { - // ... - }, - plugins: [ - require('@tailwindcss/typography'), - // ... - ], -} -``` - ---- - -## Basic usage - -Now you can use the `prose` classes to add sensible typography styles to any vanilla HTML: - -```html -
-

Garlic bread with cheese: What the science tells us

-

- For years parents have espoused the health benefits of eating garlic bread with cheese to their - children, with the food earning such an iconic status in our culture that kids will often dress - up as warm, cheesy loaf for Halloween. -

-

- But a recent study shows that the celebrated appetizer may be linked to a series of rabies cases - springing up around the country. -

- -
-``` - -### Choosing a gray scale - -This plugin includes a modifier class for each of the five gray scales Tailwind includes by default so you can easily style your content to match the grays you're using in your project. - -```html -
{{ markdown }}
-``` - -Here are the classes that are generated using a totally default Tailwind CSS v2.0 build: - -| Class | Gray scale | -| ------------------------ | ---------- | -| `prose-gray` _(default)_ | Gray | -| `prose-slate` | Slate | -| `prose-zinc` | Zinc | -| `prose-neutral` | Neutral | -| `prose-stone` | Stone | - -Modifier classes are designed to be used with the [multi-class modifier pattern](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/#component-modifiers) and must be used in conjunction with the base `prose` class. - -> [!NOTE] -> Always include the `prose` class when adding a gray scale modifier - -```html -
{{ markdown }}
-``` - -To learn about creating your own color themes, read the [adding custom color themes](#adding-custom-color-themes) documentation. - -### Applying a type scale - -Size modifiers allow you to adjust the overall size of your typography for different contexts. - -```html -
{{ markdown }}
-``` - -Five different typography sizes are included out of the box: - -| Class | Body font size | -| ------------------------ | ----------------- | -| `prose-sm` | 0.875rem _(14px)_ | -| `prose-base` _(default)_ | 1rem _(16px)_ | -| `prose-lg` | 1.125rem _(18px)_ | -| `prose-xl` | 1.25rem _(20px)_ | -| `prose-2xl` | 1.5rem _(24px)_ | - -These can be used in combination with Tailwind's [breakpoint modifiers](https://tailwindcss.com/docs/responsive-design) to change the overall font size of a piece of content at different viewport sizes: - -```html -
{{ markdown }}
-``` - -Everything about the provided size modifiers has been hand-tuned by professional designers to look as beautiful as possible, including the relationships between font sizes, heading spacing, code block padding, and more. - -Size modifiers are designed to be used with the [multi-class modifier pattern](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/#component-modifiers) and must be used in conjunction with the base `prose` class. - -> [!NOTE] -> Always include the `prose` class when adding a size modifier - -```html -
{{ markdown }}
-``` - -To learn about customizing the included type scales, read the documentation on [customizing the CSS](#customizing-the-css). - -### Adapting to dark mode - -Each default color theme includes a hand-designed dark mode version that you can trigger by adding the `prose-invert` class: - -```html -
{{ markdown }}
-``` - -To learn about creating your own color themes, read the [adding custom color themes](#adding-custom-color-themes) documentation. - -### Element modifiers - -Use element modifiers to customize the style of individual elements in your content directly in your HTML: - -```html -
- {{ markdown }} -
-``` - -This makes it easy to do things like style links to match your brand, add a border radius to images, and tons more. - -Here's a complete list of available element modifiers: - -| Modifier | Target | -| ---------------------------- | ---------------------------- | -| `prose-headings:{utility}` | `h1`, `h2`, `h3`, `h4`, `th` | -| `prose-lead:{utility}` | `[class~="lead"]` | -| `prose-h1:{utility}` | `h1` | -| `prose-h2:{utility}` | `h2` | -| `prose-h3:{utility}` | `h3` | -| `prose-h4:{utility}` | `h4` | -| `prose-p:{utility}` | `p` | -| `prose-a:{utility}` | `a` | -| `prose-blockquote:{utility}` | `blockquote` | -| `prose-figure:{utility}` | `figure` | -| `prose-figcaption:{utility}` | `figcaption` | -| `prose-strong:{utility}` | `strong` | -| `prose-em:{utility}` | `em` | -| `prose-kbd:{utility}` | `kbd` | -| `prose-code:{utility}` | `code` | -| `prose-pre:{utility}` | `pre` | -| `prose-ol:{utility}` | `ol` | -| `prose-ul:{utility}` | `ul` | -| `prose-li:{utility}` | `li` | -| `prose-table:{utility}` | `table` | -| `prose-thead:{utility}` | `thead` | -| `prose-tr:{utility}` | `tr` | -| `prose-th:{utility}` | `th` | -| `prose-td:{utility}` | `td` | -| `prose-img:{utility}` | `img` | -| `prose-video:{utility}` | `video` | -| `prose-hr:{utility}` | `hr` | - -When stacking these modifiers with other modifiers like `hover`, you most likely want the other modifier to come first: - -```html -
{{ markdown }}
-``` - -Read the Tailwind CSS documentation on [ordering stacked modifiers](https://tailwindcss.com/docs/hover-focus-and-other-states#ordering-stacked-modifiers) to learn more. - -### Overriding max-width - -Each size modifier comes with a baked in `max-width` designed to keep the content as readable as possible. This isn't always what you want though, and sometimes you'll want the content to just fill the width of its container. - -In those cases, all you need to do is add `max-w-none` to your content to override the embedded max-width: - -```html -
-
- -
-
-
{{ markdown }}
-
-
-``` - ---- - -## Advanced topics - -### Undoing typography styles - -If you have a block of markup embedded in some content that shouldn't inherit the `prose` styles, use the `not-prose` class to sandbox it: - -```html -
-

My Heading

-

...

- -
- -
- -

...

- -
-``` - -Note that you can't nest new `prose` instances within a `not-prose` block at this time. - -### Adding custom color themes - -You can create your own color theme by adding a new key in the `typography` section of your `tailwind.config.js` file and providing your colors under the `css` key: - -```js {{ filename: 'tailwind.config.js' }} -/** @type {import('tailwindcss').Config} */ -module.exports = { - theme: { - extend: { - typography: ({ theme }) => ({ - pink: { - css: { - '--tw-prose-body': theme('colors.pink[800]'), - '--tw-prose-headings': theme('colors.pink[900]'), - '--tw-prose-lead': theme('colors.pink[700]'), - '--tw-prose-links': theme('colors.pink[900]'), - '--tw-prose-bold': theme('colors.pink[900]'), - '--tw-prose-counters': theme('colors.pink[600]'), - '--tw-prose-bullets': theme('colors.pink[400]'), - '--tw-prose-hr': theme('colors.pink[300]'), - '--tw-prose-quotes': theme('colors.pink[900]'), - '--tw-prose-quote-borders': theme('colors.pink[300]'), - '--tw-prose-captions': theme('colors.pink[700]'), - '--tw-prose-code': theme('colors.pink[900]'), - '--tw-prose-pre-code': theme('colors.pink[100]'), - '--tw-prose-pre-bg': theme('colors.pink[900]'), - '--tw-prose-th-borders': theme('colors.pink[300]'), - '--tw-prose-td-borders': theme('colors.pink[200]'), - '--tw-prose-invert-body': theme('colors.pink[200]'), - '--tw-prose-invert-headings': theme('colors.white'), - '--tw-prose-invert-lead': theme('colors.pink[300]'), - '--tw-prose-invert-links': theme('colors.white'), - '--tw-prose-invert-bold': theme('colors.white'), - '--tw-prose-invert-counters': theme('colors.pink[400]'), - '--tw-prose-invert-bullets': theme('colors.pink[600]'), - '--tw-prose-invert-hr': theme('colors.pink[700]'), - '--tw-prose-invert-quotes': theme('colors.pink[100]'), - '--tw-prose-invert-quote-borders': theme('colors.pink[700]'), - '--tw-prose-invert-captions': theme('colors.pink[400]'), - '--tw-prose-invert-code': theme('colors.white'), - '--tw-prose-invert-pre-code': theme('colors.pink[300]'), - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': theme('colors.pink[600]'), - '--tw-prose-invert-td-borders': theme('colors.pink[700]'), - }, - }, - }), - }, - }, - plugins: [ - require('@tailwindcss/typography'), - // ... - ], -} -``` - -See our internal [style definitions](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/src/styles.js) for some more examples. - -### Changing the default class name - -If you need to use a class name other than `prose` for any reason, you can do so using the `className` option when registering the plugin: - -```js {{ filename: 'tailwind.config.js' }} -/** @type {import('tailwindcss').Config} */ -module.exports = { - theme: { - // ... - }, - plugins: [ - require('@tailwindcss/typography')({ - className: 'wysiwyg', - }), - ] - ... -} -``` - -Now every instance of `prose` in the default class names will be replaced by your custom class name: - -```html -
-

My Heading

-

...

- -
- -
- -

...

- -
-``` - -### Customizing the CSS - -If you want to customize the raw CSS generated by this plugin, add your overrides under the `typography` key in the `theme` section of your `tailwind.config.js` file: - -```js {{ filename: 'tailwind.config.js' }} -/** @type {import('tailwindcss').Config} */ -module.exports = { - theme: { - extend: { - typography: { - DEFAULT: { - css: { - color: '#333', - a: { - color: '#3182ce', - '&:hover': { - color: '#2c5282', - }, - }, - }, - }, - }, - }, - }, - plugins: [ - require('@tailwindcss/typography'), - // ... - ], -} -``` - -Like with all theme customizations in Tailwind, you can also define the `typography` key as a function if you need access to the `theme` helper: - -```js {{ filename: 'tailwind.config.js' }} -/** @type {import('tailwindcss').Config} */ -module.exports = { - theme: { - extend: { - typography: (theme) => ({ - DEFAULT: { - css: { - color: theme('colors.gray.800'), - - // ... - }, - }, - }), - }, - }, - plugins: [ - require('@tailwindcss/typography'), - // ... - ], -} -``` - -Customizations should be applied to a specific modifier like `DEFAULT` or `xl`, and must be added under the `css` property. Customizations are authored in the same [CSS-in-JS syntax](https://tailwindcss.com/docs/plugins#css-in-js-syntax) used to write Tailwind plugins. - -See [the default styles](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/src/styles.js) for this plugin for more in-depth examples of configuring each modifier. - ---- - -## Community - -For help, discussion about best practices, or any other conversation that would benefit from being searchable: - -[Discuss the Tailwind CSS Typography plugin on GitHub](https://github.com/tailwindlabs/tailwindcss/discussions) - -For casual chit-chat with others using the framework: - -[Join the Tailwind CSS Discord Server](https://tailwindcss.com/discord) diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/API.md b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/API.md deleted file mode 100644 index 6aa1f1438f1be4accd82814435f3b7bfbe951e95..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/API.md +++ /dev/null @@ -1,873 +0,0 @@ -# API Documentation - -*Please use only this documented API when working with the parser. Methods -not documented here are subject to change at any point.* - -## `parser` function - -This is the module's main entry point. - -```js -const parser = require('postcss-selector-parser'); -``` - -### `parser([transform], [options])` - -Creates a new `processor` instance - -```js -const processor = parser(); -``` - -Or, with optional transform function - -```js -const transform = selectors => { - selectors.walkUniversals(selector => { - selector.remove(); - }); -}; - -const processor = parser(transform) - -// Example -const result = processor.processSync('*.class'); -// => .class -``` - -[See processor documentation](#processor) - -Arguments: - -* `transform (function)`: Provide a function to work with the parsed AST. -* `options (object)`: Provide default options for all calls on the returned `Processor`. - -### `parser.attribute([props])` - -Creates a new attribute selector. - -```js -parser.attribute({attribute: 'href'}); -// => [href] -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.className([props])` - -Creates a new class selector. - -```js -parser.className({value: 'button'}); -// => .button -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.combinator([props])` - -Creates a new selector combinator. - -```js -parser.combinator({value: '+'}); -// => + -``` - -Arguments: - -* `props (object)`: The new node's properties. - -Notes: -* **Descendant Combinators** The value of descendant combinators created by the - parser always just a single space (`" "`). For descendant selectors with no - comments, additional space is now stored in `node.spaces.before`. Depending - on the location of comments, additional spaces may be stored in - `node.raws.spaces.before`, `node.raws.spaces.after`, or `node.raws.value`. -* **Named Combinators** Although, nonstandard and unlikely to ever become a standard, - named combinators like `/deep/` and `/for/` are parsed as combinators. The - `node.value` is name after being unescaped and normalized as lowercase. The - original value for the combinator name is stored in `node.raws.value`. - - -### `parser.comment([props])` - -Creates a new comment. - -```js -parser.comment({value: '/* Affirmative, Dave. I read you. */'}); -// => /* Affirmative, Dave. I read you. */ -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.id([props])` - -Creates a new id selector. - -```js -parser.id({value: 'search'}); -// => #search -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.nesting([props])` - -Creates a new nesting selector. - -```js -parser.nesting(); -// => & -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.pseudo([props])` - -Creates a new pseudo selector. - -```js -parser.pseudo({value: '::before'}); -// => ::before -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.root([props])` - -Creates a new root node. - -```js -parser.root(); -// => (empty) -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.selector([props])` - -Creates a new selector node. - -```js -parser.selector(); -// => (empty) -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.string([props])` - -Creates a new string node. - -```js -parser.string(); -// => (empty) -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.tag([props])` - -Creates a new tag selector. - -```js -parser.tag({value: 'button'}); -// => button -``` - -Arguments: - -* `props (object)`: The new node's properties. - -### `parser.universal([props])` - -Creates a new universal selector. - -```js -parser.universal(); -// => * -``` - -Arguments: - -* `props (object)`: The new node's properties. - -## Node types - -### `node.type` - -A string representation of the selector type. It can be one of the following; -`attribute`, `class`, `combinator`, `comment`, `id`, `nesting`, `pseudo`, -`root`, `selector`, `string`, `tag`, or `universal`. Note that for convenience, -these constants are exposed on the main `parser` as uppercased keys. So for -example you can get `id` by querying `parser.ID`. - -```js -parser.attribute({attribute: 'href'}).type; -// => 'attribute' -``` - -### `node.parent` - -Returns the parent node. - -```js -root.nodes[0].parent === root; -``` - -### `node.toString()`, `String(node)`, or `'' + node` - -Returns a string representation of the node. - -```js -const id = parser.id({value: 'search'}); -console.log(String(id)); -// => #search -``` - -### `node.next()` & `node.prev()` - -Returns the next/previous child of the parent node. - -```js -const next = id.next(); -if (next && next.type !== 'combinator') { - throw new Error('Qualified IDs are not allowed!'); -} -``` - -### `node.replaceWith(node)` - -Replace a node with another. - -```js -const attr = selectors.first.first; -const className = parser.className({value: 'test'}); -attr.replaceWith(className); -``` - -Arguments: - -* `node`: The node to substitute the original with. - -### `node.remove()` - -Removes the node from its parent node. - -```js -if (node.type === 'id') { - node.remove(); -} -``` - -### `node.clone()` - -Returns a copy of a node, detached from any parent containers that the -original might have had. - -```js -const cloned = parser.id({value: 'search'}); -String(cloned); - -// => #search -``` - -### `node.isAtPosition(line, column)` - -Return a `boolean` indicating whether this node includes the character at the -position of the given line and column. Returns `undefined` if the nodes lack -sufficient source metadata to determine the position. - -Arguments: - -* `line`: 1-index based line number relative to the start of the selector. -* `column`: 1-index based column number relative to the start of the selector. - -### `node.spaces` - -Extra whitespaces around the node will be moved into `node.spaces.before` and -`node.spaces.after`. So for example, these spaces will be moved as they have -no semantic meaning: - -```css - h1 , h2 {} -``` - -For descendent selectors, the value is always a single space. - -```css -h1 h2 {} -``` - -Additional whitespace is found in either the `node.spaces.before` and `node.spaces.after` depending on the presence of comments or other whitespace characters. If the actual whitespace does not start or end with a single space, the node's raw value is set to the actual space(s) found in the source. - -### `node.source` - -An object describing the node's start/end, line/column source position. - -Within the following CSS, the `.bar` class node ... - -```css -.foo, - .bar {} -``` - -... will contain the following `source` object. - -```js -source: { - start: { - line: 2, - column: 3 - }, - end: { - line: 2, - column: 6 - } -} -``` - -### `node.sourceIndex` - -The zero-based index of the node within the original source string. - -Within the following CSS, the `.baz` class node will have a `sourceIndex` of `12`. - -```css -.foo, .bar, .baz {} -``` - -## Container types - -The `root`, `selector`, and `pseudo` nodes have some helper methods for working -with their children. - -### `container.nodes` - -An array of the container's children. - -```js -// Input: h1 h2 -selectors.at(0).nodes.length // => 3 -selectors.at(0).nodes[0].value // => 'h1' -selectors.at(0).nodes[1].value // => ' ' -``` - -### `container.first` & `container.last` - -The first/last child of the container. - -```js -selector.first === selector.nodes[0]; -selector.last === selector.nodes[selector.nodes.length - 1]; -``` - -### `container.at(index)` - -Returns the node at position `index`. - -```js -selector.at(0) === selector.first; -selector.at(0) === selector.nodes[0]; -``` - -Arguments: - -* `index`: The index of the node to return. - -### `container.atPosition(line, column)` - -Returns the node at the source position `index`. - -```js -selector.at(0) === selector.first; -selector.at(0) === selector.nodes[0]; -``` - -Arguments: - -* `index`: The index of the node to return. - -### `container.index(node)` - -Return the index of the node within its container. - -```js -selector.index(selector.nodes[2]) // => 2 -``` - -Arguments: - -* `node`: A node within the current container. - -### `container.length` - -Proxy to the length of the container's nodes. - -```js -container.length === container.nodes.length -``` - -### `container` Array iterators - -The container class provides proxies to certain Array methods; these are: - -* `container.map === container.nodes.map` -* `container.reduce === container.nodes.reduce` -* `container.every === container.nodes.every` -* `container.some === container.nodes.some` -* `container.filter === container.nodes.filter` -* `container.sort === container.nodes.sort` - -Note that these methods only work on a container's immediate children; recursive -iteration is provided by `container.walk`. - -### `container.each(callback)` - -Iterate the container's immediate children, calling `callback` for each child. -You may return `false` within the callback to break the iteration. - -```js -let className; -selectors.each((selector, index) => { - if (selector.type === 'class') { - className = selector.value; - return false; - } -}); -``` - -Note that unlike `Array#forEach()`, this iterator is safe to use whilst adding -or removing nodes from the container. - -Arguments: - -* `callback (function)`: A function to call for each node, which receives `node` - and `index` arguments. - -### `container.walk(callback)` - -Like `container#each`, but will also iterate child nodes as long as they are -`container` types. - -```js -selectors.walk((selector, index) => { - // all nodes -}); -``` - -Arguments: - -* `callback (function)`: A function to call for each node, which receives `node` - and `index` arguments. - -This iterator is safe to use whilst mutating `container.nodes`, -like `container#each`. - -### `container.walk` proxies - -The container class provides proxy methods for iterating over types of nodes, -so that it is easier to write modules that target specific selectors. Those -methods are: - -* `container.walkAttributes` -* `container.walkClasses` -* `container.walkCombinators` -* `container.walkComments` -* `container.walkIds` -* `container.walkNesting` -* `container.walkPseudos` -* `container.walkTags` -* `container.walkUniversals` - -### `container.split(callback)` - -This method allows you to split a group of nodes by returning `true` from -a callback. It returns an array of arrays, where each inner array corresponds -to the groups that you created via the callback. - -```js -// (input) => h1 h2>>h3 -const list = selectors.first.split(selector => { - return selector.type === 'combinator'; -}); - -// (node values) => [['h1', ' '], ['h2', '>>'], ['h3']] -``` - -Arguments: - -* `callback (function)`: A function to call for each node, which receives `node` - as an argument. - -### `container.prepend(node)` & `container.append(node)` - -Add a node to the start/end of the container. Note that doing so will set -the parent property of the node to this container. - -```js -const id = parser.id({value: 'search'}); -selector.append(id); -``` - -Arguments: - -* `node`: The node to add. - -### `container.insertBefore(old, new)` & `container.insertAfter(old, new)` - -Add a node before or after an existing node in a container: - -```js -selectors.walk(selector => { - if (selector.type !== 'class') { - const className = parser.className({value: 'theme-name'}); - selector.parent.insertAfter(selector, className); - } -}); -``` - -Arguments: - -* `old`: The existing node in the container. -* `new`: The new node to add before/after the existing node. - -### `container.removeChild(node)` - -Remove the node from the container. Note that you can also use -`node.remove()` if you would like to remove just a single node. - -```js -selector.length // => 2 -selector.remove(id) -selector.length // => 1; -id.parent // undefined -``` - -Arguments: - -* `node`: The node to remove. - -### `container.removeAll()` or `container.empty()` - -Remove all children from the container. - -```js -selector.removeAll(); -selector.length // => 0 -``` - -## Root nodes - -A root node represents a comma separated list of selectors. Indeed, all -a root's `toString()` method does is join its selector children with a ','. -Other than this, it has no special functionality and acts like a container. - -### `root.trailingComma` - -This will be set to `true` if the input has a trailing comma, in order to -support parsing of legacy CSS hacks. - -## Selector nodes - -A selector node represents a single complex selector. For example, this -selector string `h1 h2 h3, [href] > p`, is represented as two selector nodes. -It has no special functionality of its own. - -## Pseudo nodes - -A pseudo selector extends a container node; if it has any parameters of its -own (such as `h1:not(h2, h3)`), they will be its children. Note that the pseudo -`value` will always contain the colons preceding the pseudo identifier. This -is so that both `:before` and `::before` are properly represented in the AST. - -## Attribute nodes - -### `attribute.quoted` - -Returns `true` if the attribute's value is wrapped in quotation marks, false if it is not. -Remains `undefined` if there is no attribute value. - -```css -[href=foo] /* false */ -[href='foo'] /* true */ -[href="foo"] /* true */ -[href] /* undefined */ -``` - -### `attribute.qualifiedAttribute` - -Returns the attribute name qualified with the namespace if one is given. - -### `attribute.offsetOf(part)` - - Returns the offset of the attribute part specified relative to the - start of the node of the output string. This is useful in raising - error messages about a specific part of the attribute, especially - in combination with `attribute.sourceIndex`. - - Returns `-1` if the name is invalid or the value doesn't exist in this - attribute. - - The legal values for `part` are: - - * `"ns"` - alias for "namespace" - * `"namespace"` - the namespace if it exists. - * `"attribute"` - the attribute name - * `"attributeNS"` - the start of the attribute or its namespace - * `"operator"` - the match operator of the attribute - * `"value"` - The value (string or identifier) - * `"insensitive"` - the case insensitivity flag - -### `attribute.raws.unquoted` - -Returns the unquoted content of the attribute's value. -Remains `undefined` if there is no attribute value. - -```css -[href=foo] /* foo */ -[href='foo'] /* foo */ -[href="foo"] /* foo */ -[href] /* undefined */ -``` - -### `attribute.spaces` - -Like `node.spaces` with the `before` and `after` values containing the spaces -around the element, the parts of the attribute can also have spaces before -and after them. The for each of `attribute`, `operator`, `value` and -`insensitive` there is corresponding property of the same nam in -`node.spaces` that has an optional `before` or `after` string containing only -whitespace. - -Note that corresponding values in `attributes.raws.spaces` contain values -including any comments. If set, these values will override the -`attribute.spaces` value. Take care to remove them if changing -`attribute.spaces`. - -### `attribute.raws` - -The raws object stores comments and other information necessary to re-render -the node exactly as it was in the source. - -If a comment is embedded within the identifiers for the `namespace`, `attribute` -or `value` then a property is placed in the raws for that value containing the full source of the propery including comments. - -If a comment is embedded within the space between parts of the attribute -then the raw for that space is set accordingly. - -Setting an attribute's property `raws` value to be deleted. - -For now, changing the spaces required also updating or removing any of the -raws values that override them. - -Example: `[ /*before*/ href /* after-attr */ = /* after-operator */ te/*inside-value*/st/* wow */ /*omg*/i/*bbq*/ /*whodoesthis*/]` would parse as: - -```js -{ - attribute: "href", - operator: "=", - value: "test", - spaces: { - before: '', - after: '', - attribute: { before: ' ', after: ' ' }, - operator: { after: ' ' }, - value: { after: ' ' }, - insensitive: { after: ' ' } - }, - raws: { - spaces: { - attribute: { before: ' /*before*/ ', after: ' /* after-attr */ ' }, - operator: { after: ' /* after-operator */ ' }, - value: { after: '/* wow */ /*omg*/' }, - insensitive: { after: '/*bbq*/ /*whodoesthis*/' } - }, - unquoted: 'test', - value: 'te/*inside-value*/st' - } -} -``` - -## `Processor` - -### `ProcessorOptions` - -* `lossless` - When `true`, whitespace is preserved. Defaults to `true`. -* `updateSelector` - When `true`, if any processor methods are passed a postcss - `Rule` node instead of a string, then that Rule's selector is updated - with the results of the processing. Defaults to `true`. - -### `process|processSync(selectors, [options])` - -Processes the `selectors`, returning a string from the result of processing. - -Note: when the `updateSelector` option is set, the rule's selector -will be updated with the resulting string. - -**Example:** - -```js -const parser = require("postcss-selector-parser"); -const processor = parser(); - -let result = processor.processSync(' .class'); -console.log(result); -// => .class - -// Asynchronous operation -let promise = processor.process(' .class').then(result => { - console.log(result) - // => .class -}); - -// To have the parser normalize whitespace values, utilize the options -result = processor.processSync(' .class ', {lossless: false}); -console.log(result); -// => .class - -// For better syntax errors, pass a PostCSS Rule node. -const postcss = require('postcss'); -rule = postcss.rule({selector: ' #foo > a, .class '}); -processor.process(rule, {lossless: false, updateSelector: true}).then(result => { - console.log(result); - // => #foo>a,.class - console.log("rule:", rule.selector); - // => rule: #foo>a,.class -}) -``` - -Arguments: - -* `selectors (string|postcss.Rule)`: Either a selector string or a PostCSS Rule - node. -* `[options] (object)`: Process options - - -### `ast|astSync(selectors, [options])` - -Like `process()` and `processSync()` but after -processing the `selectors` these methods return the `Root` node of the result -instead of a string. - -Note: when the `updateSelector` option is set, the rule's selector -will be updated with the resulting string. - -### `transform|transformSync(selectors, [options])` - -Like `process()` and `processSync()` but after -processing the `selectors` these methods return the value returned by the -processor callback. - -Note: when the `updateSelector` option is set, the rule's selector -will be updated with the resulting string. - -### Error Handling Within Selector Processors - -The root node passed to the selector processor callback -has a method `error(message, options)` that returns an -error object. This method should always be used to raise -errors relating to the syntax of selectors. The options -to this method are passed to postcss's error constructor -([documentation](http://api.postcss.org/Container.html#error)). - -#### Async Error Example - -```js -let processor = (root) => { - return new Promise((resolve, reject) => { - root.walkClasses((classNode) => { - if (/^(.*)[-_]/.test(classNode.value)) { - let msg = "classes may not have underscores or dashes in them"; - reject(root.error(msg, { - index: classNode.sourceIndex + RegExp.$1.length + 1, - word: classNode.value - })); - } - }); - resolve(); - }); -}; - -const postcss = require("postcss"); -const parser = require("postcss-selector-parser"); -const selectorProcessor = parser(processor); -const plugin = postcss.plugin('classValidator', (options) => { - return (root) => { - let promises = []; - root.walkRules(rule => { - promises.push(selectorProcessor.process(rule)); - }); - return Promise.all(promises); - }; -}); -postcss(plugin()).process(` -.foo-bar { - color: red; -} -`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); - -// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them -// -// > 1 | .foo-bar { -// | ^ -// 2 | color: red; -// 3 | } -``` - -#### Synchronous Error Example - -```js -let processor = (root) => { - root.walkClasses((classNode) => { - if (/.*[-_]/.test(classNode.value)) { - let msg = "classes may not have underscores or dashes in them"; - throw root.error(msg, { - index: classNode.sourceIndex, - word: classNode.value - }); - } - }); -}; - -const postcss = require("postcss"); -const parser = require("postcss-selector-parser"); -const selectorProcessor = parser(processor); -const plugin = postcss.plugin('classValidator', (options) => { - return (root) => { - root.walkRules(rule => { - selectorProcessor.processSync(rule); - }); - }; -}); -postcss(plugin()).process(` -.foo-bar { - color: red; -} -`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); - -// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them -// -// > 1 | .foo-bar { -// | ^ -// 2 | color: red; -// 3 | } -``` diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/CHANGELOG.md b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/CHANGELOG.md deleted file mode 100644 index f2fdfeacc4ef4d3ae2ca9e51eee8af2bd134054f..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/CHANGELOG.md +++ /dev/null @@ -1,513 +0,0 @@ -# 6.0.10 - -- Fixed: `isPseudoElement()` supports `:first-letter` and `:first-line` - -# 6.0.9 - -- Fixed: `Combinator.raws` property type - -# 6.0.8 - -- Fixed: reduced size - -# 6.0.7 - -- Fixed: parse animation percents - -# 6.0.6 - -- Fixed: parse quoted attributes containing a newline correctly - -# 6.0.5 - -- Perf: rework unesc for a 63+% performance boost - -# 6.0.4 - -- Fixed: ts errors - -# 6.0.3 - -- Fixed: replace node built-in "util" module with "util-deprecate" -- Fixed: handle uppercase pseudo elements -- Fixed: do not create invalid combinator before comment - -# 6.0.2 - -- Fixed an issue with parsing and stringifying an empty attribute value - -# 6.0.1 - -- Fixed an issue with unicode surrogate pair parsing - -# 6.0.0 - -- Updated: `cssesc` to 3.0.0 (major) -- Fixed: Issues with escaped `id` and `class` selectors - -# 5.0.0 - -- Allow escaped dot within class name. -- Update PostCSS to 7.0.7 (patch) - -# 5.0.0-rc.4 - -- Fixed an issue where comments immediately after an insensitive (in attribute) - were not parsed correctly. -- Updated `cssesc` to 2.0.0 (major). -- Removed outdated integration tests. -- Added tests for custom selectors, tags with attributes, the universal - selector with pseudos, and tokens after combinators. - -# 5.0.0-rc.1 - -To ease adoption of the v5.0 release, we have relaxed the node version -check performed by npm at installation time to allow for node 4, which -remains officially unsupported, but likely to continue working for the -time being. - -# 5.0.0-rc.0 - -This release has **BREAKING CHANGES** that were required to fix regressions -in 4.0.0 and to make the Combinator Node API consistent for all combinator -types. Please read carefully. - -## Summary of Changes - -* The way a descendent combinator that isn't a single space character (E.g. `.a .b`) is stored in the AST has changed. -* Named Combinators (E.g. `.a /for/ .b`) are now properly parsed as a combinator. -* It is now possible to look up a node based on the source location of a character in that node and to query nodes if they contain some character. -* Several bug fixes that caused the parser to hang and run out of memory when a `/` was encountered have been fixed. -* The minimum supported version of Node is now `v6.0.0`. - -### Changes to the Descendent Combinator - -In prior releases, the value of a descendant combinator with multiple spaces included all the spaces. - -* `.a .b`: Extra spaces are now stored as space before. - - Old & Busted: - - `combinator.value === " "` - - New hotness: - - `combinator.value === " " && combinator.spaces.before === " "` -* `.a /*comment*/.b`: A comment at the end of the combinator causes extra space to become after space. - - Old & Busted: - - `combinator.value === " "` - - `combinator.raws.value === " /*comment/"` - - New hotness: - - `combinator.value === " "` - - `combinator.spaces.after === " "` - - `combinator.raws.spaces.after === " /*comment*/"` -* `.a.b`: whitespace that doesn't start or end with a single space character is stored as a raw value. - - Old & Busted: - - `combinator.value === "\n"` - - `combinator.raws.value === undefined` - - New hotness: - - `combinator.value === " "` - - `combinator.raws.value === "\n"` - -### Support for "Named Combinators" - -Although, nonstandard and unlikely to ever become a standard, combinators like `/deep/` and `/for/` are now properly supported. - -Because they've been taken off the standardization track, there is no spec-official name for combinators of the form `//`. However, I talked to [Tab Atkins](https://twitter.com/tabatkins) and we agreed to call them "named combinators" so now they are called that. - -Before this release such named combinators were parsed without intention and generated three nodes of type `"tag"` where the first and last nodes had a value of `"/"`. - -* `.a /for/ .b` is parsed as a combinator. - - Old & Busted: - - `root.nodes[0].nodes[1].type === "tag"` - - `root.nodes[0].nodes[1].value === "/"` - - New hotness: - - `root.nodes[0].nodes[1].type === "combinator"` - - `root.nodes[0].nodes[1].value === "/for/"` -* `.a /F\6fR/ .b` escapes are handled and uppercase is normalized. - - Old & Busted: - - `root.nodes[0].nodes[2].type === "tag"` - - `root.nodes[0].nodes[2].value === "F\\6fR"` - - New hotness: - - `root.nodes[0].nodes[1].type === "combinator"` - - `root.nodes[0].nodes[1].value === "/for/"` - - `root.nodes[0].nodes[1].raws.value === "/F\\6fR/"` - -### Source position checks and lookups - -A new API was added to look up a node based on the source location. - -```js -const selectorParser = require("postcss-selector-parser"); -// You can find the most specific node for any given character -let combinator = selectorParser.astSync(".a > .b").atPosition(1,4); -combinator.toString() === " > "; -// You can check if a node includes a specific character -// Whitespace surrounding the node that is owned by that node -// is included in the check. -[2,3,4,5,6].map(column => combinator.isAtPosition(1, column)); -// => [false, true, true, true, false] -``` - -# 4.0.0 - -This release has **BREAKING CHANGES** that were required to fix bugs regarding values with escape sequences. Please read carefully. - -* **Identifiers with escapes** - CSS escape sequences are now hidden from the public API by default. - The normal value of a node like a class name or ID, or an aspect of a node such as attribute - selector's value, is unescaped. Escapes representing Non-ascii characters are unescaped into - unicode characters. For example: `bu\tton, .\31 00, #i\2764\FE0Fu, [attr="value is \"quoted\""]` - will parse respectively to the values `button`, `100`, `i❤️u`, `value is "quoted"`. - The original escape sequences for these values can be found in the corresponding property name - in `node.raws`. Where possible, deprecation warnings were added, but the nature - of escape handling makes it impossible to detect what is escaped or not. Our expectation is - that most users are neither expecting nor handling escape sequences in their use of this library, - and so for them, this is a bug fix. Users who are taking care to handle escapes correctly can - now update their code to remove the escape handling and let us do it for them. - -* **Mutating values with escapes** - When you make an update to a node property that has escape handling - The value is assumed to be unescaped, and any special characters are escaped automatically and - the corresponding `raws` value is immediately updated. This can result in changes to the original - escape format. Where the exact value of the escape sequence is important there are methods that - allow both values to be set in conjunction. There are a number of new convenience methods for - manipulating values that involve escapes, especially for attributes values where the quote mark - is involved. See https://github.com/postcss/postcss-selector-parser/pull/133 for an extensive - write-up on these changes. - - -**Upgrade/API Example** - -In `3.x` there was no unescape handling and internal consistency of several properties was the caller's job to maintain. It was very easy for the developer -to create a CSS file that did not parse correctly when some types of values -were in use. - -```js -const selectorParser = require("postcss-selector-parser"); -let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value"}); -attr.value; // => "a-value" -attr.toString(); // => [id=a-value] -// Add quotes to an attribute's value. -// All these values have to be set by the caller to be consistent: -// no internal consistency is maintained. -attr.raws.unquoted = attr.value -attr.value = "'" + attr.value + "'"; -attr.value; // => "'a-value'" -attr.quoted = true; -attr.toString(); // => "[id='a-value']" -``` - -In `4.0` there is a convenient API for setting and mutating values -that may need escaping. Especially for attributes. - -```js -const selectorParser = require("postcss-selector-parser"); - -// The constructor requires you specify the exact escape sequence -let className = selectorParser.className({value: "illegal class name", raws: {value: "illegal\\ class\\ name"}}); -className.toString(); // => '.illegal\\ class\\ name' - -// So it's better to set the value as a property -className = selectorParser.className(); -// Most properties that deal with identifiers work like this -className.value = "escape for me"; -className.value; // => 'escape for me' -className.toString(); // => '.escape\\ for\\ me' - -// emoji and all non-ascii are escaped to ensure it works in every css file. -className.value = "😱🦄😍"; -className.value; // => '😱🦄😍' -className.toString(); // => '.\\1F631\\1F984\\1F60D' - -// you can control the escape sequence if you want, or do bad bad things -className.setPropertyAndEscape('value', 'xxxx', 'yyyy'); -className.value; // => "xxxx" -className.toString(); // => ".yyyy" - -// Pass a value directly through to the css output without escaping it. -className.setPropertyWithoutEscape('value', '$REPLACE_ME$'); -className.value; // => "$REPLACE_ME$" -className.toString(); // => ".$REPLACE_ME$" - -// The biggest changes are to the Attribute class -// passing quoteMark explicitly is required to avoid a deprecation warning. -let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value", quoteMark: null}); -attr.toString(); // => "[id=a-value]" -// Get the value with quotes on it and any necessary escapes. -// This is the same as reading attr.value in 3.x. -attr.getQuotedValue(); // => "a-value"; -attr.quoteMark; // => null - -// Add quotes to an attribute's value. -attr.quoteMark = "'"; // This is all that's required. -attr.toString(); // => "[id='a-value']" -attr.quoted; // => true -// The value is still the same, only the quotes have changed. -attr.value; // => a-value -attr.getQuotedValue(); // => "'a-value'"; - -// deprecated assignment, no warning because there's no escapes -attr.value = "new-value"; -// no quote mark is needed so it is removed -attr.getQuotedValue(); // => "new-value"; - -// deprecated assignment, -attr.value = "\"a 'single quoted' value\""; -// > (node:27859) DeprecationWarning: Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead. -attr.getQuotedValue(); // => '"a \'single quoted\' value"'; -// quote mark inferred from first and last characters. -attr.quoteMark; // => '"' - -// setValue takes options to make manipulating the value simple. -attr.setValue('foo', {smart: true}); -// foo doesn't require any escapes or quotes. -attr.toString(); // => '[id=foo]' -attr.quoteMark; // => null - -// An explicit quote mark can be specified -attr.setValue('foo', {quoteMark: '"'}); -attr.toString(); // => '[id="foo"]' - -// preserves quote mark by default -attr.setValue('bar'); -attr.toString(); // => '[id="bar"]' -attr.quoteMark = null; -attr.toString(); // => '[id=bar]' - -// with no arguments, it preserves quote mark even when it's not a great idea -attr.setValue('a value \n that should be quoted'); -attr.toString(); // => '[id=a\\ value\\ \\A\\ that\\ should\\ be\\ quoted]' - -// smart preservation with a specified default -attr.setValue('a value \n that should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"}); -// => "[id='a value \\A that should be quoted']" -attr.quoteMark = '"'; -// => '[id="a value \\A that should be quoted"]' - -// this keeps double quotes because it wants to quote the value and the existing value has double quotes. -attr.setValue('this should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"}); -// => '[id="this should be quoted"]' - -// picks single quotes because the value has double quotes -attr.setValue('a "double quoted" value', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"}); -// => "[id='a "double quoted" value']" - -// setPropertyAndEscape lets you do anything you want. Even things that are a bad idea and illegal. -attr.setPropertyAndEscape('value', 'xxxx', 'the password is 42'); -attr.value; // => "xxxx" -attr.toString(); // => "[id=the password is 42]" - -// Pass a value directly through to the css output without escaping it. -attr.setPropertyWithoutEscape('value', '$REPLACEMENT$'); -attr.value; // => "$REPLACEMENT$" -attr.toString(); // => "[id=$REPLACEMENT$]" -``` - -# 3.1.2 - -* Fix: Removed dot-prop dependency since it's no longer written in es5. - -# 3.1.1 - -* Fix: typescript definitions weren't in the published package. - -# 3.1.0 - -* Fixed numerous bugs in attribute nodes relating to the handling of comments - and whitespace. There's significant changes to `attrNode.spaces` and `attrNode.raws` since the `3.0.0` release. -* Added `Attribute#offsetOf(part)` to get the offset location of - attribute parts like `"operator"` and `"value"`. This is most - often added to `Attribute#sourceIndex` for error reporting. - -# 3.0.0 - -## Breaking changes - -* Some tweaks to the tokenizer/attribute selector parsing mean that whitespace - locations might be slightly different to the 2.x code. -* Better attribute selector parsing with more validation; postcss-selector-parser - no longer uses regular expressions to parse attribute selectors. -* Added an async API (thanks to @jacobp100); the default `process` API is now - async, and the sync API is now accessed through `processSync` instead. -* `process()` and `processSync()` now return a string instead of the Processor - instance. -* Tweaks handling of Less interpolation (thanks to @jwilsson). -* Removes support for Node 0.12. - -## Other changes - -* `ast()` and `astSync()` methods have been added to the `Processor`. These - return the `Root` node of the selectors after processing them. -* `transform()` and `transformSync()` methods have been added to the - `Processor`. These return the value returned by the processor callback - after processing the selectors. -* Set the parent when inserting a node (thanks to @chriseppstein). -* Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac). -* Fixes handling of namespaces with qualified tag selectors. -* `process`, `ast` and `transform` (and their sync variants) now accept a - `postcss` rule node. When provided, better errors are generated and selector - processing is automatically set back to the rule selector (unless the `updateSelector` option is set to `false`.) -* Now more memory efficient when tokenizing selectors. - -### Upgrade hints - -The pattern of: - -`rule.selector = processor.process(rule.selector).result.toString();` - -is now: - -`processor.processSync(rule)` - -# 2.2.3 - -* Resolves an issue where the parser would not reduce multiple spaces between an - ampersand and another simple selector in lossy mode (thanks to @adam-26). - -# 2.2.2 - -* No longer hangs on an unescaped semicolon; instead the parser will throw - an exception for these cases. - -# 2.2.1 - -* Allows a consumer to specify whitespace tokens when creating a new Node - (thanks to @Semigradsky). - -# 2.2.0 - -* Added a new option to normalize whitespace when parsing the selector string - (thanks to @adam-26). - -# 2.1.1 - -* Better unquoted value handling within attribute selectors - (thanks to @evilebottnawi). - -# 2.1.0 - -* Added: Use string constants for all node types & expose them on the main - parser instance (thanks to @Aweary). - -# 2.0.0 - -This release contains the following breaking changes: - -* Renamed all `eachInside` iterators to `walk`. For example, `eachTag` is now - `walkTags`, and `eachInside` is now `walk`. -* Renamed `Node#removeSelf()` to `Node#remove()`. -* Renamed `Container#remove()` to `Container#removeChild()`. -* Renamed `Node#raw` to `Node#raws` (thanks to @davidtheclark). -* Now parses `&` as the *nesting* selector, rather than a *tag* selector. -* Fixes misinterpretation of Sass interpolation (e.g. `#{foo}`) as an - id selector (thanks to @davidtheclark). - -and; - -* Fixes parsing of attribute selectors with equals signs in them - (e.g. `[data-attr="foo=bar"]`) (thanks to @montmanu). -* Adds `quoted` and `raw.unquoted` properties to attribute nodes - (thanks to @davidtheclark). - -# 1.3.3 - -* Fixes an infinite loop on `)` and `]` tokens when they had no opening pairs. - Now postcss-selector-parser will throw when it encounters these lone tokens. - -# 1.3.2 - -* Now uses plain integers rather than `str.charCodeAt(0)` for compiled builds. - -# 1.3.1 - -* Update flatten to v1.x (thanks to @shinnn). - -# 1.3.0 - -* Adds a new node type, `String`, to fix a crash on selectors such as - `foo:bar("test")`. - -# 1.2.1 - -* Fixes a crash when the parser encountered a trailing combinator. - -# 1.2.0 - -* A more descriptive error is thrown when the parser expects to find a - pseudo-class/pseudo-element (thanks to @ashelley). -* Adds support for line/column locations for selector nodes, as well as a - `Node#sourceIndex` method (thanks to @davidtheclark). - -# 1.1.4 - -* Fixes a crash when a selector started with a `>` combinator. The module will - now no longer throw if a selector has a leading/trailing combinator node. - -# 1.1.3 - -* Fixes a crash on `@` tokens. - -# 1.1.2 - -* Fixes an infinite loop caused by using parentheses in a non-pseudo element - context. - -# 1.1.1 - -* Fixes a crash when a backslash ended a selector string. - -# 1.1.0 - -* Adds support for replacing multiple nodes at once with `replaceWith` - (thanks to @jonathantneal). -* Parser no longer throws on sequential IDs and trailing commas, to support - parsing of selector hacks. - -# 1.0.1 - -* Fixes using `insertAfter` and `insertBefore` during iteration. - -# 1.0.0 - -* Adds `clone` and `replaceWith` methods to nodes. -* Adds `insertBefore` and `insertAfter` to containers. -* Stabilises API. - -# 0.0.5 - -* Fixes crash on extra whitespace inside a pseudo selector's parentheses. -* Adds sort function to the container class. -* Enables the parser to pass its input through without transforming. -* Iteration-safe `each` and `eachInside`. - -# 0.0.4 - -* Tidy up redundant duplication. -* Fixes a bug where the parser would loop infinitely on universal selectors - inside pseudo selectors. -* Adds `length` getter and `eachInside`, `map`, `reduce` to the container class. -* When a selector has been removed from the tree, the root node will no longer - cast it to a string. -* Adds node type iterators to the container class (e.g. `eachComment`). -* Adds filter function to the container class. -* Adds split function to the container class. -* Create new node types by doing `parser.id(opts)` etc. -* Adds support for pseudo classes anywhere in the selector. - -# 0.0.3 - -* Adds `next` and `prev` to the node class. -* Adds `first` and `last` getters to the container class. -* Adds `every` and `some` iterators to the container class. -* Add `empty` alias for `removeAll`. -* Combinators are now types of node. -* Fixes the at method so that it is not an alias for `index`. -* Tidy up creation of new nodes in the parser. -* Refactors how namespaces are handled for consistency & less redundant code. -* Refactors AST to use `nodes` exclusively, and eliminates excessive nesting. -* Fixes nested pseudo parsing. -* Fixes whitespace parsing. - -# 0.0.2 - -* Adds support for namespace selectors. -* Adds support for selectors joined by escaped spaces - such as `.\31\ 0`. - -# 0.0.1 - -* Initial release. diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/LICENSE-MIT b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/LICENSE-MIT deleted file mode 100644 index fd0e863a614fbcfc11bcfd0836975d1f5bfeb191..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) Ben Briggs (http://beneb.info) - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/README.md b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/README.md deleted file mode 100644 index 18a01c5c89df6f34d31f37e24b67e1155aedcfe0..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# postcss-selector-parser [![Build Status](https://travis-ci.org/postcss/postcss-selector-parser.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-parser) - -> Selector parser with built in methods for working with selector strings. - -## Install - -With [npm](https://npmjs.com/package/postcss-selector-parser) do: - -``` -npm install postcss-selector-parser -``` - -## Quick Start - -```js -const parser = require('postcss-selector-parser'); -const transform = selectors => { - selectors.walk(selector => { - // do something with the selector - console.log(String(selector)) - }); -}; - -const transformed = parser(transform).processSync('h1, h2, h3'); -``` - -To normalize selector whitespace: - -```js -const parser = require('postcss-selector-parser'); -const normalized = parser().processSync('h1, h2, h3', {lossless: false}); -// -> h1,h2,h3 -``` - -Async support is provided through `parser.process` and will resolve a Promise -with the resulting selector string. - -## API - -Please see [API.md](API.md). - -## Credits - -* Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped - accelerate this module's development. - -## License - -MIT diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/index.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/index.js deleted file mode 100644 index 6e76a32bdd44266f91ef4ca8c06441205e000ed2..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _processor = _interopRequireDefault(require("./processor")); - -var selectors = _interopRequireWildcard(require("./selectors")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var parser = function parser(processor) { - return new _processor["default"](processor); -}; - -Object.assign(parser, selectors); -delete parser.__esModule; -var _default = parser; -exports["default"] = _default; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/parser.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/parser.js deleted file mode 100644 index e0451de00f43e74f850785f297c85e5c0ec8acdd..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/parser.js +++ /dev/null @@ -1,1243 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _root = _interopRequireDefault(require("./selectors/root")); - -var _selector = _interopRequireDefault(require("./selectors/selector")); - -var _className = _interopRequireDefault(require("./selectors/className")); - -var _comment = _interopRequireDefault(require("./selectors/comment")); - -var _id = _interopRequireDefault(require("./selectors/id")); - -var _tag = _interopRequireDefault(require("./selectors/tag")); - -var _string = _interopRequireDefault(require("./selectors/string")); - -var _pseudo = _interopRequireDefault(require("./selectors/pseudo")); - -var _attribute = _interopRequireWildcard(require("./selectors/attribute")); - -var _universal = _interopRequireDefault(require("./selectors/universal")); - -var _combinator = _interopRequireDefault(require("./selectors/combinator")); - -var _nesting = _interopRequireDefault(require("./selectors/nesting")); - -var _sortAscending = _interopRequireDefault(require("./sortAscending")); - -var _tokenize = _interopRequireWildcard(require("./tokenize")); - -var tokens = _interopRequireWildcard(require("./tokenTypes")); - -var types = _interopRequireWildcard(require("./selectors/types")); - -var _util = require("./util"); - -var _WHITESPACE_TOKENS, _Object$assign; - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); -var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); - -function tokenStart(token) { - return { - line: token[_tokenize.FIELDS.START_LINE], - column: token[_tokenize.FIELDS.START_COL] - }; -} - -function tokenEnd(token) { - return { - line: token[_tokenize.FIELDS.END_LINE], - column: token[_tokenize.FIELDS.END_COL] - }; -} - -function getSource(startLine, startColumn, endLine, endColumn) { - return { - start: { - line: startLine, - column: startColumn - }, - end: { - line: endLine, - column: endColumn - } - }; -} - -function getTokenSource(token) { - return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); -} - -function getTokenSourceSpan(startToken, endToken) { - if (!startToken) { - return undefined; - } - - return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); -} - -function unescapeProp(node, prop) { - var value = node[prop]; - - if (typeof value !== "string") { - return; - } - - if (value.indexOf("\\") !== -1) { - (0, _util.ensureObject)(node, 'raws'); - node[prop] = (0, _util.unesc)(value); - - if (node.raws[prop] === undefined) { - node.raws[prop] = value; - } - } - - return node; -} - -function indexesOf(array, item) { - var i = -1; - var indexes = []; - - while ((i = array.indexOf(item, i + 1)) !== -1) { - indexes.push(i); - } - - return indexes; -} - -function uniqs() { - var list = Array.prototype.concat.apply([], arguments); - return list.filter(function (item, i) { - return i === list.indexOf(item); - }); -} - -var Parser = /*#__PURE__*/function () { - function Parser(rule, options) { - if (options === void 0) { - options = {}; - } - - this.rule = rule; - this.options = Object.assign({ - lossy: false, - safe: false - }, options); - this.position = 0; - this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; - this.tokens = (0, _tokenize["default"])({ - css: this.css, - error: this._errorGenerator(), - safe: this.options.safe - }); - var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); - this.root = new _root["default"]({ - source: rootSource - }); - this.root.errorGenerator = this._errorGenerator(); - var selector = new _selector["default"]({ - source: { - start: { - line: 1, - column: 1 - } - } - }); - this.root.append(selector); - this.current = selector; - this.loop(); - } - - var _proto = Parser.prototype; - - _proto._errorGenerator = function _errorGenerator() { - var _this = this; - - return function (message, errorOptions) { - if (typeof _this.rule === 'string') { - return new Error(message); - } - - return _this.rule.error(message, errorOptions); - }; - }; - - _proto.attribute = function attribute() { - var attr = []; - var startingToken = this.currToken; - this.position++; - - while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { - attr.push(this.currToken); - this.position++; - } - - if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { - return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); - } - - var len = attr.length; - var node = { - source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), - sourceIndex: startingToken[_tokenize.FIELDS.START_POS] - }; - - if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { - return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); - } - - var pos = 0; - var spaceBefore = ''; - var commentBefore = ''; - var lastAdded = null; - var spaceAfterMeaningfulToken = false; - - while (pos < len) { - var token = attr[pos]; - var content = this.content(token); - var next = attr[pos + 1]; - - switch (token[_tokenize.FIELDS.TYPE]) { - case tokens.space: - // if ( - // len === 1 || - // pos === 0 && this.content(next) === '|' - // ) { - // return this.expected('attribute', token[TOKEN.START_POS], content); - // } - spaceAfterMeaningfulToken = true; - - if (this.options.lossy) { - break; - } - - if (lastAdded) { - (0, _util.ensureObject)(node, 'spaces', lastAdded); - var prevContent = node.spaces[lastAdded].after || ''; - node.spaces[lastAdded].after = prevContent + content; - var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; - - if (existingComment) { - node.raws.spaces[lastAdded].after = existingComment + content; - } - } else { - spaceBefore = spaceBefore + content; - commentBefore = commentBefore + content; - } - - break; - - case tokens.asterisk: - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { - if (spaceBefore) { - (0, _util.ensureObject)(node, 'spaces', 'attribute'); - node.spaces.attribute.before = spaceBefore; - spaceBefore = ''; - } - - if (commentBefore) { - (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); - node.raws.spaces.attribute.before = spaceBefore; - commentBefore = ''; - } - - node.namespace = (node.namespace || "") + content; - var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; - - if (rawValue) { - node.raws.namespace += content; - } - - lastAdded = 'namespace'; - } - - spaceAfterMeaningfulToken = false; - break; - - case tokens.dollar: - if (lastAdded === "value") { - var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); - node.value += "$"; - - if (oldRawValue) { - node.raws.value = oldRawValue + "$"; - } - - break; - } - - // Falls through - - case tokens.caret: - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } - - spaceAfterMeaningfulToken = false; - break; - - case tokens.combinator: - if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } - - if (content !== '|') { - spaceAfterMeaningfulToken = false; - break; - } - - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = 'operator'; - } else if (!node.namespace && !node.attribute) { - node.namespace = true; - } - - spaceAfterMeaningfulToken = false; - break; - - case tokens.word: - if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved. - !node.operator && !node.namespace) { - node.namespace = content; - lastAdded = 'namespace'; - } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { - if (spaceBefore) { - (0, _util.ensureObject)(node, 'spaces', 'attribute'); - node.spaces.attribute.before = spaceBefore; - spaceBefore = ''; - } - - if (commentBefore) { - (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); - node.raws.spaces.attribute.before = commentBefore; - commentBefore = ''; - } - - node.attribute = (node.attribute || "") + content; - - var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; - - if (_rawValue) { - node.raws.attribute += content; - } - - lastAdded = 'attribute'; - } else if (!node.value && node.value !== "" || lastAdded === "value" && !spaceAfterMeaningfulToken) { - var _unescaped = (0, _util.unesc)(content); - - var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; - - var oldValue = node.value || ''; - node.value = oldValue + _unescaped; - node.quoteMark = null; - - if (_unescaped !== content || _oldRawValue) { - (0, _util.ensureObject)(node, 'raws'); - node.raws.value = (_oldRawValue || oldValue) + content; - } - - lastAdded = 'value'; - } else { - var insensitive = content === 'i' || content === "I"; - - if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { - node.insensitive = insensitive; - - if (!insensitive || content === "I") { - (0, _util.ensureObject)(node, 'raws'); - node.raws.insensitiveFlag = content; - } - - lastAdded = 'insensitive'; - - if (spaceBefore) { - (0, _util.ensureObject)(node, 'spaces', 'insensitive'); - node.spaces.insensitive.before = spaceBefore; - spaceBefore = ''; - } - - if (commentBefore) { - (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); - node.raws.spaces.insensitive.before = commentBefore; - commentBefore = ''; - } - } else if (node.value || node.value === '') { - lastAdded = 'value'; - node.value += content; - - if (node.raws.value) { - node.raws.value += content; - } - } - } - - spaceAfterMeaningfulToken = false; - break; - - case tokens.str: - if (!node.attribute || !node.operator) { - return this.error("Expected an attribute followed by an operator preceding the string.", { - index: token[_tokenize.FIELDS.START_POS] - }); - } - - var _unescapeValue = (0, _attribute.unescapeValue)(content), - unescaped = _unescapeValue.unescaped, - quoteMark = _unescapeValue.quoteMark; - - node.value = unescaped; - node.quoteMark = quoteMark; - lastAdded = 'value'; - (0, _util.ensureObject)(node, 'raws'); - node.raws.value = content; - spaceAfterMeaningfulToken = false; - break; - - case tokens.equals: - if (!node.attribute) { - return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); - } - - if (node.value) { - return this.error('Unexpected "=" found; an operator was already defined.', { - index: token[_tokenize.FIELDS.START_POS] - }); - } - - node.operator = node.operator ? node.operator + content : content; - lastAdded = 'operator'; - spaceAfterMeaningfulToken = false; - break; - - case tokens.comment: - if (lastAdded) { - if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { - var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; - var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; - (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); - node.raws.spaces[lastAdded].after = rawLastComment + content; - } else { - var lastValue = node[lastAdded] || ''; - var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; - (0, _util.ensureObject)(node, 'raws'); - node.raws[lastAdded] = rawLastValue + content; - } - } else { - commentBefore = commentBefore + content; - } - - break; - - default: - return this.error("Unexpected \"" + content + "\" found.", { - index: token[_tokenize.FIELDS.START_POS] - }); - } - - pos++; - } - - unescapeProp(node, "attribute"); - unescapeProp(node, "namespace"); - this.newNode(new _attribute["default"](node)); - this.position++; - } - /** - * return a node containing meaningless garbage up to (but not including) the specified token position. - * if the token position is negative, all remaining tokens are consumed. - * - * This returns an array containing a single string node if all whitespace, - * otherwise an array of comment nodes with space before and after. - * - * These tokens are not added to the current selector, the caller can add them or use them to amend - * a previous node's space metadata. - * - * In lossy mode, this returns only comments. - */ - ; - - _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { - if (stopPosition < 0) { - stopPosition = this.tokens.length; - } - - var startPosition = this.position; - var nodes = []; - var space = ""; - var lastComment = undefined; - - do { - if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { - if (!this.options.lossy) { - space += this.content(); - } - } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { - var spaces = {}; - - if (space) { - spaces.before = space; - space = ""; - } - - lastComment = new _comment["default"]({ - value: this.content(), - source: getTokenSource(this.currToken), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], - spaces: spaces - }); - nodes.push(lastComment); - } - } while (++this.position < stopPosition); - - if (space) { - if (lastComment) { - lastComment.spaces.after = space; - } else if (!this.options.lossy) { - var firstToken = this.tokens[startPosition]; - var lastToken = this.tokens[this.position - 1]; - nodes.push(new _string["default"]({ - value: '', - source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), - sourceIndex: firstToken[_tokenize.FIELDS.START_POS], - spaces: { - before: space, - after: '' - } - })); - } - } - - return nodes; - } - /** - * - * @param {*} nodes - */ - ; - - _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { - var _this2 = this; - - if (requiredSpace === void 0) { - requiredSpace = false; - } - - var space = ""; - var rawSpace = ""; - nodes.forEach(function (n) { - var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); - - var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); - - space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); - rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); - }); - - if (rawSpace === space) { - rawSpace = undefined; - } - - var result = { - space: space, - rawSpace: rawSpace - }; - return result; - }; - - _proto.isNamedCombinator = function isNamedCombinator(position) { - if (position === void 0) { - position = this.position; - } - - return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; - }; - - _proto.namedCombinator = function namedCombinator() { - if (this.isNamedCombinator()) { - var nameRaw = this.content(this.tokens[this.position + 1]); - var name = (0, _util.unesc)(nameRaw).toLowerCase(); - var raws = {}; - - if (name !== nameRaw) { - raws.value = "/" + nameRaw + "/"; - } - - var node = new _combinator["default"]({ - value: "/" + name + "/", - source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], - raws: raws - }); - this.position = this.position + 3; - return node; - } else { - this.unexpected(); - } - }; - - _proto.combinator = function combinator() { - var _this3 = this; - - if (this.content() === '|') { - return this.namespace(); - } // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. - - - var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); - - if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) { - var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); - - if (nodes.length > 0) { - var last = this.current.last; - - if (last) { - var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), - space = _this$convertWhitespa.space, - rawSpace = _this$convertWhitespa.rawSpace; - - if (rawSpace !== undefined) { - last.rawSpaceAfter += rawSpace; - } - - last.spaces.after += space; - } else { - nodes.forEach(function (n) { - return _this3.newNode(n); - }); - } - } - - return; - } - - var firstToken = this.currToken; - var spaceOrDescendantSelectorNodes = undefined; - - if (nextSigTokenPos > this.position) { - spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); - } - - var node; - - if (this.isNamedCombinator()) { - node = this.namedCombinator(); - } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { - node = new _combinator["default"]({ - value: this.content(), - source: getTokenSource(this.currToken), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] - }); - this.position++; - } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {// pass - } else if (!spaceOrDescendantSelectorNodes) { - this.unexpected(); - } - - if (node) { - if (spaceOrDescendantSelectorNodes) { - var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), - _space = _this$convertWhitespa2.space, - _rawSpace = _this$convertWhitespa2.rawSpace; - - node.spaces.before = _space; - node.rawSpaceBefore = _rawSpace; - } - } else { - // descendant combinator - var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), - _space2 = _this$convertWhitespa3.space, - _rawSpace2 = _this$convertWhitespa3.rawSpace; - - if (!_rawSpace2) { - _rawSpace2 = _space2; - } - - var spaces = {}; - var raws = { - spaces: {} - }; - - if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { - spaces.before = _space2.slice(0, _space2.length - 1); - raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); - } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { - spaces.after = _space2.slice(1); - raws.spaces.after = _rawSpace2.slice(1); - } else { - raws.value = _rawSpace2; - } - - node = new _combinator["default"]({ - value: ' ', - source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), - sourceIndex: firstToken[_tokenize.FIELDS.START_POS], - spaces: spaces, - raws: raws - }); - } - - if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { - node.spaces.after = this.optionalSpace(this.content()); - this.position++; - } - - return this.newNode(node); - }; - - _proto.comma = function comma() { - if (this.position === this.tokens.length - 1) { - this.root.trailingComma = true; - this.position++; - return; - } - - this.current._inferEndPosition(); - - var selector = new _selector["default"]({ - source: { - start: tokenStart(this.tokens[this.position + 1]) - } - }); - this.current.parent.append(selector); - this.current = selector; - this.position++; - }; - - _proto.comment = function comment() { - var current = this.currToken; - this.newNode(new _comment["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - - _proto.error = function error(message, opts) { - throw this.root.error(message, opts); - }; - - _proto.missingBackslash = function missingBackslash() { - return this.error('Expected a backslash preceding the semicolon.', { - index: this.currToken[_tokenize.FIELDS.START_POS] - }); - }; - - _proto.missingParenthesis = function missingParenthesis() { - return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); - }; - - _proto.missingSquareBracket = function missingSquareBracket() { - return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); - }; - - _proto.unexpected = function unexpected() { - return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); - }; - - _proto.namespace = function namespace() { - var before = this.prevToken && this.content(this.prevToken) || true; - - if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { - this.position++; - return this.word(before); - } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { - this.position++; - return this.universal(before); - } - }; - - _proto.nesting = function nesting() { - if (this.nextToken) { - var nextContent = this.content(this.nextToken); - - if (nextContent === "|") { - this.position++; - return; - } - } - - var current = this.currToken; - this.newNode(new _nesting["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - - _proto.parentheses = function parentheses() { - var last = this.current.last; - var unbalanced = 1; - this.position++; - - if (last && last.type === types.PSEUDO) { - var selector = new _selector["default"]({ - source: { - start: tokenStart(this.tokens[this.position - 1]) - } - }); - var cache = this.current; - last.append(selector); - this.current = selector; - - while (this.position < this.tokens.length && unbalanced) { - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - unbalanced++; - } - - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - unbalanced--; - } - - if (unbalanced) { - this.parse(); - } else { - this.current.source.end = tokenEnd(this.currToken); - this.current.parent.source.end = tokenEnd(this.currToken); - this.position++; - } - } - - this.current = cache; - } else { - // I think this case should be an error. It's used to implement a basic parse of media queries - // but I don't think it's a good idea. - var parenStart = this.currToken; - var parenValue = "("; - var parenEnd; - - while (this.position < this.tokens.length && unbalanced) { - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - unbalanced++; - } - - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - unbalanced--; - } - - parenEnd = this.currToken; - parenValue += this.parseParenthesisToken(this.currToken); - this.position++; - } - - if (last) { - last.appendToPropertyAndEscape("value", parenValue, parenValue); - } else { - this.newNode(new _string["default"]({ - value: parenValue, - source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), - sourceIndex: parenStart[_tokenize.FIELDS.START_POS] - })); - } - } - - if (unbalanced) { - return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); - } - }; - - _proto.pseudo = function pseudo() { - var _this4 = this; - - var pseudoStr = ''; - var startingToken = this.currToken; - - while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { - pseudoStr += this.content(); - this.position++; - } - - if (!this.currToken) { - return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); - } - - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { - this.splitWord(false, function (first, length) { - pseudoStr += first; - - _this4.newNode(new _pseudo["default"]({ - value: pseudoStr, - source: getTokenSourceSpan(startingToken, _this4.currToken), - sourceIndex: startingToken[_tokenize.FIELDS.START_POS] - })); - - if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - _this4.error('Misplaced parenthesis.', { - index: _this4.nextToken[_tokenize.FIELDS.START_POS] - }); - } - }); - } else { - return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); - } - }; - - _proto.space = function space() { - var content = this.content(); // Handle space before and after the selector - - if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { - return node.type === 'comment'; - })) { - this.spaces = this.optionalSpace(content); - this.position++; - } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - this.current.last.spaces.after = this.optionalSpace(content); - this.position++; - } else { - this.combinator(); - } - }; - - _proto.string = function string() { - var current = this.currToken; - this.newNode(new _string["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - - _proto.universal = function universal(namespace) { - var nextToken = this.nextToken; - - if (nextToken && this.content(nextToken) === '|') { - this.position++; - return this.namespace(); - } - - var current = this.currToken; - this.newNode(new _universal["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - }), namespace); - this.position++; - }; - - _proto.splitWord = function splitWord(namespace, firstCallback) { - var _this5 = this; - - var nextToken = this.nextToken; - var word = this.content(); - - while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { - this.position++; - var current = this.content(); - word += current; - - if (current.lastIndexOf('\\') === current.length - 1) { - var next = this.nextToken; - - if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { - word += this.requiredSpace(this.content(next)); - this.position++; - } - } - - nextToken = this.nextToken; - } - - var hasClass = indexesOf(word, '.').filter(function (i) { - // Allow escaped dot within class name - var escapedDot = word[i - 1] === '\\'; // Allow decimal numbers percent in @keyframes - - var isKeyframesPercent = /^\d+\.\d+%$/.test(word); - return !escapedDot && !isKeyframesPercent; - }); - var hasId = indexesOf(word, '#').filter(function (i) { - return word[i - 1] !== '\\'; - }); // Eliminate Sass interpolations from the list of id indexes - - var interpolations = indexesOf(word, '#{'); - - if (interpolations.length) { - hasId = hasId.filter(function (hashIndex) { - return !~interpolations.indexOf(hashIndex); - }); - } - - var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); - indices.forEach(function (ind, i) { - var index = indices[i + 1] || word.length; - var value = word.slice(ind, index); - - if (i === 0 && firstCallback) { - return firstCallback.call(_this5, value, indices.length); - } - - var node; - var current = _this5.currToken; - var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; - var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); - - if (~hasClass.indexOf(ind)) { - var classNameOpts = { - value: value.slice(1), - source: source, - sourceIndex: sourceIndex - }; - node = new _className["default"](unescapeProp(classNameOpts, "value")); - } else if (~hasId.indexOf(ind)) { - var idOpts = { - value: value.slice(1), - source: source, - sourceIndex: sourceIndex - }; - node = new _id["default"](unescapeProp(idOpts, "value")); - } else { - var tagOpts = { - value: value, - source: source, - sourceIndex: sourceIndex - }; - unescapeProp(tagOpts, "value"); - node = new _tag["default"](tagOpts); - } - - _this5.newNode(node, namespace); // Ensure that the namespace is used only once - - - namespace = null; - }); - this.position++; - }; - - _proto.word = function word(namespace) { - var nextToken = this.nextToken; - - if (nextToken && this.content(nextToken) === '|') { - this.position++; - return this.namespace(); - } - - return this.splitWord(namespace); - }; - - _proto.loop = function loop() { - while (this.position < this.tokens.length) { - this.parse(true); - } - - this.current._inferEndPosition(); - - return this.root; - }; - - _proto.parse = function parse(throwOnParenthesis) { - switch (this.currToken[_tokenize.FIELDS.TYPE]) { - case tokens.space: - this.space(); - break; - - case tokens.comment: - this.comment(); - break; - - case tokens.openParenthesis: - this.parentheses(); - break; - - case tokens.closeParenthesis: - if (throwOnParenthesis) { - this.missingParenthesis(); - } - - break; - - case tokens.openSquare: - this.attribute(); - break; - - case tokens.dollar: - case tokens.caret: - case tokens.equals: - case tokens.word: - this.word(); - break; - - case tokens.colon: - this.pseudo(); - break; - - case tokens.comma: - this.comma(); - break; - - case tokens.asterisk: - this.universal(); - break; - - case tokens.ampersand: - this.nesting(); - break; - - case tokens.slash: - case tokens.combinator: - this.combinator(); - break; - - case tokens.str: - this.string(); - break; - // These cases throw; no break needed. - - case tokens.closeSquare: - this.missingSquareBracket(); - - case tokens.semicolon: - this.missingBackslash(); - - default: - this.unexpected(); - } - } - /** - * Helpers - */ - ; - - _proto.expected = function expected(description, index, found) { - if (Array.isArray(description)) { - var last = description.pop(); - description = description.join(', ') + " or " + last; - } - - var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; - - if (!found) { - return this.error("Expected " + an + " " + description + ".", { - index: index - }); - } - - return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { - index: index - }); - }; - - _proto.requiredSpace = function requiredSpace(space) { - return this.options.lossy ? ' ' : space; - }; - - _proto.optionalSpace = function optionalSpace(space) { - return this.options.lossy ? '' : space; - }; - - _proto.lossySpace = function lossySpace(space, required) { - if (this.options.lossy) { - return required ? ' ' : ''; - } else { - return space; - } - }; - - _proto.parseParenthesisToken = function parseParenthesisToken(token) { - var content = this.content(token); - - if (token[_tokenize.FIELDS.TYPE] === tokens.space) { - return this.requiredSpace(content); - } else { - return content; - } - }; - - _proto.newNode = function newNode(node, namespace) { - if (namespace) { - if (/^ +$/.test(namespace)) { - if (!this.options.lossy) { - this.spaces = (this.spaces || '') + namespace; - } - - namespace = true; - } - - node.namespace = namespace; - unescapeProp(node, "namespace"); - } - - if (this.spaces) { - node.spaces.before = this.spaces; - this.spaces = ''; - } - - return this.current.append(node); - }; - - _proto.content = function content(token) { - if (token === void 0) { - token = this.currToken; - } - - return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); - }; - - /** - * returns the index of the next non-whitespace, non-comment token. - * returns -1 if no meaningful token is found. - */ - _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { - if (startPosition === void 0) { - startPosition = this.position + 1; - } - - var searchPosition = startPosition; - - while (searchPosition < this.tokens.length) { - if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { - searchPosition++; - continue; - } else { - return searchPosition; - } - } - - return -1; - }; - - _createClass(Parser, [{ - key: "currToken", - get: function get() { - return this.tokens[this.position]; - } - }, { - key: "nextToken", - get: function get() { - return this.tokens[this.position + 1]; - } - }, { - key: "prevToken", - get: function get() { - return this.tokens[this.position - 1]; - } - }]); - - return Parser; -}(); - -exports["default"] = Parser; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/processor.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/processor.js deleted file mode 100644 index a00170c281f96684d45901c471cf84c1e6edd8ea..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/processor.js +++ /dev/null @@ -1,206 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _parser = _interopRequireDefault(require("./parser")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var Processor = /*#__PURE__*/function () { - function Processor(func, options) { - this.func = func || function noop() {}; - - this.funcRes = null; - this.options = options; - } - - var _proto = Processor.prototype; - - _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { - if (options === void 0) { - options = {}; - } - - var merged = Object.assign({}, this.options, options); - - if (merged.updateSelector === false) { - return false; - } else { - return typeof rule !== "string"; - } - }; - - _proto._isLossy = function _isLossy(options) { - if (options === void 0) { - options = {}; - } - - var merged = Object.assign({}, this.options, options); - - if (merged.lossless === false) { - return true; - } else { - return false; - } - }; - - _proto._root = function _root(rule, options) { - if (options === void 0) { - options = {}; - } - - var parser = new _parser["default"](rule, this._parseOptions(options)); - return parser.root; - }; - - _proto._parseOptions = function _parseOptions(options) { - return { - lossy: this._isLossy(options) - }; - }; - - _proto._run = function _run(rule, options) { - var _this = this; - - if (options === void 0) { - options = {}; - } - - return new Promise(function (resolve, reject) { - try { - var root = _this._root(rule, options); - - Promise.resolve(_this.func(root)).then(function (transform) { - var string = undefined; - - if (_this._shouldUpdateSelector(rule, options)) { - string = root.toString(); - rule.selector = string; - } - - return { - transform: transform, - root: root, - string: string - }; - }).then(resolve, reject); - } catch (e) { - reject(e); - return; - } - }); - }; - - _proto._runSync = function _runSync(rule, options) { - if (options === void 0) { - options = {}; - } - - var root = this._root(rule, options); - - var transform = this.func(root); - - if (transform && typeof transform.then === "function") { - throw new Error("Selector processor returned a promise to a synchronous call."); - } - - var string = undefined; - - if (options.updateSelector && typeof rule !== "string") { - string = root.toString(); - rule.selector = string; - } - - return { - transform: transform, - root: root, - string: string - }; - } - /** - * Process rule into a selector AST. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {Promise} The AST of the selector after processing it. - */ - ; - - _proto.ast = function ast(rule, options) { - return this._run(rule, options).then(function (result) { - return result.root; - }); - } - /** - * Process rule into a selector AST synchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {parser.Root} The AST of the selector after processing it. - */ - ; - - _proto.astSync = function astSync(rule, options) { - return this._runSync(rule, options).root; - } - /** - * Process a selector into a transformed value asynchronously - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {Promise} The value returned by the processor. - */ - ; - - _proto.transform = function transform(rule, options) { - return this._run(rule, options).then(function (result) { - return result.transform; - }); - } - /** - * Process a selector into a transformed value synchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {any} The value returned by the processor. - */ - ; - - _proto.transformSync = function transformSync(rule, options) { - return this._runSync(rule, options).transform; - } - /** - * Process a selector into a new selector string asynchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {string} the selector after processing. - */ - ; - - _proto.process = function process(rule, options) { - return this._run(rule, options).then(function (result) { - return result.string || result.root.toString(); - }); - } - /** - * Process a selector into a new selector string synchronously. - * - * @param rule {postcss.Rule | string} The css selector to be processed - * @param options The options for processing - * @returns {string} the selector after processing. - */ - ; - - _proto.processSync = function processSync(rule, options) { - var result = this._runSync(rule, options); - - return result.string || result.root.toString(); - }; - - return Processor; -}(); - -exports["default"] = Processor; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/attribute.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/attribute.js deleted file mode 100644 index 8f535e5d73129949176a41eff84f99d5b0f81b81..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/attribute.js +++ /dev/null @@ -1,515 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.unescapeValue = unescapeValue; -exports["default"] = void 0; - -var _cssesc = _interopRequireDefault(require("cssesc")); - -var _unesc = _interopRequireDefault(require("../util/unesc")); - -var _namespace = _interopRequireDefault(require("./namespace")); - -var _types = require("./types"); - -var _CSSESC_QUOTE_OPTIONS; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var deprecate = require("util-deprecate"); - -var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; -var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); -var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); -var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); - -function unescapeValue(value) { - var deprecatedUsage = false; - var quoteMark = null; - var unescaped = value; - var m = unescaped.match(WRAPPED_IN_QUOTES); - - if (m) { - quoteMark = m[1]; - unescaped = m[2]; - } - - unescaped = (0, _unesc["default"])(unescaped); - - if (unescaped !== value) { - deprecatedUsage = true; - } - - return { - deprecatedUsage: deprecatedUsage, - unescaped: unescaped, - quoteMark: quoteMark - }; -} - -function handleDeprecatedContructorOpts(opts) { - if (opts.quoteMark !== undefined) { - return opts; - } - - if (opts.value === undefined) { - return opts; - } - - warnOfDeprecatedConstructor(); - - var _unescapeValue = unescapeValue(opts.value), - quoteMark = _unescapeValue.quoteMark, - unescaped = _unescapeValue.unescaped; - - if (!opts.raws) { - opts.raws = {}; - } - - if (opts.raws.value === undefined) { - opts.raws.value = opts.value; - } - - opts.value = unescaped; - opts.quoteMark = quoteMark; - return opts; -} - -var Attribute = /*#__PURE__*/function (_Namespace) { - _inheritsLoose(Attribute, _Namespace); - - function Attribute(opts) { - var _this; - - if (opts === void 0) { - opts = {}; - } - - _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; - _this.type = _types.ATTRIBUTE; - _this.raws = _this.raws || {}; - Object.defineProperty(_this.raws, 'unquoted', { - get: deprecate(function () { - return _this.value; - }, "attr.raws.unquoted is deprecated. Call attr.value instead."), - set: deprecate(function () { - return _this.value; - }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") - }); - _this._constructed = true; - return _this; - } - /** - * Returns the Attribute's value quoted such that it would be legal to use - * in the value of a css file. The original value's quotation setting - * used for stringification is left unchanged. See `setValue(value, options)` - * if you want to control the quote settings of a new value for the attribute. - * - * You can also change the quotation used for the current value by setting quoteMark. - * - * Options: - * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this - * option is not set, the original value for quoteMark will be used. If - * indeterminate, a double quote is used. The legal values are: - * * `null` - the value will be unquoted and characters will be escaped as necessary. - * * `'` - the value will be quoted with a single quote and single quotes are escaped. - * * `"` - the value will be quoted with a double quote and double quotes are escaped. - * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark - * over the quoteMark option value. - * * smart {boolean} - if true, will select a quote mark based on the value - * and the other options specified here. See the `smartQuoteMark()` - * method. - **/ - - - var _proto = Attribute.prototype; - - _proto.getQuotedValue = function getQuotedValue(options) { - if (options === void 0) { - options = {}; - } - - var quoteMark = this._determineQuoteMark(options); - - var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; - var escaped = (0, _cssesc["default"])(this._value, cssescopts); - return escaped; - }; - - _proto._determineQuoteMark = function _determineQuoteMark(options) { - return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); - } - /** - * Set the unescaped value with the specified quotation options. The value - * provided must not include any wrapping quote marks -- those quotes will - * be interpreted as part of the value and escaped accordingly. - */ - ; - - _proto.setValue = function setValue(value, options) { - if (options === void 0) { - options = {}; - } - - this._value = value; - this._quoteMark = this._determineQuoteMark(options); - - this._syncRawValue(); - } - /** - * Intelligently select a quoteMark value based on the value's contents. If - * the value is a legal CSS ident, it will not be quoted. Otherwise a quote - * mark will be picked that minimizes the number of escapes. - * - * If there's no clear winner, the quote mark from these options is used, - * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is - * true). If the quoteMark is unspecified, a double quote is used. - * - * @param options This takes the quoteMark and preferCurrentQuoteMark options - * from the quoteValue method. - */ - ; - - _proto.smartQuoteMark = function smartQuoteMark(options) { - var v = this.value; - var numSingleQuotes = v.replace(/[^']/g, '').length; - var numDoubleQuotes = v.replace(/[^"]/g, '').length; - - if (numSingleQuotes + numDoubleQuotes === 0) { - var escaped = (0, _cssesc["default"])(v, { - isIdentifier: true - }); - - if (escaped === v) { - return Attribute.NO_QUOTE; - } else { - var pref = this.preferredQuoteMark(options); - - if (pref === Attribute.NO_QUOTE) { - // pick a quote mark that isn't none and see if it's smaller - var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; - var opts = CSSESC_QUOTE_OPTIONS[quote]; - var quoteValue = (0, _cssesc["default"])(v, opts); - - if (quoteValue.length < escaped.length) { - return quote; - } - } - - return pref; - } - } else if (numDoubleQuotes === numSingleQuotes) { - return this.preferredQuoteMark(options); - } else if (numDoubleQuotes < numSingleQuotes) { - return Attribute.DOUBLE_QUOTE; - } else { - return Attribute.SINGLE_QUOTE; - } - } - /** - * Selects the preferred quote mark based on the options and the current quote mark value. - * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` - * instead. - */ - ; - - _proto.preferredQuoteMark = function preferredQuoteMark(options) { - var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; - - if (quoteMark === undefined) { - quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; - } - - if (quoteMark === undefined) { - quoteMark = Attribute.DOUBLE_QUOTE; - } - - return quoteMark; - }; - - _proto._syncRawValue = function _syncRawValue() { - var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); - - if (rawValue === this._value) { - if (this.raws) { - delete this.raws.value; - } - } else { - this.raws.value = rawValue; - } - }; - - _proto._handleEscapes = function _handleEscapes(prop, value) { - if (this._constructed) { - var escaped = (0, _cssesc["default"])(value, { - isIdentifier: true - }); - - if (escaped !== value) { - this.raws[prop] = escaped; - } else { - delete this.raws[prop]; - } - } - }; - - _proto._spacesFor = function _spacesFor(name) { - var attrSpaces = { - before: '', - after: '' - }; - var spaces = this.spaces[name] || {}; - var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; - return Object.assign(attrSpaces, spaces, rawSpaces); - }; - - _proto._stringFor = function _stringFor(name, spaceName, concat) { - if (spaceName === void 0) { - spaceName = name; - } - - if (concat === void 0) { - concat = defaultAttrConcat; - } - - var attrSpaces = this._spacesFor(spaceName); - - return concat(this.stringifyProperty(name), attrSpaces); - } - /** - * returns the offset of the attribute part specified relative to the - * start of the node of the output string. - * - * * "ns" - alias for "namespace" - * * "namespace" - the namespace if it exists. - * * "attribute" - the attribute name - * * "attributeNS" - the start of the attribute or its namespace - * * "operator" - the match operator of the attribute - * * "value" - The value (string or identifier) - * * "insensitive" - the case insensitivity flag; - * @param part One of the possible values inside an attribute. - * @returns -1 if the name is invalid or the value doesn't exist in this attribute. - */ - ; - - _proto.offsetOf = function offsetOf(name) { - var count = 1; - - var attributeSpaces = this._spacesFor("attribute"); - - count += attributeSpaces.before.length; - - if (name === "namespace" || name === "ns") { - return this.namespace ? count : -1; - } - - if (name === "attributeNS") { - return count; - } - - count += this.namespaceString.length; - - if (this.namespace) { - count += 1; - } - - if (name === "attribute") { - return count; - } - - count += this.stringifyProperty("attribute").length; - count += attributeSpaces.after.length; - - var operatorSpaces = this._spacesFor("operator"); - - count += operatorSpaces.before.length; - var operator = this.stringifyProperty("operator"); - - if (name === "operator") { - return operator ? count : -1; - } - - count += operator.length; - count += operatorSpaces.after.length; - - var valueSpaces = this._spacesFor("value"); - - count += valueSpaces.before.length; - var value = this.stringifyProperty("value"); - - if (name === "value") { - return value ? count : -1; - } - - count += value.length; - count += valueSpaces.after.length; - - var insensitiveSpaces = this._spacesFor("insensitive"); - - count += insensitiveSpaces.before.length; - - if (name === "insensitive") { - return this.insensitive ? count : -1; - } - - return -1; - }; - - _proto.toString = function toString() { - var _this2 = this; - - var selector = [this.rawSpaceBefore, '[']; - selector.push(this._stringFor('qualifiedAttribute', 'attribute')); - - if (this.operator && (this.value || this.value === '')) { - selector.push(this._stringFor('operator')); - selector.push(this._stringFor('value')); - selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { - if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { - attrSpaces.before = " "; - } - - return defaultAttrConcat(attrValue, attrSpaces); - })); - } - - selector.push(']'); - selector.push(this.rawSpaceAfter); - return selector.join(''); - }; - - _createClass(Attribute, [{ - key: "quoted", - get: function get() { - var qm = this.quoteMark; - return qm === "'" || qm === '"'; - }, - set: function set(value) { - warnOfDeprecatedQuotedAssignment(); - } - /** - * returns a single (`'`) or double (`"`) quote character if the value is quoted. - * returns `null` if the value is not quoted. - * returns `undefined` if the quotation state is unknown (this can happen when - * the attribute is constructed without specifying a quote mark.) - */ - - }, { - key: "quoteMark", - get: function get() { - return this._quoteMark; - } - /** - * Set the quote mark to be used by this attribute's value. - * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute - * value is updated accordingly. - * - * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. - */ - , - set: function set(quoteMark) { - if (!this._constructed) { - this._quoteMark = quoteMark; - return; - } - - if (this._quoteMark !== quoteMark) { - this._quoteMark = quoteMark; - - this._syncRawValue(); - } - } - }, { - key: "qualifiedAttribute", - get: function get() { - return this.qualifiedName(this.raws.attribute || this.attribute); - } - }, { - key: "insensitiveFlag", - get: function get() { - return this.insensitive ? 'i' : ''; - } - }, { - key: "value", - get: function get() { - return this._value; - } - /** - * Before 3.0, the value had to be set to an escaped value including any wrapped - * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value - * is unescaped during parsing and any quote marks are removed. - * - * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, - * a deprecation warning is raised when the new value contains any characters that would - * require escaping (including if it contains wrapped quotes). - * - * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe - * how the new value is quoted. - */ - , - set: function set(v) { - if (this._constructed) { - var _unescapeValue2 = unescapeValue(v), - deprecatedUsage = _unescapeValue2.deprecatedUsage, - unescaped = _unescapeValue2.unescaped, - quoteMark = _unescapeValue2.quoteMark; - - if (deprecatedUsage) { - warnOfDeprecatedValueAssignment(); - } - - if (unescaped === this._value && quoteMark === this._quoteMark) { - return; - } - - this._value = unescaped; - this._quoteMark = quoteMark; - - this._syncRawValue(); - } else { - this._value = v; - } - } - }, { - key: "attribute", - get: function get() { - return this._attribute; - }, - set: function set(name) { - this._handleEscapes("attribute", name); - - this._attribute = name; - } - }]); - - return Attribute; -}(_namespace["default"]); - -exports["default"] = Attribute; -Attribute.NO_QUOTE = null; -Attribute.SINGLE_QUOTE = "'"; -Attribute.DOUBLE_QUOTE = '"'; -var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { - "'": { - quotes: 'single', - wrap: true - }, - '"': { - quotes: 'double', - wrap: true - } -}, _CSSESC_QUOTE_OPTIONS[null] = { - isIdentifier: true -}, _CSSESC_QUOTE_OPTIONS); - -function defaultAttrConcat(attrValue, attrSpaces) { - return "" + attrSpaces.before + attrValue + attrSpaces.after; -} \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/className.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/className.js deleted file mode 100644 index 22409914cf728dd09abf26b5d78156823a6d4200..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/className.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _cssesc = _interopRequireDefault(require("cssesc")); - -var _util = require("../util"); - -var _node = _interopRequireDefault(require("./node")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var ClassName = /*#__PURE__*/function (_Node) { - _inheritsLoose(ClassName, _Node); - - function ClassName(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - _this.type = _types.CLASS; - _this._constructed = true; - return _this; - } - - var _proto = ClassName.prototype; - - _proto.valueToString = function valueToString() { - return '.' + _Node.prototype.valueToString.call(this); - }; - - _createClass(ClassName, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(v) { - if (this._constructed) { - var escaped = (0, _cssesc["default"])(v, { - isIdentifier: true - }); - - if (escaped !== v) { - (0, _util.ensureObject)(this, "raws"); - this.raws.value = escaped; - } else if (this.raws) { - delete this.raws.value; - } - } - - this._value = v; - } - }]); - - return ClassName; -}(_node["default"]); - -exports["default"] = ClassName; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/combinator.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/combinator.js deleted file mode 100644 index 271ab4d3b1f4469479a6ffa277212ce989eaf6b6..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/combinator.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _node = _interopRequireDefault(require("./node")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Combinator = /*#__PURE__*/function (_Node) { - _inheritsLoose(Combinator, _Node); - - function Combinator(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - _this.type = _types.COMBINATOR; - return _this; - } - - return Combinator; -}(_node["default"]); - -exports["default"] = Combinator; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/comment.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/comment.js deleted file mode 100644 index e778094e110c2fc6e1f3c3ddfd484d64b11c5876..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/comment.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _node = _interopRequireDefault(require("./node")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Comment = /*#__PURE__*/function (_Node) { - _inheritsLoose(Comment, _Node); - - function Comment(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - _this.type = _types.COMMENT; - return _this; - } - - return Comment; -}(_node["default"]); - -exports["default"] = Comment; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/constructors.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/constructors.js deleted file mode 100644 index 078023eb28f2d79d5a802ce830adf77c17377f62..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/constructors.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; - -var _attribute = _interopRequireDefault(require("./attribute")); - -var _className = _interopRequireDefault(require("./className")); - -var _combinator = _interopRequireDefault(require("./combinator")); - -var _comment = _interopRequireDefault(require("./comment")); - -var _id = _interopRequireDefault(require("./id")); - -var _nesting = _interopRequireDefault(require("./nesting")); - -var _pseudo = _interopRequireDefault(require("./pseudo")); - -var _root = _interopRequireDefault(require("./root")); - -var _selector = _interopRequireDefault(require("./selector")); - -var _string = _interopRequireDefault(require("./string")); - -var _tag = _interopRequireDefault(require("./tag")); - -var _universal = _interopRequireDefault(require("./universal")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var attribute = function attribute(opts) { - return new _attribute["default"](opts); -}; - -exports.attribute = attribute; - -var className = function className(opts) { - return new _className["default"](opts); -}; - -exports.className = className; - -var combinator = function combinator(opts) { - return new _combinator["default"](opts); -}; - -exports.combinator = combinator; - -var comment = function comment(opts) { - return new _comment["default"](opts); -}; - -exports.comment = comment; - -var id = function id(opts) { - return new _id["default"](opts); -}; - -exports.id = id; - -var nesting = function nesting(opts) { - return new _nesting["default"](opts); -}; - -exports.nesting = nesting; - -var pseudo = function pseudo(opts) { - return new _pseudo["default"](opts); -}; - -exports.pseudo = pseudo; - -var root = function root(opts) { - return new _root["default"](opts); -}; - -exports.root = root; - -var selector = function selector(opts) { - return new _selector["default"](opts); -}; - -exports.selector = selector; - -var string = function string(opts) { - return new _string["default"](opts); -}; - -exports.string = string; - -var tag = function tag(opts) { - return new _tag["default"](opts); -}; - -exports.tag = tag; - -var universal = function universal(opts) { - return new _universal["default"](opts); -}; - -exports.universal = universal; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/container.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/container.js deleted file mode 100644 index 2626fb85bba85c53d7af35541cc2505575e47a10..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/container.js +++ /dev/null @@ -1,395 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _node = _interopRequireDefault(require("./node")); - -var types = _interopRequireWildcard(require("./types")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Container = /*#__PURE__*/function (_Node) { - _inheritsLoose(Container, _Node); - - function Container(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - - if (!_this.nodes) { - _this.nodes = []; - } - - return _this; - } - - var _proto = Container.prototype; - - _proto.append = function append(selector) { - selector.parent = this; - this.nodes.push(selector); - return this; - }; - - _proto.prepend = function prepend(selector) { - selector.parent = this; - this.nodes.unshift(selector); - return this; - }; - - _proto.at = function at(index) { - return this.nodes[index]; - }; - - _proto.index = function index(child) { - if (typeof child === 'number') { - return child; - } - - return this.nodes.indexOf(child); - }; - - _proto.removeChild = function removeChild(child) { - child = this.index(child); - this.at(child).parent = undefined; - this.nodes.splice(child, 1); - var index; - - for (var id in this.indexes) { - index = this.indexes[id]; - - if (index >= child) { - this.indexes[id] = index - 1; - } - } - - return this; - }; - - _proto.removeAll = function removeAll() { - for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { - var node = _step.value; - node.parent = undefined; - } - - this.nodes = []; - return this; - }; - - _proto.empty = function empty() { - return this.removeAll(); - }; - - _proto.insertAfter = function insertAfter(oldNode, newNode) { - newNode.parent = this; - var oldIndex = this.index(oldNode); - this.nodes.splice(oldIndex + 1, 0, newNode); - newNode.parent = this; - var index; - - for (var id in this.indexes) { - index = this.indexes[id]; - - if (oldIndex <= index) { - this.indexes[id] = index + 1; - } - } - - return this; - }; - - _proto.insertBefore = function insertBefore(oldNode, newNode) { - newNode.parent = this; - var oldIndex = this.index(oldNode); - this.nodes.splice(oldIndex, 0, newNode); - newNode.parent = this; - var index; - - for (var id in this.indexes) { - index = this.indexes[id]; - - if (index <= oldIndex) { - this.indexes[id] = index + 1; - } - } - - return this; - }; - - _proto._findChildAtPosition = function _findChildAtPosition(line, col) { - var found = undefined; - this.each(function (node) { - if (node.atPosition) { - var foundChild = node.atPosition(line, col); - - if (foundChild) { - found = foundChild; - return false; - } - } else if (node.isAtPosition(line, col)) { - found = node; - return false; - } - }); - return found; - } - /** - * Return the most specific node at the line and column number given. - * The source location is based on the original parsed location, locations aren't - * updated as selector nodes are mutated. - * - * Note that this location is relative to the location of the first character - * of the selector, and not the location of the selector in the overall document - * when used in conjunction with postcss. - * - * If not found, returns undefined. - * @param {number} line The line number of the node to find. (1-based index) - * @param {number} col The column number of the node to find. (1-based index) - */ - ; - - _proto.atPosition = function atPosition(line, col) { - if (this.isAtPosition(line, col)) { - return this._findChildAtPosition(line, col) || this; - } else { - return undefined; - } - }; - - _proto._inferEndPosition = function _inferEndPosition() { - if (this.last && this.last.source && this.last.source.end) { - this.source = this.source || {}; - this.source.end = this.source.end || {}; - Object.assign(this.source.end, this.last.source.end); - } - }; - - _proto.each = function each(callback) { - if (!this.lastEach) { - this.lastEach = 0; - } - - if (!this.indexes) { - this.indexes = {}; - } - - this.lastEach++; - var id = this.lastEach; - this.indexes[id] = 0; - - if (!this.length) { - return undefined; - } - - var index, result; - - while (this.indexes[id] < this.length) { - index = this.indexes[id]; - result = callback(this.at(index), index); - - if (result === false) { - break; - } - - this.indexes[id] += 1; - } - - delete this.indexes[id]; - - if (result === false) { - return false; - } - }; - - _proto.walk = function walk(callback) { - return this.each(function (node, i) { - var result = callback(node, i); - - if (result !== false && node.length) { - result = node.walk(callback); - } - - if (result === false) { - return false; - } - }); - }; - - _proto.walkAttributes = function walkAttributes(callback) { - var _this2 = this; - - return this.walk(function (selector) { - if (selector.type === types.ATTRIBUTE) { - return callback.call(_this2, selector); - } - }); - }; - - _proto.walkClasses = function walkClasses(callback) { - var _this3 = this; - - return this.walk(function (selector) { - if (selector.type === types.CLASS) { - return callback.call(_this3, selector); - } - }); - }; - - _proto.walkCombinators = function walkCombinators(callback) { - var _this4 = this; - - return this.walk(function (selector) { - if (selector.type === types.COMBINATOR) { - return callback.call(_this4, selector); - } - }); - }; - - _proto.walkComments = function walkComments(callback) { - var _this5 = this; - - return this.walk(function (selector) { - if (selector.type === types.COMMENT) { - return callback.call(_this5, selector); - } - }); - }; - - _proto.walkIds = function walkIds(callback) { - var _this6 = this; - - return this.walk(function (selector) { - if (selector.type === types.ID) { - return callback.call(_this6, selector); - } - }); - }; - - _proto.walkNesting = function walkNesting(callback) { - var _this7 = this; - - return this.walk(function (selector) { - if (selector.type === types.NESTING) { - return callback.call(_this7, selector); - } - }); - }; - - _proto.walkPseudos = function walkPseudos(callback) { - var _this8 = this; - - return this.walk(function (selector) { - if (selector.type === types.PSEUDO) { - return callback.call(_this8, selector); - } - }); - }; - - _proto.walkTags = function walkTags(callback) { - var _this9 = this; - - return this.walk(function (selector) { - if (selector.type === types.TAG) { - return callback.call(_this9, selector); - } - }); - }; - - _proto.walkUniversals = function walkUniversals(callback) { - var _this10 = this; - - return this.walk(function (selector) { - if (selector.type === types.UNIVERSAL) { - return callback.call(_this10, selector); - } - }); - }; - - _proto.split = function split(callback) { - var _this11 = this; - - var current = []; - return this.reduce(function (memo, node, index) { - var split = callback.call(_this11, node); - current.push(node); - - if (split) { - memo.push(current); - current = []; - } else if (index === _this11.length - 1) { - memo.push(current); - } - - return memo; - }, []); - }; - - _proto.map = function map(callback) { - return this.nodes.map(callback); - }; - - _proto.reduce = function reduce(callback, memo) { - return this.nodes.reduce(callback, memo); - }; - - _proto.every = function every(callback) { - return this.nodes.every(callback); - }; - - _proto.some = function some(callback) { - return this.nodes.some(callback); - }; - - _proto.filter = function filter(callback) { - return this.nodes.filter(callback); - }; - - _proto.sort = function sort(callback) { - return this.nodes.sort(callback); - }; - - _proto.toString = function toString() { - return this.map(String).join(''); - }; - - _createClass(Container, [{ - key: "first", - get: function get() { - return this.at(0); - } - }, { - key: "last", - get: function get() { - return this.at(this.length - 1); - } - }, { - key: "length", - get: function get() { - return this.nodes.length; - } - }]); - - return Container; -}(_node["default"]); - -exports["default"] = Container; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/guards.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/guards.js deleted file mode 100644 index c949af57eb1fdff59d7c43d6bde6576376d0cc0b..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/guards.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.isNode = isNode; -exports.isPseudoElement = isPseudoElement; -exports.isPseudoClass = isPseudoClass; -exports.isContainer = isContainer; -exports.isNamespace = isNamespace; -exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; - -var _types = require("./types"); - -var _IS_TYPE; - -var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); - -function isNode(node) { - return typeof node === "object" && IS_TYPE[node.type]; -} - -function isNodeType(type, node) { - return isNode(node) && node.type === type; -} - -var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); -exports.isAttribute = isAttribute; -var isClassName = isNodeType.bind(null, _types.CLASS); -exports.isClassName = isClassName; -var isCombinator = isNodeType.bind(null, _types.COMBINATOR); -exports.isCombinator = isCombinator; -var isComment = isNodeType.bind(null, _types.COMMENT); -exports.isComment = isComment; -var isIdentifier = isNodeType.bind(null, _types.ID); -exports.isIdentifier = isIdentifier; -var isNesting = isNodeType.bind(null, _types.NESTING); -exports.isNesting = isNesting; -var isPseudo = isNodeType.bind(null, _types.PSEUDO); -exports.isPseudo = isPseudo; -var isRoot = isNodeType.bind(null, _types.ROOT); -exports.isRoot = isRoot; -var isSelector = isNodeType.bind(null, _types.SELECTOR); -exports.isSelector = isSelector; -var isString = isNodeType.bind(null, _types.STRING); -exports.isString = isString; -var isTag = isNodeType.bind(null, _types.TAG); -exports.isTag = isTag; -var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); -exports.isUniversal = isUniversal; - -function isPseudoElement(node) { - return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); -} - -function isPseudoClass(node) { - return isPseudo(node) && !isPseudoElement(node); -} - -function isContainer(node) { - return !!(isNode(node) && node.walk); -} - -function isNamespace(node) { - return isAttribute(node) || isTag(node); -} \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/id.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/id.js deleted file mode 100644 index 4e83147e3c4efb80279f1a8f82139ac47993b32c..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/id.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _node = _interopRequireDefault(require("./node")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var ID = /*#__PURE__*/function (_Node) { - _inheritsLoose(ID, _Node); - - function ID(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - _this.type = _types.ID; - return _this; - } - - var _proto = ID.prototype; - - _proto.valueToString = function valueToString() { - return '#' + _Node.prototype.valueToString.call(this); - }; - - return ID; -}(_node["default"]); - -exports["default"] = ID; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/index.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/index.js deleted file mode 100644 index 1fe9b138a5a26e0314f2a0606041594c558c9088..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/index.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -exports.__esModule = true; - -var _types = require("./types"); - -Object.keys(_types).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _types[key]) return; - exports[key] = _types[key]; -}); - -var _constructors = require("./constructors"); - -Object.keys(_constructors).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _constructors[key]) return; - exports[key] = _constructors[key]; -}); - -var _guards = require("./guards"); - -Object.keys(_guards).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _guards[key]) return; - exports[key] = _guards[key]; -}); \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/namespace.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/namespace.js deleted file mode 100644 index fd6c729e16661f65b0c79d5a3f1b813fadc101f5..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/namespace.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _cssesc = _interopRequireDefault(require("cssesc")); - -var _util = require("../util"); - -var _node = _interopRequireDefault(require("./node")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Namespace = /*#__PURE__*/function (_Node) { - _inheritsLoose(Namespace, _Node); - - function Namespace() { - return _Node.apply(this, arguments) || this; - } - - var _proto = Namespace.prototype; - - _proto.qualifiedName = function qualifiedName(value) { - if (this.namespace) { - return this.namespaceString + "|" + value; - } else { - return value; - } - }; - - _proto.valueToString = function valueToString() { - return this.qualifiedName(_Node.prototype.valueToString.call(this)); - }; - - _createClass(Namespace, [{ - key: "namespace", - get: function get() { - return this._namespace; - }, - set: function set(namespace) { - if (namespace === true || namespace === "*" || namespace === "&") { - this._namespace = namespace; - - if (this.raws) { - delete this.raws.namespace; - } - - return; - } - - var escaped = (0, _cssesc["default"])(namespace, { - isIdentifier: true - }); - this._namespace = namespace; - - if (escaped !== namespace) { - (0, _util.ensureObject)(this, "raws"); - this.raws.namespace = escaped; - } else if (this.raws) { - delete this.raws.namespace; - } - } - }, { - key: "ns", - get: function get() { - return this._namespace; - }, - set: function set(namespace) { - this.namespace = namespace; - } - }, { - key: "namespaceString", - get: function get() { - if (this.namespace) { - var ns = this.stringifyProperty("namespace"); - - if (ns === true) { - return ''; - } else { - return ns; - } - } else { - return ''; - } - } - }]); - - return Namespace; -}(_node["default"]); - -exports["default"] = Namespace; -; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/nesting.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/nesting.js deleted file mode 100644 index 3288c78f2dddba8a44ecf70f29c7ba4754f73299..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/nesting.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _node = _interopRequireDefault(require("./node")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Nesting = /*#__PURE__*/function (_Node) { - _inheritsLoose(Nesting, _Node); - - function Nesting(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - _this.type = _types.NESTING; - _this.value = '&'; - return _this; - } - - return Nesting; -}(_node["default"]); - -exports["default"] = Nesting; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/node.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/node.js deleted file mode 100644 index e8eca11c70ecf46dac555dcd7e8e5f873f2a1402..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/node.js +++ /dev/null @@ -1,239 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _util = require("../util"); - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var cloneNode = function cloneNode(obj, parent) { - if (typeof obj !== 'object' || obj === null) { - return obj; - } - - var cloned = new obj.constructor(); - - for (var i in obj) { - if (!obj.hasOwnProperty(i)) { - continue; - } - - var value = obj[i]; - var type = typeof value; - - if (i === 'parent' && type === 'object') { - if (parent) { - cloned[i] = parent; - } - } else if (value instanceof Array) { - cloned[i] = value.map(function (j) { - return cloneNode(j, cloned); - }); - } else { - cloned[i] = cloneNode(value, cloned); - } - } - - return cloned; -}; - -var Node = /*#__PURE__*/function () { - function Node(opts) { - if (opts === void 0) { - opts = {}; - } - - Object.assign(this, opts); - this.spaces = this.spaces || {}; - this.spaces.before = this.spaces.before || ''; - this.spaces.after = this.spaces.after || ''; - } - - var _proto = Node.prototype; - - _proto.remove = function remove() { - if (this.parent) { - this.parent.removeChild(this); - } - - this.parent = undefined; - return this; - }; - - _proto.replaceWith = function replaceWith() { - if (this.parent) { - for (var index in arguments) { - this.parent.insertBefore(this, arguments[index]); - } - - this.remove(); - } - - return this; - }; - - _proto.next = function next() { - return this.parent.at(this.parent.index(this) + 1); - }; - - _proto.prev = function prev() { - return this.parent.at(this.parent.index(this) - 1); - }; - - _proto.clone = function clone(overrides) { - if (overrides === void 0) { - overrides = {}; - } - - var cloned = cloneNode(this); - - for (var name in overrides) { - cloned[name] = overrides[name]; - } - - return cloned; - } - /** - * Some non-standard syntax doesn't follow normal escaping rules for css. - * This allows non standard syntax to be appended to an existing property - * by specifying the escaped value. By specifying the escaped value, - * illegal characters are allowed to be directly inserted into css output. - * @param {string} name the property to set - * @param {any} value the unescaped value of the property - * @param {string} valueEscaped optional. the escaped value of the property. - */ - ; - - _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { - if (!this.raws) { - this.raws = {}; - } - - var originalValue = this[name]; - var originalEscaped = this.raws[name]; - this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. - - if (originalEscaped || valueEscaped !== value) { - this.raws[name] = (originalEscaped || originalValue) + valueEscaped; - } else { - delete this.raws[name]; // delete any escaped value that was created by the setter. - } - } - /** - * Some non-standard syntax doesn't follow normal escaping rules for css. - * This allows the escaped value to be specified directly, allowing illegal - * characters to be directly inserted into css output. - * @param {string} name the property to set - * @param {any} value the unescaped value of the property - * @param {string} valueEscaped the escaped value of the property. - */ - ; - - _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { - if (!this.raws) { - this.raws = {}; - } - - this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. - - this.raws[name] = valueEscaped; - } - /** - * When you want a value to passed through to CSS directly. This method - * deletes the corresponding raw value causing the stringifier to fallback - * to the unescaped value. - * @param {string} name the property to set. - * @param {any} value The value that is both escaped and unescaped. - */ - ; - - _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { - this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. - - if (this.raws) { - delete this.raws[name]; - } - } - /** - * - * @param {number} line The number (starting with 1) - * @param {number} column The column number (starting with 1) - */ - ; - - _proto.isAtPosition = function isAtPosition(line, column) { - if (this.source && this.source.start && this.source.end) { - if (this.source.start.line > line) { - return false; - } - - if (this.source.end.line < line) { - return false; - } - - if (this.source.start.line === line && this.source.start.column > column) { - return false; - } - - if (this.source.end.line === line && this.source.end.column < column) { - return false; - } - - return true; - } - - return undefined; - }; - - _proto.stringifyProperty = function stringifyProperty(name) { - return this.raws && this.raws[name] || this[name]; - }; - - _proto.valueToString = function valueToString() { - return String(this.stringifyProperty("value")); - }; - - _proto.toString = function toString() { - return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); - }; - - _createClass(Node, [{ - key: "rawSpaceBefore", - get: function get() { - var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; - - if (rawSpace === undefined) { - rawSpace = this.spaces && this.spaces.before; - } - - return rawSpace || ""; - }, - set: function set(raw) { - (0, _util.ensureObject)(this, "raws", "spaces"); - this.raws.spaces.before = raw; - } - }, { - key: "rawSpaceAfter", - get: function get() { - var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; - - if (rawSpace === undefined) { - rawSpace = this.spaces.after; - } - - return rawSpace || ""; - }, - set: function set(raw) { - (0, _util.ensureObject)(this, "raws", "spaces"); - this.raws.spaces.after = raw; - } - }]); - - return Node; -}(); - -exports["default"] = Node; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/pseudo.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/pseudo.js deleted file mode 100644 index a0e7bca170a76d6746f4dbfcb79068fd64d6af19..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/pseudo.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _container = _interopRequireDefault(require("./container")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Pseudo = /*#__PURE__*/function (_Container) { - _inheritsLoose(Pseudo, _Container); - - function Pseudo(opts) { - var _this; - - _this = _Container.call(this, opts) || this; - _this.type = _types.PSEUDO; - return _this; - } - - var _proto = Pseudo.prototype; - - _proto.toString = function toString() { - var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; - return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); - }; - - return Pseudo; -}(_container["default"]); - -exports["default"] = Pseudo; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/root.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/root.js deleted file mode 100644 index be5c2ccb2dac833fdfc627fde45f161e23825ff0..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/root.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _container = _interopRequireDefault(require("./container")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Root = /*#__PURE__*/function (_Container) { - _inheritsLoose(Root, _Container); - - function Root(opts) { - var _this; - - _this = _Container.call(this, opts) || this; - _this.type = _types.ROOT; - return _this; - } - - var _proto = Root.prototype; - - _proto.toString = function toString() { - var str = this.reduce(function (memo, selector) { - memo.push(String(selector)); - return memo; - }, []).join(','); - return this.trailingComma ? str + ',' : str; - }; - - _proto.error = function error(message, options) { - if (this._error) { - return this._error(message, options); - } else { - return new Error(message); - } - }; - - _createClass(Root, [{ - key: "errorGenerator", - set: function set(handler) { - this._error = handler; - } - }]); - - return Root; -}(_container["default"]); - -exports["default"] = Root; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/selector.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/selector.js deleted file mode 100644 index 699eeb6e546f912c111ae620c46948e7add4e122..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/selector.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _container = _interopRequireDefault(require("./container")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Selector = /*#__PURE__*/function (_Container) { - _inheritsLoose(Selector, _Container); - - function Selector(opts) { - var _this; - - _this = _Container.call(this, opts) || this; - _this.type = _types.SELECTOR; - return _this; - } - - return Selector; -}(_container["default"]); - -exports["default"] = Selector; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/string.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/string.js deleted file mode 100644 index e61df30c74a0a3ac416e04f95740251cd661c50e..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/string.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _node = _interopRequireDefault(require("./node")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var String = /*#__PURE__*/function (_Node) { - _inheritsLoose(String, _Node); - - function String(opts) { - var _this; - - _this = _Node.call(this, opts) || this; - _this.type = _types.STRING; - return _this; - } - - return String; -}(_node["default"]); - -exports["default"] = String; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/tag.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/tag.js deleted file mode 100644 index e298db15fafd1f7857825136459f14da71c9bf26..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/tag.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _namespace = _interopRequireDefault(require("./namespace")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Tag = /*#__PURE__*/function (_Namespace) { - _inheritsLoose(Tag, _Namespace); - - function Tag(opts) { - var _this; - - _this = _Namespace.call(this, opts) || this; - _this.type = _types.TAG; - return _this; - } - - return Tag; -}(_namespace["default"]); - -exports["default"] = Tag; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/types.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/types.js deleted file mode 100644 index ab897b8ce5c129e34363d2980e65d0208eb2fa1a..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/types.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.UNIVERSAL = exports.ATTRIBUTE = exports.CLASS = exports.COMBINATOR = exports.COMMENT = exports.ID = exports.NESTING = exports.PSEUDO = exports.ROOT = exports.SELECTOR = exports.STRING = exports.TAG = void 0; -var TAG = 'tag'; -exports.TAG = TAG; -var STRING = 'string'; -exports.STRING = STRING; -var SELECTOR = 'selector'; -exports.SELECTOR = SELECTOR; -var ROOT = 'root'; -exports.ROOT = ROOT; -var PSEUDO = 'pseudo'; -exports.PSEUDO = PSEUDO; -var NESTING = 'nesting'; -exports.NESTING = NESTING; -var ID = 'id'; -exports.ID = ID; -var COMMENT = 'comment'; -exports.COMMENT = COMMENT; -var COMBINATOR = 'combinator'; -exports.COMBINATOR = COMBINATOR; -var CLASS = 'class'; -exports.CLASS = CLASS; -var ATTRIBUTE = 'attribute'; -exports.ATTRIBUTE = ATTRIBUTE; -var UNIVERSAL = 'universal'; -exports.UNIVERSAL = UNIVERSAL; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/universal.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/universal.js deleted file mode 100644 index cf25473d1c3d4d56b68322066f88072876f266f1..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/selectors/universal.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = void 0; - -var _namespace = _interopRequireDefault(require("./namespace")); - -var _types = require("./types"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -var Universal = /*#__PURE__*/function (_Namespace) { - _inheritsLoose(Universal, _Namespace); - - function Universal(opts) { - var _this; - - _this = _Namespace.call(this, opts) || this; - _this.type = _types.UNIVERSAL; - _this.value = '*'; - return _this; - } - - return Universal; -}(_namespace["default"]); - -exports["default"] = Universal; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/sortAscending.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/sortAscending.js deleted file mode 100644 index 3ef56acc570c8f4f5292c7722f68e9c9fd205996..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/sortAscending.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = sortAscending; - -function sortAscending(list) { - return list.sort(function (a, b) { - return a - b; - }); -} - -; -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/tokenTypes.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/tokenTypes.js deleted file mode 100644 index 48314b93e00581dc5ab7e56b3facc856d284c23a..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/tokenTypes.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.combinator = exports.word = exports.comment = exports.str = exports.tab = exports.newline = exports.feed = exports.cr = exports.backslash = exports.bang = exports.slash = exports.doubleQuote = exports.singleQuote = exports.space = exports.greaterThan = exports.pipe = exports.equals = exports.plus = exports.caret = exports.tilde = exports.dollar = exports.closeSquare = exports.openSquare = exports.closeParenthesis = exports.openParenthesis = exports.semicolon = exports.colon = exports.comma = exports.at = exports.asterisk = exports.ampersand = void 0; -var ampersand = 38; // `&`.charCodeAt(0); - -exports.ampersand = ampersand; -var asterisk = 42; // `*`.charCodeAt(0); - -exports.asterisk = asterisk; -var at = 64; // `@`.charCodeAt(0); - -exports.at = at; -var comma = 44; // `,`.charCodeAt(0); - -exports.comma = comma; -var colon = 58; // `:`.charCodeAt(0); - -exports.colon = colon; -var semicolon = 59; // `;`.charCodeAt(0); - -exports.semicolon = semicolon; -var openParenthesis = 40; // `(`.charCodeAt(0); - -exports.openParenthesis = openParenthesis; -var closeParenthesis = 41; // `)`.charCodeAt(0); - -exports.closeParenthesis = closeParenthesis; -var openSquare = 91; // `[`.charCodeAt(0); - -exports.openSquare = openSquare; -var closeSquare = 93; // `]`.charCodeAt(0); - -exports.closeSquare = closeSquare; -var dollar = 36; // `$`.charCodeAt(0); - -exports.dollar = dollar; -var tilde = 126; // `~`.charCodeAt(0); - -exports.tilde = tilde; -var caret = 94; // `^`.charCodeAt(0); - -exports.caret = caret; -var plus = 43; // `+`.charCodeAt(0); - -exports.plus = plus; -var equals = 61; // `=`.charCodeAt(0); - -exports.equals = equals; -var pipe = 124; // `|`.charCodeAt(0); - -exports.pipe = pipe; -var greaterThan = 62; // `>`.charCodeAt(0); - -exports.greaterThan = greaterThan; -var space = 32; // ` `.charCodeAt(0); - -exports.space = space; -var singleQuote = 39; // `'`.charCodeAt(0); - -exports.singleQuote = singleQuote; -var doubleQuote = 34; // `"`.charCodeAt(0); - -exports.doubleQuote = doubleQuote; -var slash = 47; // `/`.charCodeAt(0); - -exports.slash = slash; -var bang = 33; // `!`.charCodeAt(0); - -exports.bang = bang; -var backslash = 92; // '\\'.charCodeAt(0); - -exports.backslash = backslash; -var cr = 13; // '\r'.charCodeAt(0); - -exports.cr = cr; -var feed = 12; // '\f'.charCodeAt(0); - -exports.feed = feed; -var newline = 10; // '\n'.charCodeAt(0); - -exports.newline = newline; -var tab = 9; // '\t'.charCodeAt(0); -// Expose aliases primarily for readability. - -exports.tab = tab; -var str = singleQuote; // No good single character representation! - -exports.str = str; -var comment = -1; -exports.comment = comment; -var word = -2; -exports.word = word; -var combinator = -3; -exports.combinator = combinator; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/tokenize.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/tokenize.js deleted file mode 100644 index bee9fee632e84c56c0c83c7e848c64781618cf79..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/tokenize.js +++ /dev/null @@ -1,271 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = tokenize; -exports.FIELDS = void 0; - -var t = _interopRequireWildcard(require("./tokenTypes")); - -var _unescapable, _wordDelimiters; - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); -var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); -var hex = {}; -var hexChars = "0123456789abcdefABCDEF"; - -for (var i = 0; i < hexChars.length; i++) { - hex[hexChars.charCodeAt(i)] = true; -} -/** - * Returns the last index of the bar css word - * @param {string} css The string in which the word begins - * @param {number} start The index into the string where word's first letter occurs - */ - - -function consumeWord(css, start) { - var next = start; - var code; - - do { - code = css.charCodeAt(next); - - if (wordDelimiters[code]) { - return next - 1; - } else if (code === t.backslash) { - next = consumeEscape(css, next) + 1; - } else { - // All other characters are part of the word - next++; - } - } while (next < css.length); - - return next - 1; -} -/** - * Returns the last index of the escape sequence - * @param {string} css The string in which the sequence begins - * @param {number} start The index into the string where escape character (`\`) occurs. - */ - - -function consumeEscape(css, start) { - var next = start; - var code = css.charCodeAt(next + 1); - - if (unescapable[code]) {// just consume the escape char - } else if (hex[code]) { - var hexDigits = 0; // consume up to 6 hex chars - - do { - next++; - hexDigits++; - code = css.charCodeAt(next + 1); - } while (hex[code] && hexDigits < 6); // if fewer than 6 hex chars, a trailing space ends the escape - - - if (hexDigits < 6 && code === t.space) { - next++; - } - } else { - // the next char is part of the current word - next++; - } - - return next; -} - -var FIELDS = { - TYPE: 0, - START_LINE: 1, - START_COL: 2, - END_LINE: 3, - END_COL: 4, - START_POS: 5, - END_POS: 6 -}; -exports.FIELDS = FIELDS; - -function tokenize(input) { - var tokens = []; - var css = input.css.valueOf(); - var _css = css, - length = _css.length; - var offset = -1; - var line = 1; - var start = 0; - var end = 0; - var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; - - function unclosed(what, fix) { - if (input.safe) { - // fyi: this is never set to true. - css += fix; - next = css.length - 1; - } else { - throw input.error('Unclosed ' + what, line, start - offset, start); - } - } - - while (start < length) { - code = css.charCodeAt(start); - - if (code === t.newline) { - offset = start; - line += 1; - } - - switch (code) { - case t.space: - case t.tab: - case t.newline: - case t.cr: - case t.feed: - next = start; - - do { - next += 1; - code = css.charCodeAt(next); - - if (code === t.newline) { - offset = next; - line += 1; - } - } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); - - tokenType = t.space; - endLine = line; - endColumn = next - offset - 1; - end = next; - break; - - case t.plus: - case t.greaterThan: - case t.tilde: - case t.pipe: - next = start; - - do { - next += 1; - code = css.charCodeAt(next); - } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); - - tokenType = t.combinator; - endLine = line; - endColumn = start - offset; - end = next; - break; - // Consume these characters as single tokens. - - case t.asterisk: - case t.ampersand: - case t.bang: - case t.comma: - case t.equals: - case t.dollar: - case t.caret: - case t.openSquare: - case t.closeSquare: - case t.colon: - case t.semicolon: - case t.openParenthesis: - case t.closeParenthesis: - next = start; - tokenType = code; - endLine = line; - endColumn = start - offset; - end = next + 1; - break; - - case t.singleQuote: - case t.doubleQuote: - quote = code === t.singleQuote ? "'" : '"'; - next = start; - - do { - escaped = false; - next = css.indexOf(quote, next + 1); - - if (next === -1) { - unclosed('quote', quote); - } - - escapePos = next; - - while (css.charCodeAt(escapePos - 1) === t.backslash) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped); - - tokenType = t.str; - endLine = line; - endColumn = start - offset; - end = next + 1; - break; - - default: - if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { - next = css.indexOf('*/', start + 2) + 1; - - if (next === 0) { - unclosed('comment', '*/'); - } - - content = css.slice(start, next + 1); - lines = content.split('\n'); - last = lines.length - 1; - - if (last > 0) { - nextLine = line + last; - nextOffset = next - lines[last].length; - } else { - nextLine = line; - nextOffset = offset; - } - - tokenType = t.comment; - line = nextLine; - endLine = nextLine; - endColumn = next - nextOffset; - } else if (code === t.slash) { - next = start; - tokenType = code; - endLine = line; - endColumn = start - offset; - end = next + 1; - } else { - next = consumeWord(css, start); - tokenType = t.word; - endLine = line; - endColumn = next - offset; - } - - end = next + 1; - break; - } // Ensure that the token structure remains consistent - - - tokens.push([tokenType, // [0] Token type - line, // [1] Starting line - start - offset, // [2] Starting column - endLine, // [3] Ending line - endColumn, // [4] Ending column - start, // [5] Start position / Source index - end // [6] End position - ]); // Reset offset for the next token - - if (nextOffset) { - offset = nextOffset; - nextOffset = null; - } - - start = end; - } - - return tokens; -} \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/ensureObject.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/ensureObject.js deleted file mode 100644 index 3472e075228405b79bc8d770b479cec3c8aaf4e3..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/ensureObject.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = ensureObject; - -function ensureObject(obj) { - for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - props[_key - 1] = arguments[_key]; - } - - while (props.length > 0) { - var prop = props.shift(); - - if (!obj[prop]) { - obj[prop] = {}; - } - - obj = obj[prop]; - } -} - -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/getProp.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/getProp.js deleted file mode 100644 index 53e07c90253eb1c995ddb2725497cf56f15da36e..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/getProp.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = getProp; - -function getProp(obj) { - for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - props[_key - 1] = arguments[_key]; - } - - while (props.length > 0) { - var prop = props.shift(); - - if (!obj[prop]) { - return undefined; - } - - obj = obj[prop]; - } - - return obj; -} - -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/index.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/index.js deleted file mode 100644 index 043fda8c64b9a8218f4d561e261a5bbad1a0cd82..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.stripComments = exports.ensureObject = exports.getProp = exports.unesc = void 0; - -var _unesc = _interopRequireDefault(require("./unesc")); - -exports.unesc = _unesc["default"]; - -var _getProp = _interopRequireDefault(require("./getProp")); - -exports.getProp = _getProp["default"]; - -var _ensureObject = _interopRequireDefault(require("./ensureObject")); - -exports.ensureObject = _ensureObject["default"]; - -var _stripComments = _interopRequireDefault(require("./stripComments")); - -exports.stripComments = _stripComments["default"]; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/stripComments.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/stripComments.js deleted file mode 100644 index c74f1fecdcc641c50ee1fe1e56836e75ac229735..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/stripComments.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = stripComments; - -function stripComments(str) { - var s = ""; - var commentStart = str.indexOf("/*"); - var lastEnd = 0; - - while (commentStart >= 0) { - s = s + str.slice(lastEnd, commentStart); - var commentEnd = str.indexOf("*/", commentStart + 2); - - if (commentEnd < 0) { - return s; - } - - lastEnd = commentEnd + 2; - commentStart = str.indexOf("/*", lastEnd); - } - - s = s + str.slice(lastEnd); - return s; -} - -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/unesc.js b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/unesc.js deleted file mode 100644 index 3136e7e0084203ed23840abe64694eef3f0fd61d..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/dist/util/unesc.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports["default"] = unesc; - -// Many thanks for this post which made this migration much easier. -// https://mathiasbynens.be/notes/css-escapes - -/** - * - * @param {string} str - * @returns {[string, number]|undefined} - */ -function gobbleHex(str) { - var lower = str.toLowerCase(); - var hex = ''; - var spaceTerminated = false; - - for (var i = 0; i < 6 && lower[i] !== undefined; i++) { - var code = lower.charCodeAt(i); // check to see if we are dealing with a valid hex char [a-f|0-9] - - var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point - - spaceTerminated = code === 32; - - if (!valid) { - break; - } - - hex += lower[i]; - } - - if (hex.length === 0) { - return undefined; - } - - var codePoint = parseInt(hex, 16); - var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; // Add special case for - // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" - // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point - - if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { - return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; - } - - return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; -} - -var CONTAINS_ESCAPE = /\\/; - -function unesc(str) { - var needToProcess = CONTAINS_ESCAPE.test(str); - - if (!needToProcess) { - return str; - } - - var ret = ""; - - for (var i = 0; i < str.length; i++) { - if (str[i] === "\\") { - var gobbled = gobbleHex(str.slice(i + 1, i + 7)); - - if (gobbled !== undefined) { - ret += gobbled[0]; - i += gobbled[1]; - continue; - } // Retain a pair of \\ if double escaped `\\\\` - // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e - - - if (str[i + 1] === "\\") { - ret += "\\"; - i++; - continue; - } // if \\ is at the end of the string retain it - // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb - - - if (str.length === i + 1) { - ret += str[i]; - } - - continue; - } - - ret += str[i]; - } - - return ret; -} - -module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/package.json b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/package.json deleted file mode 100644 index a6f33589ba051d1c95a1abe0fcf7e7c7862ba649..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "postcss-selector-parser", - "version": "6.0.10", - "devDependencies": { - "@babel/cli": "^7.11.6", - "@babel/core": "^7.11.6", - "@babel/eslint-parser": "^7.11.5", - "@babel/eslint-plugin": "^7.11.5", - "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/preset-env": "^7.11.5", - "@babel/register": "^7.11.5", - "ava": "^3.12.1", - "babel-plugin-add-module-exports": "^1.0.4", - "coveralls": "^3.1.0", - "del-cli": "^3.0.1", - "eslint": "^7.9.0", - "eslint-plugin-import": "^2.22.0", - "glob": "^7.1.6", - "minimist": "^1.2.5", - "nyc": "^15.1.0", - "postcss": "^8.0.0", - "semver": "^7.3.2", - "typescript": "^4.0.3" - }, - "main": "dist/index.js", - "types": "postcss-selector-parser.d.ts", - "files": [ - "API.md", - "CHANGELOG.md", - "LICENSE-MIT", - "dist", - "postcss-selector-parser.d.ts", - "!**/__tests__" - ], - "scripts": { - "pretest": "eslint src && tsc --noEmit postcss-selector-parser.d.ts", - "prepare": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", - "lintfix": "eslint --fix src", - "report": "nyc report --reporter=html", - "test": "nyc ava src/__tests__/*.js ", - "testone": "ava" - }, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "license": "MIT", - "engines": { - "node": ">=4" - }, - "homepage": "https://github.com/postcss/postcss-selector-parser", - "contributors": [ - { - "name": "Ben Briggs", - "email": "beneb.info@gmail.com", - "url": "http://beneb.info" - }, - { - "name": "Chris Eppstein", - "email": "chris@eppsteins.net", - "url": "http://twitter.com/chriseppstein" - } - ], - "repository": "postcss/postcss-selector-parser", - "ava": { - "require": [ - "@babel/register" - ], - "concurrency": 5, - "timeout": "25s" - }, - "nyc": { - "exclude": [ - "node_modules", - "**/__tests__" - ] - } -} diff --git a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts b/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts deleted file mode 100644 index 89a2c5239edb16da63b71ca2cd1ac655c604c788..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts +++ /dev/null @@ -1,555 +0,0 @@ -// Type definitions for postcss-selector-parser 2.2.3 -// Definitions by: Chris Eppstein - -/*~ Note that ES6 modules cannot directly export callable functions. - *~ This file should be imported using the CommonJS-style: - *~ import x = require('someLibrary'); - *~ - *~ Refer to the documentation to understand common - *~ workarounds for this limitation of ES6 modules. - */ - -/*~ This declaration specifies that the function - *~ is the exported object from the file - */ -export = parser; - -// A type that's T but not U. -type Diff = T extends U ? never : T; - -// TODO: Conditional types in TS 1.8 will really clean this up. -declare function parser(): parser.Processor; -declare function parser(processor: parser.AsyncProcessor): parser.Processor; -declare function parser(processor: parser.AsyncProcessor): parser.Processor; -declare function parser(processor: parser.SyncProcessor): parser.Processor; -declare function parser(processor: parser.SyncProcessor): parser.Processor; -declare function parser(processor?: parser.SyncProcessor | parser.AsyncProcessor): parser.Processor; - -/*~ If you want to expose types from your module as well, you can - *~ place them in this block. Often you will want to describe the - *~ shape of the return type of the function; that type should - *~ be declared in here, as this example shows. - */ -declare namespace parser { - /* copied from postcss -- so we don't need to add a dependency */ - type ErrorOptions = { - plugin?: string; - word?: string; - index?: number - }; - /* the bits we use of postcss.Rule, copied from postcss -- so we don't need to add a dependency */ - type PostCSSRuleNode = { - selector: string - /** - * @returns postcss.CssSyntaxError but it's a complex object, caller - * should cast to it if they have a dependency on postcss. - */ - error(message: string, options?: ErrorOptions): Error; - }; - /** Accepts a string */ - type Selectors = string | PostCSSRuleNode - type ProcessorFn = (root: parser.Root) => ReturnType; - type SyncProcessor = ProcessorFn; - type AsyncProcessor = ProcessorFn>; - - const TAG: "tag"; - const STRING: "string"; - const SELECTOR: "selector"; - const ROOT: "root"; - const PSEUDO: "pseudo"; - const NESTING: "nesting"; - const ID: "id"; - const COMMENT: "comment"; - const COMBINATOR: "combinator"; - const CLASS: "class"; - const ATTRIBUTE: "attribute"; - const UNIVERSAL: "universal"; - - interface NodeTypes { - tag: Tag, - string: String, - selector: Selector, - root: Root, - pseudo: Pseudo, - nesting: Nesting, - id: Identifier, - comment: Comment, - combinator: Combinator, - class: ClassName, - attribute: Attribute, - universal: Universal - } - - type Node = NodeTypes[keyof NodeTypes]; - - function isNode(node: any): node is Node; - - interface Options { - /** - * Preserve whitespace when true. Default: false; - */ - lossless: boolean; - /** - * When true and a postcss.Rule is passed, set the result of - * processing back onto the rule when done. Default: false. - */ - updateSelector: boolean; - } - class Processor< - TransformType = never, - SyncSelectorsType extends Selectors | never = Selectors - > { - res: Root; - readonly result: String; - ast(selectors: Selectors, options?: Partial): Promise; - astSync(selectors: SyncSelectorsType, options?: Partial): Root; - transform(selectors: Selectors, options?: Partial): Promise; - transformSync(selectors: SyncSelectorsType, options?: Partial): TransformType; - process(selectors: Selectors, options?: Partial): Promise; - processSync(selectors: SyncSelectorsType, options?: Partial): string; - } - interface ParserOptions { - css: string; - error: (message: string, options: ErrorOptions) => Error; - options: Options; - } - class Parser { - input: ParserOptions; - lossy: boolean; - position: number; - root: Root; - selectors: string; - current: Selector; - constructor(input: ParserOptions); - /** - * Raises an error, if the processor is invoked on - * a postcss Rule node, a better error message is raised. - */ - error(message: string, options?: ErrorOptions): void; - } - interface NodeSource { - start?: { - line: number, - column: number - }, - end?: { - line: number, - column: number - } - } - interface SpaceAround { - before: string; - after: string; - } - interface Spaces extends SpaceAround { - [spaceType: string]: string | Partial | undefined; - } - interface NodeOptions { - value: Value; - spaces?: Partial; - source?: NodeSource; - sourceIndex?: number; - } - interface Base< - Value extends string | undefined = string, - ParentType extends Container | undefined = Container | undefined - > { - type: keyof NodeTypes; - parent: ParentType; - value: Value; - spaces: Spaces; - source?: NodeSource; - sourceIndex: number; - rawSpaceBefore: string; - rawSpaceAfter: string; - remove(): Node; - replaceWith(...nodes: Node[]): Node; - next(): Node; - prev(): Node; - clone(opts: {[override: string]:any}): Node; - /** - * Return whether this node includes the character at the position of the given line and column. - * Returns undefined if the nodes lack sufficient source metadata to determine the position. - * @param line 1-index based line number relative to the start of the selector. - * @param column 1-index based column number relative to the start of the selector. - */ - isAtPosition(line: number, column: number): boolean | undefined; - /** - * Some non-standard syntax doesn't follow normal escaping rules for css, - * this allows the escaped value to be specified directly, allowing illegal characters to be - * directly inserted into css output. - * @param name the property to set - * @param value the unescaped value of the property - * @param valueEscaped optional. the escaped value of the property. - */ - setPropertyAndEscape(name: string, value: any, valueEscaped: string): void; - /** - * When you want a value to passed through to CSS directly. This method - * deletes the corresponding raw value causing the stringifier to fallback - * to the unescaped value. - * @param name the property to set. - * @param value The value that is both escaped and unescaped. - */ - setPropertyWithoutEscape(name: string, value: any): void; - /** - * Some non-standard syntax doesn't follow normal escaping rules for css. - * This allows non standard syntax to be appended to an existing property - * by specifying the escaped value. By specifying the escaped value, - * illegal characters are allowed to be directly inserted into css output. - * @param {string} name the property to set - * @param {any} value the unescaped value of the property - * @param {string} valueEscaped optional. the escaped value of the property. - */ - appendToPropertyAndEscape(name: string, value: any, valueEscaped: string): void; - toString(): string; - } - interface ContainerOptions extends NodeOptions { - nodes?: Array; - } - interface Container< - Value extends string | undefined = string, - Child extends Node = Node - > extends Base { - nodes: Array; - append(selector: Selector): this; - prepend(selector: Selector): this; - at(index: number): Child; - /** - * Return the most specific node at the line and column number given. - * The source location is based on the original parsed location, locations aren't - * updated as selector nodes are mutated. - * - * Note that this location is relative to the location of the first character - * of the selector, and not the location of the selector in the overall document - * when used in conjunction with postcss. - * - * If not found, returns undefined. - * @param line The line number of the node to find. (1-based index) - * @param col The column number of the node to find. (1-based index) - */ - atPosition(line: number, column: number): Child; - index(child: Child): number; - readonly first: Child; - readonly last: Child; - readonly length: number; - removeChild(child: Child): this; - removeAll(): Container; - empty(): Container; - insertAfter(oldNode: Child, newNode: Child): this; - insertBefore(oldNode: Child, newNode: Child): this; - each(callback: (node: Child) => boolean | void): boolean | undefined; - walk( - callback: (node: Node) => boolean | void - ): boolean | undefined; - walkAttributes( - callback: (node: Attribute) => boolean | void - ): boolean | undefined; - walkClasses( - callback: (node: ClassName) => boolean | void - ): boolean | undefined; - walkCombinators( - callback: (node: Combinator) => boolean | void - ): boolean | undefined; - walkComments( - callback: (node: Comment) => boolean | void - ): boolean | undefined; - walkIds( - callback: (node: Identifier) => boolean | void - ): boolean | undefined; - walkNesting( - callback: (node: Nesting) => boolean | void - ): boolean | undefined; - walkPseudos( - callback: (node: Pseudo) => boolean | void - ): boolean | undefined; - walkTags(callback: (node: Tag) => boolean | void): boolean | undefined; - split(callback: (node: Child) => boolean): [Child[], Child[]]; - map(callback: (node: Child) => T): T[]; - reduce( - callback: ( - previousValue: Child, - currentValue: Child, - currentIndex: number, - array: readonly Child[] - ) => Child - ): Child; - reduce( - callback: ( - previousValue: Child, - currentValue: Child, - currentIndex: number, - array: readonly Child[] - ) => Child, - initialValue: Child - ): Child; - reduce( - callback: ( - previousValue: T, - currentValue: Child, - currentIndex: number, - array: readonly Child[] - ) => T, - initialValue: T - ): T; - every(callback: (node: Child) => boolean): boolean; - some(callback: (node: Child) => boolean): boolean; - filter(callback: (node: Child) => boolean): Child[]; - sort(callback: (nodeA: Child, nodeB: Child) => number): Child[]; - toString(): string; - } - function isContainer(node: any): node is Root | Selector | Pseudo; - - interface NamespaceOptions extends NodeOptions { - namespace?: string | true; - } - interface Namespace extends Base { - /** alias for namespace */ - ns: string | true; - /** - * namespace prefix. - */ - namespace: string | true; - /** - * If a namespace exists, prefix the value provided with it, separated by |. - */ - qualifiedName(value: string): string; - /** - * A string representing the namespace suitable for output. - */ - readonly namespaceString: string; - } - function isNamespace(node: any): node is Attribute | Tag; - - interface Root extends Container { - type: "root"; - /** - * Raises an error, if the processor is invoked on - * a postcss Rule node, a better error message is raised. - */ - error(message: string, options?: ErrorOptions): Error; - nodeAt(line: number, column: number): Node - } - function root(opts: ContainerOptions): Root; - function isRoot(node: any): node is Root; - - interface _Selector extends Container> { - type: "selector"; - } - type Selector = _Selector; - function selector(opts: ContainerOptions): Selector; - function isSelector(node: any): node is Selector; - - interface CombinatorRaws { - value?: string; - spaces?: { - before?: string; - after?: string; - }; - } - interface Combinator extends Base { - type: "combinator"; - raws?: CombinatorRaws; - } - function combinator(opts: NodeOptions): Combinator; - function isCombinator(node: any): node is Combinator; - - interface ClassName extends Base { - type: "class"; - } - function className(opts: NamespaceOptions): ClassName; - function isClassName(node: any): node is ClassName; - - type AttributeOperator = "=" | "~=" | "|=" | "^=" | "$=" | "*="; - type QuoteMark = '"' | "'" | null; - interface PreferredQuoteMarkOptions { - quoteMark?: QuoteMark; - preferCurrentQuoteMark?: boolean; - } - interface SmartQuoteMarkOptions extends PreferredQuoteMarkOptions { - smart?: boolean; - } - interface AttributeOptions extends NamespaceOptions { - attribute: string; - operator?: AttributeOperator; - insensitive?: boolean; - quoteMark?: QuoteMark; - /** @deprecated Use quoteMark instead. */ - quoted?: boolean; - spaces?: { - before?: string; - after?: string; - attribute?: Partial; - operator?: Partial; - value?: Partial; - insensitive?: Partial; - } - raws: { - unquoted?: string; - attribute?: string; - operator?: string; - value?: string; - insensitive?: string; - spaces?: { - attribute?: Partial; - operator?: Partial; - value?: Partial; - insensitive?: Partial; - } - }; - } - interface Attribute extends Namespace { - type: "attribute"; - attribute: string; - operator?: AttributeOperator; - insensitive?: boolean; - quoteMark: QuoteMark; - quoted?: boolean; - spaces: { - before: string; - after: string; - attribute?: Partial; - operator?: Partial; - value?: Partial; - insensitive?: Partial; - } - raws: { - /** @deprecated The attribute value is unquoted, use that instead.. */ - unquoted?: string; - attribute?: string; - operator?: string; - /** The value of the attribute with quotes and escapes. */ - value?: string; - insensitive?: string; - spaces?: { - attribute?: Partial; - operator?: Partial; - value?: Partial; - insensitive?: Partial; - } - }; - /** - * The attribute name after having been qualified with a namespace. - */ - readonly qualifiedAttribute: string; - - /** - * The case insensitivity flag or an empty string depending on whether this - * attribute is case insensitive. - */ - readonly insensitiveFlag : 'i' | ''; - - /** - * Returns the attribute's value quoted such that it would be legal to use - * in the value of a css file. The original value's quotation setting - * used for stringification is left unchanged. See `setValue(value, options)` - * if you want to control the quote settings of a new value for the attribute or - * `set quoteMark(mark)` if you want to change the quote settings of the current - * value. - * - * You can also change the quotation used for the current value by setting quoteMark. - **/ - getQuotedValue(options?: SmartQuoteMarkOptions): string; - - /** - * Set the unescaped value with the specified quotation options. The value - * provided must not include any wrapping quote marks -- those quotes will - * be interpreted as part of the value and escaped accordingly. - * @param value - */ - setValue(value: string, options?: SmartQuoteMarkOptions): void; - - /** - * Intelligently select a quoteMark value based on the value's contents. If - * the value is a legal CSS ident, it will not be quoted. Otherwise a quote - * mark will be picked that minimizes the number of escapes. - * - * If there's no clear winner, the quote mark from these options is used, - * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is - * true). If the quoteMark is unspecified, a double quote is used. - **/ - smartQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark; - - /** - * Selects the preferred quote mark based on the options and the current quote mark value. - * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` - * instead. - */ - preferredQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark - - /** - * returns the offset of the attribute part specified relative to the - * start of the node of the output string. - * - * * "ns" - alias for "namespace" - * * "namespace" - the namespace if it exists. - * * "attribute" - the attribute name - * * "attributeNS" - the start of the attribute or its namespace - * * "operator" - the match operator of the attribute - * * "value" - The value (string or identifier) - * * "insensitive" - the case insensitivity flag; - * @param part One of the possible values inside an attribute. - * @returns -1 if the name is invalid or the value doesn't exist in this attribute. - */ - offsetOf(part: "ns" | "namespace" | "attribute" | "attributeNS" | "operator" | "value" | "insensitive"): number; - } - function attribute(opts: AttributeOptions): Attribute; - function isAttribute(node: any): node is Attribute; - - interface Pseudo extends Container { - type: "pseudo"; - } - function pseudo(opts: ContainerOptions): Pseudo; - /** - * Checks wether the node is the Psuedo subtype of node. - */ - function isPseudo(node: any): node is Pseudo; - - /** - * Checks wether the node is, specifically, a pseudo element instead of - * pseudo class. - */ - function isPseudoElement(node: any): node is Pseudo; - - /** - * Checks wether the node is, specifically, a pseudo class instead of - * pseudo element. - */ - function isPseudoClass(node: any): node is Pseudo; - - - interface Tag extends Namespace { - type: "tag"; - } - function tag(opts: NamespaceOptions): Tag; - function isTag(node: any): node is Tag; - - interface Comment extends Base { - type: "comment"; - } - function comment(opts: NodeOptions): Comment; - function isComment(node: any): node is Comment; - - interface Identifier extends Base { - type: "id"; - } - function id(opts: any): any; - function isIdentifier(node: any): node is Identifier; - - interface Nesting extends Base { - type: "nesting"; - } - function nesting(opts: any): any; - function isNesting(node: any): node is Nesting; - - interface String extends Base { - type: "string"; - } - function string(opts: NodeOptions): String; - function isString(node: any): node is String; - - interface Universal extends Base { - type: "universal"; - } - function universal(opts?: NamespaceOptions): any; - function isUniversal(node: any): node is Universal; -} diff --git a/node_modules/@tailwindcss/typography/package.json b/node_modules/@tailwindcss/typography/package.json deleted file mode 100644 index 52751762eba731e139921da14d190c83385090b1..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@tailwindcss/typography", - "version": "0.5.15", - "description": "A Tailwind CSS plugin for automatically styling plain HTML content with beautiful typographic defaults.", - "main": "src/index.js", - "types": "src/index.d.ts", - "files": [ - "src/*.js", - "src/*.d.ts", - "dist/" - ], - "repository": "https://github.com/tailwindlabs/tailwindcss-typography", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "prettier": { - "printWidth": 100, - "semi": false, - "singleQuote": true, - "trailingComma": "es5" - }, - "scripts": { - "test": "jest", - "dev": "next dev demo", - "build": "next build demo", - "export": "next export demo", - "start": "next start demo", - "release-channel": "node ./scripts/release-channel.js", - "release-notes": "node ./scripts/release-notes.js" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20" - }, - "devDependencies": { - "@mdx-js/loader": "^1.0.19", - "@mdx-js/mdx": "^1.6.6", - "@next/mdx": "^8.1.0", - "autoprefixer": "^10.2.1", - "highlight.js": "^10.4.1", - "jest": "^29.7.0", - "jest-diff": "^27.3.1", - "next": "^12.0.1", - "postcss": "^8.2.3", - "prettier": "^2.1.2", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "tailwindcss": "^3.2.2" - }, - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "jest": { - "setupFilesAfterEnv": [ - "/jest/customMatchers.js" - ] - } -} diff --git a/node_modules/@tailwindcss/typography/src/index.d.ts b/node_modules/@tailwindcss/typography/src/index.d.ts deleted file mode 100644 index 5c38097ca0fedab6c02acd41630ef6f4a077179c..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/src/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare function plugin(options?: Partial<{ className: string; target: 'modern' | 'legacy' }>): { - handler: () => void -} - -declare namespace plugin { - const __isOptionsFunction: true -} - -export = plugin diff --git a/node_modules/@tailwindcss/typography/src/index.js b/node_modules/@tailwindcss/typography/src/index.js deleted file mode 100644 index 04830b9bf1373ded0a6358afc380e4ec208dcedf..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/src/index.js +++ /dev/null @@ -1,140 +0,0 @@ -const plugin = require('tailwindcss/plugin') -const merge = require('lodash.merge') -const castArray = require('lodash.castarray') -const styles = require('./styles') -const { commonTrailingPseudos } = require('./utils') - -const computed = { - // Reserved for future "magic properties", for example: - // bulletColor: (color) => ({ 'ul > li::before': { backgroundColor: color } }), -} - -function inWhere(selector, { className, modifier, prefix }) { - let prefixedNot = prefix(`.not-${className}`).slice(1) - let selectorPrefix = selector.startsWith('>') - ? `${modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`} ` - : '' - - // Parse the selector, if every component ends in the same pseudo element(s) then move it to the end - let [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector) - - if (trailingPseudo) { - return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}` - } - - return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))` -} - -function isObject(value) { - return typeof value === 'object' && value !== null -} - -function configToCss(config = {}, { target, className, modifier, prefix }) { - function updateSelector(k, v) { - if (target === 'legacy') { - return [k, v] - } - - if (Array.isArray(v)) { - return [k, v] - } - - if (isObject(v)) { - let nested = Object.values(v).some(isObject) - if (nested) { - return [ - inWhere(k, { className, modifier, prefix }), - v, - Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v))), - ] - } - - return [inWhere(k, { className, modifier, prefix }), v] - } - - return [k, v] - } - - return Object.fromEntries( - Object.entries( - merge( - {}, - ...Object.keys(config) - .filter((key) => computed[key]) - .map((key) => computed[key](config[key])), - ...castArray(config.css || {}) - ) - ).map(([k, v]) => updateSelector(k, v)) - ) -} - -module.exports = plugin.withOptions( - ({ className = 'prose', target = 'modern' } = {}) => { - return function ({ addVariant, addComponents, theme, prefix }) { - let modifiers = theme('typography') - - let options = { className, prefix } - - for (let [name, ...selectors] of [ - ['headings', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'th'], - ['h1'], - ['h2'], - ['h3'], - ['h4'], - ['h5'], - ['h6'], - ['p'], - ['a'], - ['blockquote'], - ['figure'], - ['figcaption'], - ['strong'], - ['em'], - ['kbd'], - ['code'], - ['pre'], - ['ol'], - ['ul'], - ['li'], - ['table'], - ['thead'], - ['tr'], - ['th'], - ['td'], - ['img'], - ['video'], - ['hr'], - ['lead', '[class~="lead"]'], - ]) { - selectors = selectors.length === 0 ? [name] : selectors - - let selector = - target === 'legacy' ? selectors.map((selector) => `& ${selector}`) : selectors.join(', ') - - addVariant( - `${className}-${name}`, - target === 'legacy' ? selector : `& :is(${inWhere(selector, options)})` - ) - } - - addComponents( - Object.keys(modifiers).map((modifier) => ({ - [modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`]: configToCss( - modifiers[modifier], - { - target, - className, - modifier, - prefix, - } - ), - })) - ) - } - }, - () => { - return { - theme: { typography: styles }, - } - } -) diff --git a/node_modules/@tailwindcss/typography/src/index.test.js b/node_modules/@tailwindcss/typography/src/index.test.js deleted file mode 100644 index 8db6c6cb9e230ab7b20e295a47e5eaafbfbc5e91..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/src/index.test.js +++ /dev/null @@ -1,1423 +0,0 @@ -const path = require('path') -const tailwind = require('tailwindcss') -const postcss = require('postcss') -const typographyPlugin = require('.') - -let html = String.raw -let css = String.raw - -let vars = ` - --tw-border-spacing-x: 0; - --tw-border-spacing-y: 0; - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - --tw-pan-x: ; - --tw-pan-y: ; - --tw-pinch-zoom: ; - --tw-scroll-snap-strictness: proximity; - --tw-ordinal: ; - --tw-slashed-zero: ; - --tw-numeric-figure: ; - --tw-numeric-spacing: ; - --tw-numeric-fraction: ; - --tw-ring-inset: ; - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgb(59 130 246 / 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; - --tw-shadow: 0 0 #0000; - --tw-shadow-colored: 0 0 #0000; - --tw-blur: ; - --tw-brightness: ; - --tw-contrast: ; - --tw-grayscale: ; - --tw-hue-rotate: ; - --tw-invert: ; - --tw-saturate: ; - --tw-sepia: ; - --tw-drop-shadow: ; - --tw-backdrop-blur: ; - --tw-backdrop-brightness: ; - --tw-backdrop-contrast: ; - --tw-backdrop-grayscale: ; - --tw-backdrop-hue-rotate: ; - --tw-backdrop-invert: ; - --tw-backdrop-opacity: ; - --tw-backdrop-saturate: ; - --tw-backdrop-sepia: ; -` -let defaults = css` - *, - ::before, - ::after { - ${vars} - } - ::backdrop { - ${vars} - } -` - -function run(config, plugin = tailwind) { - let { currentTestName } = expect.getState() - config = { - ...{ plugins: [typographyPlugin], corePlugins: { preflight: false } }, - ...config, - } - - return postcss(plugin(config)).process( - ['@tailwind base;', '@tailwind components;', '@tailwind utilities'].join('\n'), - { - from: `${path.resolve(__filename)}?test=${currentTestName}`, - } - ) -} - -test('specificity is reduced with :where', async () => { - let config = { - content: [{ raw: html`
` }], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - maxWidth: '65ch', - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'ol[type="A"]': { - listStyleType: 'upper-alpha', - }, - 'blockquote p:first-of-type::before': { - content: 'open-quote', - }, - 'blockquote p:last-of-type::after': { - content: 'close-quote', - }, - 'h4 strong': { - fontWeight: '700', - }, - 'figure > *': { - margin: 0, - }, - 'ol > li::marker': { - fontWeight: '400', - color: 'var(--tw-prose-counters)', - }, - '> ul > li p': { - marginTop: '16px', - marginBottom: '16px', - }, - 'code::before': { - content: '"`"', - }, - 'code::after': { - content: '"`"', - }, - }, - ], - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .prose { - color: var(--tw-prose-body); - max-width: 65ch; - } - .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-lead); - } - .prose :where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-bold); - font-weight: 600; - } - .prose :where(ol[type='A']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - list-style-type: upper-alpha; - } - .prose - :where(blockquote p:first-of-type):not(:where([class~='not-prose'], [class~='not-prose'] - *))::before { - content: open-quote; - } - .prose - :where(blockquote p:last-of-type):not(:where([class~='not-prose'], [class~='not-prose'] - *))::after { - content: close-quote; - } - .prose :where(h4 strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-weight: 700; - } - .prose :where(figure > *):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - margin: 0; - } - .prose :where(ol > li):not(:where([class~='not-prose'], [class~='not-prose'] *))::marker { - font-weight: 400; - color: var(--tw-prose-counters); - } - .prose - :where(.prose > ul > li p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - margin-top: 16px; - margin-bottom: 16px; - } - .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { - content: '`'; - } - .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::after { - content: '`'; - } - ` - ) - }) -}) - -test('variants', async () => { - let config = { - content: [{ raw: html`
` }], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'red', - p: { - color: 'lime', - }, - '> ul > li': { - color: 'purple', - }, - }, - ], - }, - lg: { - css: { - color: 'green', - p: { - color: 'tomato', - }, - '> ul > li': { - color: 'blue', - }, - }, - }, - xl: { - css: { - color: 'yellow', - '> ul > li': { - color: 'hotpink', - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .hover\:prose-lg:hover { - color: green; - } - .hover\:prose-lg:hover :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: tomato; - } - .hover\:prose-lg:hover - :where(.hover\:prose-lg:hover - > ul - > li):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: blue; - } - @media (min-width: 640px) { - .sm\:prose { - color: red; - } - .sm\:prose :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: lime; - } - .sm\:prose - :where(.sm\:prose > ul > li):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: purple; - } - } - @media (min-width: 1024px) { - .lg\:prose-lg { - color: green; - } - .lg\:prose-lg :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: tomato; - } - .lg\:prose-lg - :where(.lg\:prose-lg > ul > li):not(:where([class~='not-prose'], [class~='not-prose'] - *)) { - color: blue; - } - } - ` - ) - }) -}) - -test('modifiers', async () => { - let config = { - content: [{ raw: html`
` }], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - maxWidth: '65ch', - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'ol[type="A"]': { - listStyleType: 'upper-alpha', - }, - 'blockquote p:first-of-type::before': { - content: 'open-quote', - }, - 'blockquote p:last-of-type::after': { - content: 'close-quote', - }, - 'h4 strong': { - fontWeight: '700', - }, - 'figure > *': { - margin: 0, - }, - 'ol > li::marker': { - fontWeight: '400', - color: 'var(--tw-prose-counters)', - }, - 'code::before': { - content: '"`"', - }, - 'code::after': { - content: '"`"', - }, - }, - ], - }, - lg: { - css: [ - { - fontSize: '18px', - lineHeight: '1.75', - p: { - marginTop: '24px', - marginBottom: '24px', - }, - '[class~="lead"]': { - fontSize: '22px', - }, - blockquote: { - marginTop: '40px', - marginBottom: '40px', - }, - '> ul > li': { - paddingLeft: '12px', - }, - h1: { - fontSize: '48px', - marginTop: '0', - marginBottom: '40px', - }, - h2: { - fontSize: '30px', - marginTop: '56px', - marginBottom: '32px', - }, - h3: { - fontSize: '24px', - marginTop: '40px', - marginBottom: '16px', - }, - }, - ], - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .prose { - color: var(--tw-prose-body); - max-width: 65ch; - } - .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-lead); - } - .prose :where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-bold); - font-weight: 600; - } - .prose :where(ol[type='A']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - list-style-type: upper-alpha; - } - .prose - :where(blockquote p:first-of-type):not(:where([class~='not-prose'], [class~='not-prose'] - *))::before { - content: open-quote; - } - .prose - :where(blockquote p:last-of-type):not(:where([class~='not-prose'], [class~='not-prose'] - *))::after { - content: close-quote; - } - .prose :where(h4 strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-weight: 700; - } - .prose :where(figure > *):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - margin: 0; - } - .prose :where(ol > li):not(:where([class~='not-prose'], [class~='not-prose'] *))::marker { - font-weight: 400; - color: var(--tw-prose-counters); - } - .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { - content: '`'; - } - .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::after { - content: '`'; - } - .prose-lg { - font-size: 18px; - line-height: 1.75; - } - .prose-lg :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - margin-top: 24px; - margin-bottom: 24px; - } - .prose-lg - :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-size: 22px; - } - .prose-lg :where(blockquote):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - margin-top: 40px; - margin-bottom: 40px; - } - .prose-lg - :where(.prose-lg > ul > li):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - padding-left: 12px; - } - .prose-lg :where(h1):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-size: 48px; - margin-top: 0; - margin-bottom: 40px; - } - .prose-lg :where(h2):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-size: 30px; - margin-top: 56px; - margin-bottom: 32px; - } - .prose-lg :where(h3):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-size: 24px; - margin-top: 40px; - margin-bottom: 16px; - } - ` - ) - }) -}) - -test('legacy target', async () => { - let config = { - plugins: [typographyPlugin({ target: 'legacy' })], - content: [ - { raw: html`
` }, - ], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - maxWidth: '65ch', - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'ol[type="A"]': { - listStyleType: 'upper-alpha', - }, - 'blockquote p:first-of-type::before': { - content: 'open-quote', - }, - 'blockquote p:last-of-type::after': { - content: 'close-quote', - }, - 'h4 strong': { - fontWeight: '700', - }, - 'figure > *': { - margin: 0, - }, - 'ol > li::marker': { - fontWeight: '400', - color: 'var(--tw-prose-counters)', - }, - 'code::before': { - content: '"`"', - }, - 'code::after': { - content: '"`"', - }, - }, - ], - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .prose { - color: var(--tw-prose-body); - max-width: 65ch; - } - .prose [class~='lead'] { - color: var(--tw-prose-lead); - } - .prose strong { - color: var(--tw-prose-bold); - font-weight: 600; - } - .prose ol[type='A'] { - list-style-type: upper-alpha; - } - .prose blockquote p:first-of-type::before { - content: open-quote; - } - .prose blockquote p:last-of-type::after { - content: close-quote; - } - .prose h4 strong { - font-weight: 700; - } - .prose figure > * { - margin: 0; - } - .prose ol > li::marker { - font-weight: 400; - color: var(--tw-prose-counters); - } - .prose code::before { - content: '`'; - } - .prose code::after { - content: '`'; - } - .prose-headings\:text-ellipsis h1 { - text-overflow: ellipsis; - } - .prose-headings\:text-ellipsis h2 { - text-overflow: ellipsis; - } - .prose-headings\:text-ellipsis h3 { - text-overflow: ellipsis; - } - .prose-headings\:text-ellipsis h4 { - text-overflow: ellipsis; - } - .prose-headings\:text-ellipsis h5 { - text-overflow: ellipsis; - } - .prose-headings\:text-ellipsis h6 { - text-overflow: ellipsis; - } - .prose-headings\:text-ellipsis th { - text-overflow: ellipsis; - } - .prose-h1\:text-center h1 { - text-align: center; - } - ` - ) - }) -}) - -test('custom class name', async () => { - let config = { - plugins: [typographyPlugin({ className: 'markdown' })], - content: [{ raw: html`
` }], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - maxWidth: '65ch', - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'ol[type="A"]': { - listStyleType: 'upper-alpha', - }, - 'blockquote p:first-of-type::before': { - content: 'open-quote', - }, - 'blockquote p:last-of-type::after': { - content: 'close-quote', - }, - 'h4 strong': { - fontWeight: '700', - }, - 'figure > *': { - margin: 0, - }, - 'ol > li::marker': { - fontWeight: '400', - color: 'var(--tw-prose-counters)', - }, - 'code::before': { - content: '"`"', - }, - 'code::after': { - content: '"`"', - }, - }, - ], - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .markdown { - color: var(--tw-prose-body); - max-width: 65ch; - } - .markdown - :where([class~='lead']):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - color: var(--tw-prose-lead); - } - .markdown :where(strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - color: var(--tw-prose-bold); - font-weight: 600; - } - .markdown - :where(ol[type='A']):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - list-style-type: upper-alpha; - } - .markdown - :where(blockquote - p:first-of-type):not(:where([class~='not-markdown'], [class~='not-markdown'] - *))::before { - content: open-quote; - } - .markdown - :where(blockquote - p:last-of-type):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::after { - content: close-quote; - } - .markdown - :where(h4 strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - font-weight: 700; - } - .markdown - :where(figure > *):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - margin: 0; - } - .markdown - :where(ol > li):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::marker { - font-weight: 400; - color: var(--tw-prose-counters); - } - .markdown - :where(code):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::before { - content: '`'; - } - .markdown - :where(code):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::after { - content: '`'; - } - ` - ) - }) -}) - -test('element variants', async () => { - let config = { - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'h4 strong': { - fontWeight: '700', - }, - }, - ], - }, - }, - }, - } - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .prose { - color: var(--tw-prose-body); - } - .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-lead); - } - .prose :where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-bold); - font-weight: 600; - } - .prose :where(h4 strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - font-weight: 700; - } - .prose-headings\:underline - :is(:where(h1, h2, h3, h4, h5, h6, th):not(:where([class~='not-prose'], [class~='not-prose'] - *))) { - text-decoration-line: underline; - } - .prose-h1\:text-3xl - :is(:where(h1):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-size: 1.875rem; - line-height: 2.25rem; - } - .prose-h2\:text-2xl - :is(:where(h2):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-size: 1.5rem; - line-height: 2rem; - } - .prose-h3\:text-xl - :is(:where(h3):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-size: 1.25rem; - line-height: 1.75rem; - } - .prose-h4\:text-lg - :is(:where(h4):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-size: 1.125rem; - line-height: 1.75rem; - } - .prose-p\:text-gray-700 - :is(:where(p):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); - } - .prose-a\:font-bold - :is(:where(a):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-weight: 700; - } - .prose-blockquote\:italic - :is(:where(blockquote):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-style: italic; - } - .prose-figure\:mx-auto - :is(:where(figure):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - margin-left: auto; - margin-right: auto; - } - .prose-figcaption\:opacity-75 - :is(:where(figcaption):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - opacity: 0.75; - } - .prose-strong\:font-medium - :is(:where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-weight: 500; - } - .prose-em\:italic - :is(:where(em):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-style: italic; - } - .prose-kbd\:border-b-2 - :is(:where(kbd):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - border-bottom-width: 2px; - } - .prose-code\:font-mono - :is(:where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', - 'Courier New', monospace; - } - .prose-pre\:font-mono - :is(:where(pre):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', - 'Courier New', monospace; - } - .prose-ol\:pl-6 :is(:where(ol):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - padding-left: 1.5rem; - } - .prose-ul\:pl-8 :is(:where(ul):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - padding-left: 2rem; - } - .prose-li\:my-4 :is(:where(li):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - margin-top: 1rem; - margin-bottom: 1rem; - } - .prose-table\:my-8 - :is(:where(table):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - margin-top: 2rem; - margin-bottom: 2rem; - } - .prose-thead\:border-red-300 - :is(:where(thead):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - --tw-border-opacity: 1; - border-color: rgb(252 165 165 / var(--tw-border-opacity)); - } - .prose-tr\:border-red-200 - :is(:where(tr):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - --tw-border-opacity: 1; - border-color: rgb(254 202 202 / var(--tw-border-opacity)); - } - .prose-th\:text-left - :is(:where(th):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - text-align: left; - } - .prose-img\:rounded-lg - :is(:where(img):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - border-radius: 0.5rem; - } - .prose-video\:my-12 - :is(:where(video):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - margin-top: 3rem; - margin-bottom: 3rem; - } - .prose-hr\:border-t-2 - :is(:where(hr):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - border-top-width: 2px; - } - .prose-lead\:italic - :is(:where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-style: italic; - } - ` - ) - }) -}) - -test('element variants with custom class name', async () => { - let config = { - plugins: [typographyPlugin({ className: 'markdown' })], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'h4 strong': { - fontWeight: '700', - }, - }, - ], - }, - }, - }, - } - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .markdown { - color: var(--tw-prose-body); - } - .markdown - :where([class~='lead']):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - color: var(--tw-prose-lead); - } - .markdown :where(strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - color: var(--tw-prose-bold); - font-weight: 600; - } - .markdown - :where(h4 strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { - font-weight: 700; - } - .markdown-headings\:underline - :is(:where(h1, h2, h3, h4, h5, h6, th):not(:where([class~='not-markdown'], [class~='not-markdown'] - *))) { - text-decoration-line: underline; - } - .markdown-h1\:text-3xl - :is(:where(h1):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-size: 1.875rem; - line-height: 2.25rem; - } - .markdown-h2\:text-2xl - :is(:where(h2):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-size: 1.5rem; - line-height: 2rem; - } - .markdown-h3\:text-xl - :is(:where(h3):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-size: 1.25rem; - line-height: 1.75rem; - } - .markdown-h4\:text-lg - :is(:where(h4):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-size: 1.125rem; - line-height: 1.75rem; - } - .markdown-p\:text-gray-700 - :is(:where(p):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); - } - .markdown-a\:font-bold - :is(:where(a):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-weight: 700; - } - .markdown-blockquote\:italic - :is(:where(blockquote):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-style: italic; - } - .markdown-figure\:mx-auto - :is(:where(figure):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - margin-left: auto; - margin-right: auto; - } - .markdown-figcaption\:opacity-75 - :is(:where(figcaption):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - opacity: 0.75; - } - .markdown-strong\:font-medium - :is(:where(strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-weight: 500; - } - .markdown-em\:italic - :is(:where(em):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-style: italic; - } - .markdown-kbd\:border-b-2 - :is(:where(kbd):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - border-bottom-width: 2px; - } - .markdown-code\:font-mono - :is(:where(code):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', - 'Courier New', monospace; - } - .markdown-pre\:font-mono - :is(:where(pre):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', - 'Courier New', monospace; - } - .markdown-ol\:pl-6 - :is(:where(ol):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - padding-left: 1.5rem; - } - .markdown-ul\:pl-8 - :is(:where(ul):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - padding-left: 2rem; - } - .markdown-li\:my-4 - :is(:where(li):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - margin-top: 1rem; - margin-bottom: 1rem; - } - .markdown-table\:my-8 - :is(:where(table):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - margin-top: 2rem; - margin-bottom: 2rem; - } - .markdown-thead\:border-red-300 - :is(:where(thead):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - --tw-border-opacity: 1; - border-color: rgb(252 165 165 / var(--tw-border-opacity)); - } - .markdown-tr\:border-red-200 - :is(:where(tr):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - --tw-border-opacity: 1; - border-color: rgb(254 202 202 / var(--tw-border-opacity)); - } - .markdown-th\:text-left - :is(:where(th):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - text-align: left; - } - .markdown-img\:rounded-lg - :is(:where(img):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - border-radius: 0.5rem; - } - .markdown-video\:my-12 - :is(:where(video):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - margin-top: 3rem; - margin-bottom: 3rem; - } - .markdown-hr\:border-t-2 - :is(:where(hr):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { - border-top-width: 2px; - } - .markdown-lead\:italic - :is(:where([class~='lead']):not(:where([class~='not-markdown'], [class~='not-markdown'] - *))) { - font-style: italic; - } - ` - ) - }) -}) - -test('customizing defaults with multiple values does not result in invalid css', async () => { - let config = { - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: { - textAlign: ['-webkit-match-parent', 'match-parent'], - }, - }, - }, - }, - } - return run(config).then((result) => { - expect(result.css).toMatchFormattedCss( - css` - ${defaults} - - .prose { - text-align: -webkit-match-parent; - text-align: match-parent; - } - ` - ) - }) -}) - -it('should be possible to use nested syntax (&) when extending the config', () => { - let config = { - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - extend: { - typography: { - DEFAULT: { - css: { - color: '#000', - a: { - color: '#888', - '&:hover': { - color: '#ff0000', - }, - }, - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .prose { - color: #000; - max-width: 65ch; - } - `) - - expect(result.css).toIncludeCss(css` - .prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: #888; - text-decoration: underline; - font-weight: 500; - } - `) - - expect(result.css).toIncludeCss(css` - .prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)):hover { - color: #ff0000; - } - `) - }) -}) - -it('should be possible to specify custom h5 and h6 styles', () => { - let config = { - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .prose-h5\:text-sm :is(:where(h5):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-size: 0.875rem; - line-height: 1.25rem; - } - .prose-h6\:text-xl :is(:where(h6):not(:where([class~='not-prose'], [class~='not-prose'] *))) { - font-size: 1.25rem; - line-height: 1.75rem; - } - `) - }) -}) - -it('should not break with multiple selectors with pseudo elements using variants', () => { - let config = { - darkMode: 'class', - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: { - 'ol li::before, ul li::before': { - color: 'red', - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .dark - .dark\:prose - :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { - color: red; - } - `) - }) -}) - -it('lifts all common, trailing pseudo elements when the same across all selectors', () => { - let config = { - darkMode: 'class', - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: { - 'ol li::marker::before, ul li::marker::before': { - color: 'red', - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .prose - :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] - *))::marker::before { - color: red; - } - `) - - // TODO: The output here is a bug in tailwindcss variant selector rewriting - // IT should be ::marker::before - expect(result.css).toIncludeCss(css` - .dark - .dark\:prose - :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] - *))::before::marker { - color: red; - } - `) - }) -}) - -it('does not modify selectors with differing pseudo elements', () => { - let config = { - darkMode: 'class', - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: { - 'ol li::before, ul li::after': { - color: 'red', - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .prose - :where(ol li::before, ul li::after):not(:where([class~='not-prose'], [class~='not-prose'] - *)) { - color: red; - } - `) - - // TODO: The output here is a bug in tailwindcss variant selector rewriting - expect(result.css).toIncludeCss(css` - .dark - .dark\:prose - :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] *))::before, - ::after { - color: red; - } - `) - }) -}) - -it('lifts only the common, trailing pseudo elements from selectors', () => { - let config = { - darkMode: 'class', - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: { - 'ol li::scroll-thumb::before, ul li::scroll-track::before': { - color: 'red', - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .prose - :where(ol li::scroll-thumb, ul - li::scroll-track):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { - color: red; - } - `) - - // TODO: The output here is a bug in tailwindcss variant selector rewriting - expect(result.css).toIncludeCss(css` - .dark - .dark\:prose - :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] - *))::scroll-thumb, - ::scroll-track, - ::before { - color: red; - } - `) - }) -}) - -it('ignores common non-trailing pseudo-elements in selectors', () => { - let config = { - darkMode: 'class', - plugins: [typographyPlugin()], - content: [ - { - raw: html`
`, - }, - ], - theme: { - typography: { - DEFAULT: { - css: { - 'ol li::before::scroll-thumb, ul li::before::scroll-track': { - color: 'red', - }, - }, - }, - }, - }, - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss(css` - .prose - :where(ol li::before::scroll-thumb, ul - li::before::scroll-track):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: red; - } - `) - - // TODO: The output here is a bug in tailwindcss variant selector rewriting - expect(result.css).toIncludeCss(css` - .dark - .dark\:prose - :where(ol li::scroll-thumb, ul - li::scroll-track):not(:where([class~='not-prose'], [class~='not-prose'] *))::before, - ::before { - color: red; - } - `) - }) -}) - -test('lead styles are inserted after paragraph styles', async () => { - let config = { - content: [{ raw: html`
` }], - } - - return run(config).then((result) => { - expect(result.css).toIncludeCss( - css` - .prose { - color: var(--tw-prose-body); - max-width: 65ch; - } - .prose :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - margin-top: 1.25em; - margin-bottom: 1.25em; - } - .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { - color: var(--tw-prose-lead); - font-size: 1.25em; - line-height: 1.6; - margin-top: 1.2em; - margin-bottom: 1.2em; - } - ` - ) - }) -}) diff --git a/node_modules/@tailwindcss/typography/src/styles.js b/node_modules/@tailwindcss/typography/src/styles.js deleted file mode 100644 index a4d6967391ee1b747a173193cab7bfe31c3014f3..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/src/styles.js +++ /dev/null @@ -1,1632 +0,0 @@ -const colors = require('tailwindcss/colors') - -const round = (num) => - num - .toFixed(7) - .replace(/(\.[0-9]+?)0+$/, '$1') - .replace(/\.0$/, '') -const rem = (px) => `${round(px / 16)}rem` -const em = (px, base) => `${round(px / base)}em` -const hexToRgb = (hex) => { - hex = hex.replace('#', '') - hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex - const r = parseInt(hex.substring(0, 2), 16) - const g = parseInt(hex.substring(2, 4), 16) - const b = parseInt(hex.substring(4, 6), 16) - return `${r} ${g} ${b}` -} - -let defaultModifiers = { - sm: { - css: [ - { - fontSize: rem(14), - lineHeight: round(24 / 14), - p: { - marginTop: em(16, 14), - marginBottom: em(16, 14), - }, - '[class~="lead"]': { - fontSize: em(18, 14), - lineHeight: round(28 / 18), - marginTop: em(16, 18), - marginBottom: em(16, 18), - }, - blockquote: { - marginTop: em(24, 18), - marginBottom: em(24, 18), - paddingInlineStart: em(20, 18), - }, - h1: { - fontSize: em(30, 14), - marginTop: '0', - marginBottom: em(24, 30), - lineHeight: round(36 / 30), - }, - h2: { - fontSize: em(20, 14), - marginTop: em(32, 20), - marginBottom: em(16, 20), - lineHeight: round(28 / 20), - }, - h3: { - fontSize: em(18, 14), - marginTop: em(28, 18), - marginBottom: em(8, 18), - lineHeight: round(28 / 18), - }, - h4: { - marginTop: em(20, 14), - marginBottom: em(8, 14), - lineHeight: round(20 / 14), - }, - img: { - marginTop: em(24, 14), - marginBottom: em(24, 14), - }, - picture: { - marginTop: em(24, 14), - marginBottom: em(24, 14), - }, - 'picture > img': { - marginTop: '0', - marginBottom: '0', - }, - video: { - marginTop: em(24, 14), - marginBottom: em(24, 14), - }, - kbd: { - fontSize: em(12, 14), - borderRadius: rem(5), - paddingTop: em(2, 14), - paddingInlineEnd: em(5, 14), - paddingBottom: em(2, 14), - paddingInlineStart: em(5, 14), - }, - code: { - fontSize: em(12, 14), - }, - 'h2 code': { - fontSize: em(18, 20), - }, - 'h3 code': { - fontSize: em(16, 18), - }, - pre: { - fontSize: em(12, 14), - lineHeight: round(20 / 12), - marginTop: em(20, 12), - marginBottom: em(20, 12), - borderRadius: rem(4), - paddingTop: em(8, 12), - paddingInlineEnd: em(12, 12), - paddingBottom: em(8, 12), - paddingInlineStart: em(12, 12), - }, - ol: { - marginTop: em(16, 14), - marginBottom: em(16, 14), - paddingInlineStart: em(22, 14), - }, - ul: { - marginTop: em(16, 14), - marginBottom: em(16, 14), - paddingInlineStart: em(22, 14), - }, - li: { - marginTop: em(4, 14), - marginBottom: em(4, 14), - }, - 'ol > li': { - paddingInlineStart: em(6, 14), - }, - 'ul > li': { - paddingInlineStart: em(6, 14), - }, - '> ul > li p': { - marginTop: em(8, 14), - marginBottom: em(8, 14), - }, - '> ul > li > p:first-child': { - marginTop: em(16, 14), - }, - '> ul > li > p:last-child': { - marginBottom: em(16, 14), - }, - '> ol > li > p:first-child': { - marginTop: em(16, 14), - }, - '> ol > li > p:last-child': { - marginBottom: em(16, 14), - }, - 'ul ul, ul ol, ol ul, ol ol': { - marginTop: em(8, 14), - marginBottom: em(8, 14), - }, - dl: { - marginTop: em(16, 14), - marginBottom: em(16, 14), - }, - dt: { - marginTop: em(16, 14), - }, - dd: { - marginTop: em(4, 14), - paddingInlineStart: em(22, 14), - }, - hr: { - marginTop: em(40, 14), - marginBottom: em(40, 14), - }, - 'hr + *': { - marginTop: '0', - }, - 'h2 + *': { - marginTop: '0', - }, - 'h3 + *': { - marginTop: '0', - }, - 'h4 + *': { - marginTop: '0', - }, - table: { - fontSize: em(12, 14), - lineHeight: round(18 / 12), - }, - 'thead th': { - paddingInlineEnd: em(12, 12), - paddingBottom: em(8, 12), - paddingInlineStart: em(12, 12), - }, - 'thead th:first-child': { - paddingInlineStart: '0', - }, - 'thead th:last-child': { - paddingInlineEnd: '0', - }, - 'tbody td, tfoot td': { - paddingTop: em(8, 12), - paddingInlineEnd: em(12, 12), - paddingBottom: em(8, 12), - paddingInlineStart: em(12, 12), - }, - 'tbody td:first-child, tfoot td:first-child': { - paddingInlineStart: '0', - }, - 'tbody td:last-child, tfoot td:last-child': { - paddingInlineEnd: '0', - }, - figure: { - marginTop: em(24, 14), - marginBottom: em(24, 14), - }, - 'figure > *': { - marginTop: '0', - marginBottom: '0', - }, - figcaption: { - fontSize: em(12, 14), - lineHeight: round(16 / 12), - marginTop: em(8, 12), - }, - }, - { - '> :first-child': { - marginTop: '0', - }, - '> :last-child': { - marginBottom: '0', - }, - }, - ], - }, - base: { - css: [ - { - fontSize: rem(16), - lineHeight: round(28 / 16), - p: { - marginTop: em(20, 16), - marginBottom: em(20, 16), - }, - '[class~="lead"]': { - fontSize: em(20, 16), - lineHeight: round(32 / 20), - marginTop: em(24, 20), - marginBottom: em(24, 20), - }, - blockquote: { - marginTop: em(32, 20), - marginBottom: em(32, 20), - paddingInlineStart: em(20, 20), - }, - h1: { - fontSize: em(36, 16), - marginTop: '0', - marginBottom: em(32, 36), - lineHeight: round(40 / 36), - }, - h2: { - fontSize: em(24, 16), - marginTop: em(48, 24), - marginBottom: em(24, 24), - lineHeight: round(32 / 24), - }, - h3: { - fontSize: em(20, 16), - marginTop: em(32, 20), - marginBottom: em(12, 20), - lineHeight: round(32 / 20), - }, - h4: { - marginTop: em(24, 16), - marginBottom: em(8, 16), - lineHeight: round(24 / 16), - }, - img: { - marginTop: em(32, 16), - marginBottom: em(32, 16), - }, - picture: { - marginTop: em(32, 16), - marginBottom: em(32, 16), - }, - 'picture > img': { - marginTop: '0', - marginBottom: '0', - }, - video: { - marginTop: em(32, 16), - marginBottom: em(32, 16), - }, - kbd: { - fontSize: em(14, 16), - borderRadius: rem(5), - paddingTop: em(3, 16), - paddingInlineEnd: em(6, 16), - paddingBottom: em(3, 16), - paddingInlineStart: em(6, 16), - }, - code: { - fontSize: em(14, 16), - }, - 'h2 code': { - fontSize: em(21, 24), - }, - 'h3 code': { - fontSize: em(18, 20), - }, - pre: { - fontSize: em(14, 16), - lineHeight: round(24 / 14), - marginTop: em(24, 14), - marginBottom: em(24, 14), - borderRadius: rem(6), - paddingTop: em(12, 14), - paddingInlineEnd: em(16, 14), - paddingBottom: em(12, 14), - paddingInlineStart: em(16, 14), - }, - ol: { - marginTop: em(20, 16), - marginBottom: em(20, 16), - paddingInlineStart: em(26, 16), - }, - ul: { - marginTop: em(20, 16), - marginBottom: em(20, 16), - paddingInlineStart: em(26, 16), - }, - li: { - marginTop: em(8, 16), - marginBottom: em(8, 16), - }, - 'ol > li': { - paddingInlineStart: em(6, 16), - }, - 'ul > li': { - paddingInlineStart: em(6, 16), - }, - '> ul > li p': { - marginTop: em(12, 16), - marginBottom: em(12, 16), - }, - '> ul > li > p:first-child': { - marginTop: em(20, 16), - }, - '> ul > li > p:last-child': { - marginBottom: em(20, 16), - }, - '> ol > li > p:first-child': { - marginTop: em(20, 16), - }, - '> ol > li > p:last-child': { - marginBottom: em(20, 16), - }, - 'ul ul, ul ol, ol ul, ol ol': { - marginTop: em(12, 16), - marginBottom: em(12, 16), - }, - dl: { - marginTop: em(20, 16), - marginBottom: em(20, 16), - }, - dt: { - marginTop: em(20, 16), - }, - dd: { - marginTop: em(8, 16), - paddingInlineStart: em(26, 16), - }, - hr: { - marginTop: em(48, 16), - marginBottom: em(48, 16), - }, - 'hr + *': { - marginTop: '0', - }, - 'h2 + *': { - marginTop: '0', - }, - 'h3 + *': { - marginTop: '0', - }, - 'h4 + *': { - marginTop: '0', - }, - table: { - fontSize: em(14, 16), - lineHeight: round(24 / 14), - }, - 'thead th': { - paddingInlineEnd: em(8, 14), - paddingBottom: em(8, 14), - paddingInlineStart: em(8, 14), - }, - 'thead th:first-child': { - paddingInlineStart: '0', - }, - 'thead th:last-child': { - paddingInlineEnd: '0', - }, - 'tbody td, tfoot td': { - paddingTop: em(8, 14), - paddingInlineEnd: em(8, 14), - paddingBottom: em(8, 14), - paddingInlineStart: em(8, 14), - }, - 'tbody td:first-child, tfoot td:first-child': { - paddingInlineStart: '0', - }, - 'tbody td:last-child, tfoot td:last-child': { - paddingInlineEnd: '0', - }, - figure: { - marginTop: em(32, 16), - marginBottom: em(32, 16), - }, - 'figure > *': { - marginTop: '0', - marginBottom: '0', - }, - figcaption: { - fontSize: em(14, 16), - lineHeight: round(20 / 14), - marginTop: em(12, 14), - }, - }, - { - '> :first-child': { - marginTop: '0', - }, - '> :last-child': { - marginBottom: '0', - }, - }, - ], - }, - lg: { - css: [ - { - fontSize: rem(18), - lineHeight: round(32 / 18), - p: { - marginTop: em(24, 18), - marginBottom: em(24, 18), - }, - '[class~="lead"]': { - fontSize: em(22, 18), - lineHeight: round(32 / 22), - marginTop: em(24, 22), - marginBottom: em(24, 22), - }, - blockquote: { - marginTop: em(40, 24), - marginBottom: em(40, 24), - paddingInlineStart: em(24, 24), - }, - h1: { - fontSize: em(48, 18), - marginTop: '0', - marginBottom: em(40, 48), - lineHeight: round(48 / 48), - }, - h2: { - fontSize: em(30, 18), - marginTop: em(56, 30), - marginBottom: em(32, 30), - lineHeight: round(40 / 30), - }, - h3: { - fontSize: em(24, 18), - marginTop: em(40, 24), - marginBottom: em(16, 24), - lineHeight: round(36 / 24), - }, - h4: { - marginTop: em(32, 18), - marginBottom: em(8, 18), - lineHeight: round(28 / 18), - }, - img: { - marginTop: em(32, 18), - marginBottom: em(32, 18), - }, - picture: { - marginTop: em(32, 18), - marginBottom: em(32, 18), - }, - 'picture > img': { - marginTop: '0', - marginBottom: '0', - }, - video: { - marginTop: em(32, 18), - marginBottom: em(32, 18), - }, - kbd: { - fontSize: em(16, 18), - borderRadius: rem(5), - paddingTop: em(4, 18), - paddingInlineEnd: em(8, 18), - paddingBottom: em(4, 18), - paddingInlineStart: em(8, 18), - }, - code: { - fontSize: em(16, 18), - }, - 'h2 code': { - fontSize: em(26, 30), - }, - 'h3 code': { - fontSize: em(21, 24), - }, - pre: { - fontSize: em(16, 18), - lineHeight: round(28 / 16), - marginTop: em(32, 16), - marginBottom: em(32, 16), - borderRadius: rem(6), - paddingTop: em(16, 16), - paddingInlineEnd: em(24, 16), - paddingBottom: em(16, 16), - paddingInlineStart: em(24, 16), - }, - ol: { - marginTop: em(24, 18), - marginBottom: em(24, 18), - paddingInlineStart: em(28, 18), - }, - ul: { - marginTop: em(24, 18), - marginBottom: em(24, 18), - paddingInlineStart: em(28, 18), - }, - li: { - marginTop: em(12, 18), - marginBottom: em(12, 18), - }, - 'ol > li': { - paddingInlineStart: em(8, 18), - }, - 'ul > li': { - paddingInlineStart: em(8, 18), - }, - '> ul > li p': { - marginTop: em(16, 18), - marginBottom: em(16, 18), - }, - '> ul > li > p:first-child': { - marginTop: em(24, 18), - }, - '> ul > li > p:last-child': { - marginBottom: em(24, 18), - }, - '> ol > li > p:first-child': { - marginTop: em(24, 18), - }, - '> ol > li > p:last-child': { - marginBottom: em(24, 18), - }, - 'ul ul, ul ol, ol ul, ol ol': { - marginTop: em(16, 18), - marginBottom: em(16, 18), - }, - dl: { - marginTop: em(24, 18), - marginBottom: em(24, 18), - }, - dt: { - marginTop: em(24, 18), - }, - dd: { - marginTop: em(12, 18), - paddingInlineStart: em(28, 18), - }, - hr: { - marginTop: em(56, 18), - marginBottom: em(56, 18), - }, - 'hr + *': { - marginTop: '0', - }, - 'h2 + *': { - marginTop: '0', - }, - 'h3 + *': { - marginTop: '0', - }, - 'h4 + *': { - marginTop: '0', - }, - table: { - fontSize: em(16, 18), - lineHeight: round(24 / 16), - }, - 'thead th': { - paddingInlineEnd: em(12, 16), - paddingBottom: em(12, 16), - paddingInlineStart: em(12, 16), - }, - 'thead th:first-child': { - paddingInlineStart: '0', - }, - 'thead th:last-child': { - paddingInlineEnd: '0', - }, - 'tbody td, tfoot td': { - paddingTop: em(12, 16), - paddingInlineEnd: em(12, 16), - paddingBottom: em(12, 16), - paddingInlineStart: em(12, 16), - }, - 'tbody td:first-child, tfoot td:first-child': { - paddingInlineStart: '0', - }, - 'tbody td:last-child, tfoot td:last-child': { - paddingInlineEnd: '0', - }, - figure: { - marginTop: em(32, 18), - marginBottom: em(32, 18), - }, - 'figure > *': { - marginTop: '0', - marginBottom: '0', - }, - figcaption: { - fontSize: em(16, 18), - lineHeight: round(24 / 16), - marginTop: em(16, 16), - }, - }, - { - '> :first-child': { - marginTop: '0', - }, - '> :last-child': { - marginBottom: '0', - }, - }, - ], - }, - xl: { - css: [ - { - fontSize: rem(20), - lineHeight: round(36 / 20), - p: { - marginTop: em(24, 20), - marginBottom: em(24, 20), - }, - '[class~="lead"]': { - fontSize: em(24, 20), - lineHeight: round(36 / 24), - marginTop: em(24, 24), - marginBottom: em(24, 24), - }, - blockquote: { - marginTop: em(48, 30), - marginBottom: em(48, 30), - paddingInlineStart: em(32, 30), - }, - h1: { - fontSize: em(56, 20), - marginTop: '0', - marginBottom: em(48, 56), - lineHeight: round(56 / 56), - }, - h2: { - fontSize: em(36, 20), - marginTop: em(56, 36), - marginBottom: em(32, 36), - lineHeight: round(40 / 36), - }, - h3: { - fontSize: em(30, 20), - marginTop: em(48, 30), - marginBottom: em(20, 30), - lineHeight: round(40 / 30), - }, - h4: { - marginTop: em(36, 20), - marginBottom: em(12, 20), - lineHeight: round(32 / 20), - }, - img: { - marginTop: em(40, 20), - marginBottom: em(40, 20), - }, - picture: { - marginTop: em(40, 20), - marginBottom: em(40, 20), - }, - 'picture > img': { - marginTop: '0', - marginBottom: '0', - }, - video: { - marginTop: em(40, 20), - marginBottom: em(40, 20), - }, - kbd: { - fontSize: em(18, 20), - borderRadius: rem(5), - paddingTop: em(5, 20), - paddingInlineEnd: em(8, 20), - paddingBottom: em(5, 20), - paddingInlineStart: em(8, 20), - }, - code: { - fontSize: em(18, 20), - }, - 'h2 code': { - fontSize: em(31, 36), - }, - 'h3 code': { - fontSize: em(27, 30), - }, - pre: { - fontSize: em(18, 20), - lineHeight: round(32 / 18), - marginTop: em(36, 18), - marginBottom: em(36, 18), - borderRadius: rem(8), - paddingTop: em(20, 18), - paddingInlineEnd: em(24, 18), - paddingBottom: em(20, 18), - paddingInlineStart: em(24, 18), - }, - ol: { - marginTop: em(24, 20), - marginBottom: em(24, 20), - paddingInlineStart: em(32, 20), - }, - ul: { - marginTop: em(24, 20), - marginBottom: em(24, 20), - paddingInlineStart: em(32, 20), - }, - li: { - marginTop: em(12, 20), - marginBottom: em(12, 20), - }, - 'ol > li': { - paddingInlineStart: em(8, 20), - }, - 'ul > li': { - paddingInlineStart: em(8, 20), - }, - '> ul > li p': { - marginTop: em(16, 20), - marginBottom: em(16, 20), - }, - '> ul > li > p:first-child': { - marginTop: em(24, 20), - }, - '> ul > li > p:last-child': { - marginBottom: em(24, 20), - }, - '> ol > li > p:first-child': { - marginTop: em(24, 20), - }, - '> ol > li > p:last-child': { - marginBottom: em(24, 20), - }, - 'ul ul, ul ol, ol ul, ol ol': { - marginTop: em(16, 20), - marginBottom: em(16, 20), - }, - dl: { - marginTop: em(24, 20), - marginBottom: em(24, 20), - }, - dt: { - marginTop: em(24, 20), - }, - dd: { - marginTop: em(12, 20), - paddingInlineStart: em(32, 20), - }, - hr: { - marginTop: em(56, 20), - marginBottom: em(56, 20), - }, - 'hr + *': { - marginTop: '0', - }, - 'h2 + *': { - marginTop: '0', - }, - 'h3 + *': { - marginTop: '0', - }, - 'h4 + *': { - marginTop: '0', - }, - table: { - fontSize: em(18, 20), - lineHeight: round(28 / 18), - }, - 'thead th': { - paddingInlineEnd: em(12, 18), - paddingBottom: em(16, 18), - paddingInlineStart: em(12, 18), - }, - 'thead th:first-child': { - paddingInlineStart: '0', - }, - 'thead th:last-child': { - paddingInlineEnd: '0', - }, - 'tbody td, tfoot td': { - paddingTop: em(16, 18), - paddingInlineEnd: em(12, 18), - paddingBottom: em(16, 18), - paddingInlineStart: em(12, 18), - }, - 'tbody td:first-child, tfoot td:first-child': { - paddingInlineStart: '0', - }, - 'tbody td:last-child, tfoot td:last-child': { - paddingInlineEnd: '0', - }, - figure: { - marginTop: em(40, 20), - marginBottom: em(40, 20), - }, - 'figure > *': { - marginTop: '0', - marginBottom: '0', - }, - figcaption: { - fontSize: em(18, 20), - lineHeight: round(28 / 18), - marginTop: em(18, 18), - }, - }, - { - '> :first-child': { - marginTop: '0', - }, - '> :last-child': { - marginBottom: '0', - }, - }, - ], - }, - '2xl': { - css: [ - { - fontSize: rem(24), - lineHeight: round(40 / 24), - p: { - marginTop: em(32, 24), - marginBottom: em(32, 24), - }, - '[class~="lead"]': { - fontSize: em(30, 24), - lineHeight: round(44 / 30), - marginTop: em(32, 30), - marginBottom: em(32, 30), - }, - blockquote: { - marginTop: em(64, 36), - marginBottom: em(64, 36), - paddingInlineStart: em(40, 36), - }, - h1: { - fontSize: em(64, 24), - marginTop: '0', - marginBottom: em(56, 64), - lineHeight: round(64 / 64), - }, - h2: { - fontSize: em(48, 24), - marginTop: em(72, 48), - marginBottom: em(40, 48), - lineHeight: round(52 / 48), - }, - h3: { - fontSize: em(36, 24), - marginTop: em(56, 36), - marginBottom: em(24, 36), - lineHeight: round(44 / 36), - }, - h4: { - marginTop: em(40, 24), - marginBottom: em(16, 24), - lineHeight: round(36 / 24), - }, - img: { - marginTop: em(48, 24), - marginBottom: em(48, 24), - }, - picture: { - marginTop: em(48, 24), - marginBottom: em(48, 24), - }, - 'picture > img': { - marginTop: '0', - marginBottom: '0', - }, - video: { - marginTop: em(48, 24), - marginBottom: em(48, 24), - }, - kbd: { - fontSize: em(20, 24), - borderRadius: rem(6), - paddingTop: em(6, 24), - paddingInlineEnd: em(8, 24), - paddingBottom: em(6, 24), - paddingInlineStart: em(8, 24), - }, - code: { - fontSize: em(20, 24), - }, - 'h2 code': { - fontSize: em(42, 48), - }, - 'h3 code': { - fontSize: em(32, 36), - }, - pre: { - fontSize: em(20, 24), - lineHeight: round(36 / 20), - marginTop: em(40, 20), - marginBottom: em(40, 20), - borderRadius: rem(8), - paddingTop: em(24, 20), - paddingInlineEnd: em(32, 20), - paddingBottom: em(24, 20), - paddingInlineStart: em(32, 20), - }, - ol: { - marginTop: em(32, 24), - marginBottom: em(32, 24), - paddingInlineStart: em(38, 24), - }, - ul: { - marginTop: em(32, 24), - marginBottom: em(32, 24), - paddingInlineStart: em(38, 24), - }, - li: { - marginTop: em(12, 24), - marginBottom: em(12, 24), - }, - 'ol > li': { - paddingInlineStart: em(10, 24), - }, - 'ul > li': { - paddingInlineStart: em(10, 24), - }, - '> ul > li p': { - marginTop: em(20, 24), - marginBottom: em(20, 24), - }, - '> ul > li > p:first-child': { - marginTop: em(32, 24), - }, - '> ul > li > p:last-child': { - marginBottom: em(32, 24), - }, - '> ol > li > p:first-child': { - marginTop: em(32, 24), - }, - '> ol > li > p:last-child': { - marginBottom: em(32, 24), - }, - 'ul ul, ul ol, ol ul, ol ol': { - marginTop: em(16, 24), - marginBottom: em(16, 24), - }, - dl: { - marginTop: em(32, 24), - marginBottom: em(32, 24), - }, - dt: { - marginTop: em(32, 24), - }, - dd: { - marginTop: em(12, 24), - paddingInlineStart: em(38, 24), - }, - hr: { - marginTop: em(72, 24), - marginBottom: em(72, 24), - }, - 'hr + *': { - marginTop: '0', - }, - 'h2 + *': { - marginTop: '0', - }, - 'h3 + *': { - marginTop: '0', - }, - 'h4 + *': { - marginTop: '0', - }, - table: { - fontSize: em(20, 24), - lineHeight: round(28 / 20), - }, - 'thead th': { - paddingInlineEnd: em(12, 20), - paddingBottom: em(16, 20), - paddingInlineStart: em(12, 20), - }, - 'thead th:first-child': { - paddingInlineStart: '0', - }, - 'thead th:last-child': { - paddingInlineEnd: '0', - }, - 'tbody td, tfoot td': { - paddingTop: em(16, 20), - paddingInlineEnd: em(12, 20), - paddingBottom: em(16, 20), - paddingInlineStart: em(12, 20), - }, - 'tbody td:first-child, tfoot td:first-child': { - paddingInlineStart: '0', - }, - 'tbody td:last-child, tfoot td:last-child': { - paddingInlineEnd: '0', - }, - figure: { - marginTop: em(48, 24), - marginBottom: em(48, 24), - }, - 'figure > *': { - marginTop: '0', - marginBottom: '0', - }, - figcaption: { - fontSize: em(20, 24), - lineHeight: round(32 / 20), - marginTop: em(20, 20), - }, - }, - { - '> :first-child': { - marginTop: '0', - }, - '> :last-child': { - marginBottom: '0', - }, - }, - ], - }, - - // Gray color themes - - slate: { - css: { - '--tw-prose-body': colors.slate[700], - '--tw-prose-headings': colors.slate[900], - '--tw-prose-lead': colors.slate[600], - '--tw-prose-links': colors.slate[900], - '--tw-prose-bold': colors.slate[900], - '--tw-prose-counters': colors.slate[500], - '--tw-prose-bullets': colors.slate[300], - '--tw-prose-hr': colors.slate[200], - '--tw-prose-quotes': colors.slate[900], - '--tw-prose-quote-borders': colors.slate[200], - '--tw-prose-captions': colors.slate[500], - '--tw-prose-kbd': colors.slate[900], - '--tw-prose-kbd-shadows': hexToRgb(colors.slate[900]), - '--tw-prose-code': colors.slate[900], - '--tw-prose-pre-code': colors.slate[200], - '--tw-prose-pre-bg': colors.slate[800], - '--tw-prose-th-borders': colors.slate[300], - '--tw-prose-td-borders': colors.slate[200], - '--tw-prose-invert-body': colors.slate[300], - '--tw-prose-invert-headings': colors.white, - '--tw-prose-invert-lead': colors.slate[400], - '--tw-prose-invert-links': colors.white, - '--tw-prose-invert-bold': colors.white, - '--tw-prose-invert-counters': colors.slate[400], - '--tw-prose-invert-bullets': colors.slate[600], - '--tw-prose-invert-hr': colors.slate[700], - '--tw-prose-invert-quotes': colors.slate[100], - '--tw-prose-invert-quote-borders': colors.slate[700], - '--tw-prose-invert-captions': colors.slate[400], - '--tw-prose-invert-kbd': colors.white, - '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), - '--tw-prose-invert-code': colors.white, - '--tw-prose-invert-pre-code': colors.slate[300], - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': colors.slate[600], - '--tw-prose-invert-td-borders': colors.slate[700], - }, - }, - - gray: { - css: { - '--tw-prose-body': colors.gray[700], - '--tw-prose-headings': colors.gray[900], - '--tw-prose-lead': colors.gray[600], - '--tw-prose-links': colors.gray[900], - '--tw-prose-bold': colors.gray[900], - '--tw-prose-counters': colors.gray[500], - '--tw-prose-bullets': colors.gray[300], - '--tw-prose-hr': colors.gray[200], - '--tw-prose-quotes': colors.gray[900], - '--tw-prose-quote-borders': colors.gray[200], - '--tw-prose-captions': colors.gray[500], - '--tw-prose-kbd': colors.gray[900], - '--tw-prose-kbd-shadows': hexToRgb(colors.gray[900]), - '--tw-prose-code': colors.gray[900], - '--tw-prose-pre-code': colors.gray[200], - '--tw-prose-pre-bg': colors.gray[800], - '--tw-prose-th-borders': colors.gray[300], - '--tw-prose-td-borders': colors.gray[200], - '--tw-prose-invert-body': colors.gray[300], - '--tw-prose-invert-headings': colors.white, - '--tw-prose-invert-lead': colors.gray[400], - '--tw-prose-invert-links': colors.white, - '--tw-prose-invert-bold': colors.white, - '--tw-prose-invert-counters': colors.gray[400], - '--tw-prose-invert-bullets': colors.gray[600], - '--tw-prose-invert-hr': colors.gray[700], - '--tw-prose-invert-quotes': colors.gray[100], - '--tw-prose-invert-quote-borders': colors.gray[700], - '--tw-prose-invert-captions': colors.gray[400], - '--tw-prose-invert-kbd': colors.white, - '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), - '--tw-prose-invert-code': colors.white, - '--tw-prose-invert-pre-code': colors.gray[300], - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': colors.gray[600], - '--tw-prose-invert-td-borders': colors.gray[700], - }, - }, - - zinc: { - css: { - '--tw-prose-body': colors.zinc[700], - '--tw-prose-headings': colors.zinc[900], - '--tw-prose-lead': colors.zinc[600], - '--tw-prose-links': colors.zinc[900], - '--tw-prose-bold': colors.zinc[900], - '--tw-prose-counters': colors.zinc[500], - '--tw-prose-bullets': colors.zinc[300], - '--tw-prose-hr': colors.zinc[200], - '--tw-prose-quotes': colors.zinc[900], - '--tw-prose-quote-borders': colors.zinc[200], - '--tw-prose-captions': colors.zinc[500], - '--tw-prose-kbd': colors.zinc[900], - '--tw-prose-kbd-shadows': hexToRgb(colors.zinc[900]), - '--tw-prose-code': colors.zinc[900], - '--tw-prose-pre-code': colors.zinc[200], - '--tw-prose-pre-bg': colors.zinc[800], - '--tw-prose-th-borders': colors.zinc[300], - '--tw-prose-td-borders': colors.zinc[200], - '--tw-prose-invert-body': colors.zinc[300], - '--tw-prose-invert-headings': colors.white, - '--tw-prose-invert-lead': colors.zinc[400], - '--tw-prose-invert-links': colors.white, - '--tw-prose-invert-bold': colors.white, - '--tw-prose-invert-counters': colors.zinc[400], - '--tw-prose-invert-bullets': colors.zinc[600], - '--tw-prose-invert-hr': colors.zinc[700], - '--tw-prose-invert-quotes': colors.zinc[100], - '--tw-prose-invert-quote-borders': colors.zinc[700], - '--tw-prose-invert-captions': colors.zinc[400], - '--tw-prose-invert-kbd': colors.white, - '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), - '--tw-prose-invert-code': colors.white, - '--tw-prose-invert-pre-code': colors.zinc[300], - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': colors.zinc[600], - '--tw-prose-invert-td-borders': colors.zinc[700], - }, - }, - - neutral: { - css: { - '--tw-prose-body': colors.neutral[700], - '--tw-prose-headings': colors.neutral[900], - '--tw-prose-lead': colors.neutral[600], - '--tw-prose-links': colors.neutral[900], - '--tw-prose-bold': colors.neutral[900], - '--tw-prose-counters': colors.neutral[500], - '--tw-prose-bullets': colors.neutral[300], - '--tw-prose-hr': colors.neutral[200], - '--tw-prose-quotes': colors.neutral[900], - '--tw-prose-quote-borders': colors.neutral[200], - '--tw-prose-captions': colors.neutral[500], - '--tw-prose-kbd': colors.neutral[900], - '--tw-prose-kbd-shadows': hexToRgb(colors.neutral[900]), - '--tw-prose-code': colors.neutral[900], - '--tw-prose-pre-code': colors.neutral[200], - '--tw-prose-pre-bg': colors.neutral[800], - '--tw-prose-th-borders': colors.neutral[300], - '--tw-prose-td-borders': colors.neutral[200], - '--tw-prose-invert-body': colors.neutral[300], - '--tw-prose-invert-headings': colors.white, - '--tw-prose-invert-lead': colors.neutral[400], - '--tw-prose-invert-links': colors.white, - '--tw-prose-invert-bold': colors.white, - '--tw-prose-invert-counters': colors.neutral[400], - '--tw-prose-invert-bullets': colors.neutral[600], - '--tw-prose-invert-hr': colors.neutral[700], - '--tw-prose-invert-quotes': colors.neutral[100], - '--tw-prose-invert-quote-borders': colors.neutral[700], - '--tw-prose-invert-captions': colors.neutral[400], - '--tw-prose-invert-kbd': colors.white, - '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), - '--tw-prose-invert-code': colors.white, - '--tw-prose-invert-pre-code': colors.neutral[300], - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': colors.neutral[600], - '--tw-prose-invert-td-borders': colors.neutral[700], - }, - }, - - stone: { - css: { - '--tw-prose-body': colors.stone[700], - '--tw-prose-headings': colors.stone[900], - '--tw-prose-lead': colors.stone[600], - '--tw-prose-links': colors.stone[900], - '--tw-prose-bold': colors.stone[900], - '--tw-prose-counters': colors.stone[500], - '--tw-prose-bullets': colors.stone[300], - '--tw-prose-hr': colors.stone[200], - '--tw-prose-quotes': colors.stone[900], - '--tw-prose-quote-borders': colors.stone[200], - '--tw-prose-captions': colors.stone[500], - '--tw-prose-kbd': colors.stone[900], - '--tw-prose-kbd-shadows': hexToRgb(colors.stone[900]), - '--tw-prose-code': colors.stone[900], - '--tw-prose-pre-code': colors.stone[200], - '--tw-prose-pre-bg': colors.stone[800], - '--tw-prose-th-borders': colors.stone[300], - '--tw-prose-td-borders': colors.stone[200], - '--tw-prose-invert-body': colors.stone[300], - '--tw-prose-invert-headings': colors.white, - '--tw-prose-invert-lead': colors.stone[400], - '--tw-prose-invert-links': colors.white, - '--tw-prose-invert-bold': colors.white, - '--tw-prose-invert-counters': colors.stone[400], - '--tw-prose-invert-bullets': colors.stone[600], - '--tw-prose-invert-hr': colors.stone[700], - '--tw-prose-invert-quotes': colors.stone[100], - '--tw-prose-invert-quote-borders': colors.stone[700], - '--tw-prose-invert-captions': colors.stone[400], - '--tw-prose-invert-kbd': colors.white, - '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), - '--tw-prose-invert-code': colors.white, - '--tw-prose-invert-pre-code': colors.stone[300], - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': colors.stone[600], - '--tw-prose-invert-td-borders': colors.stone[700], - }, - }, - - // Link-only themes (for backward compatibility) - - red: { - css: { - '--tw-prose-links': colors.red[600], - '--tw-prose-invert-links': colors.red[500], - }, - }, - - orange: { - css: { - '--tw-prose-links': colors.orange[600], - '--tw-prose-invert-links': colors.orange[500], - }, - }, - - amber: { - css: { - '--tw-prose-links': colors.amber[600], - '--tw-prose-invert-links': colors.amber[500], - }, - }, - - yellow: { - css: { - '--tw-prose-links': colors.yellow[600], - '--tw-prose-invert-links': colors.yellow[500], - }, - }, - - lime: { - css: { - '--tw-prose-links': colors.lime[600], - '--tw-prose-invert-links': colors.lime[500], - }, - }, - - green: { - css: { - '--tw-prose-links': colors.green[600], - '--tw-prose-invert-links': colors.green[500], - }, - }, - - emerald: { - css: { - '--tw-prose-links': colors.emerald[600], - '--tw-prose-invert-links': colors.emerald[500], - }, - }, - - teal: { - css: { - '--tw-prose-links': colors.teal[600], - '--tw-prose-invert-links': colors.teal[500], - }, - }, - - cyan: { - css: { - '--tw-prose-links': colors.cyan[600], - '--tw-prose-invert-links': colors.cyan[500], - }, - }, - - sky: { - css: { - '--tw-prose-links': colors.sky[600], - '--tw-prose-invert-links': colors.sky[500], - }, - }, - - blue: { - css: { - '--tw-prose-links': colors.blue[600], - '--tw-prose-invert-links': colors.blue[500], - }, - }, - - indigo: { - css: { - '--tw-prose-links': colors.indigo[600], - '--tw-prose-invert-links': colors.indigo[500], - }, - }, - - violet: { - css: { - '--tw-prose-links': colors.violet[600], - '--tw-prose-invert-links': colors.violet[500], - }, - }, - - purple: { - css: { - '--tw-prose-links': colors.purple[600], - '--tw-prose-invert-links': colors.purple[500], - }, - }, - - fuchsia: { - css: { - '--tw-prose-links': colors.fuchsia[600], - '--tw-prose-invert-links': colors.fuchsia[500], - }, - }, - - pink: { - css: { - '--tw-prose-links': colors.pink[600], - '--tw-prose-invert-links': colors.pink[500], - }, - }, - - rose: { - css: { - '--tw-prose-links': colors.rose[600], - '--tw-prose-invert-links': colors.rose[500], - }, - }, - - // Invert (for dark mode) - invert: { - css: { - '--tw-prose-body': 'var(--tw-prose-invert-body)', - '--tw-prose-headings': 'var(--tw-prose-invert-headings)', - '--tw-prose-lead': 'var(--tw-prose-invert-lead)', - '--tw-prose-links': 'var(--tw-prose-invert-links)', - '--tw-prose-bold': 'var(--tw-prose-invert-bold)', - '--tw-prose-counters': 'var(--tw-prose-invert-counters)', - '--tw-prose-bullets': 'var(--tw-prose-invert-bullets)', - '--tw-prose-hr': 'var(--tw-prose-invert-hr)', - '--tw-prose-quotes': 'var(--tw-prose-invert-quotes)', - '--tw-prose-quote-borders': 'var(--tw-prose-invert-quote-borders)', - '--tw-prose-captions': 'var(--tw-prose-invert-captions)', - '--tw-prose-kbd': 'var(--tw-prose-invert-kbd)', - '--tw-prose-kbd-shadows': 'var(--tw-prose-invert-kbd-shadows)', - '--tw-prose-code': 'var(--tw-prose-invert-code)', - '--tw-prose-pre-code': 'var(--tw-prose-invert-pre-code)', - '--tw-prose-pre-bg': 'var(--tw-prose-invert-pre-bg)', - '--tw-prose-th-borders': 'var(--tw-prose-invert-th-borders)', - '--tw-prose-td-borders': 'var(--tw-prose-invert-td-borders)', - }, - }, -} - -module.exports = { - DEFAULT: { - css: [ - { - color: 'var(--tw-prose-body)', - maxWidth: '65ch', - p: {}, // Required to maintain correct order when merging - '[class~="lead"]': { - color: 'var(--tw-prose-lead)', - }, - a: { - color: 'var(--tw-prose-links)', - textDecoration: 'underline', - fontWeight: '500', - }, - strong: { - color: 'var(--tw-prose-bold)', - fontWeight: '600', - }, - 'a strong': { - color: 'inherit', - }, - 'blockquote strong': { - color: 'inherit', - }, - 'thead th strong': { - color: 'inherit', - }, - ol: { - listStyleType: 'decimal', - }, - 'ol[type="A"]': { - listStyleType: 'upper-alpha', - }, - 'ol[type="a"]': { - listStyleType: 'lower-alpha', - }, - 'ol[type="A" s]': { - listStyleType: 'upper-alpha', - }, - 'ol[type="a" s]': { - listStyleType: 'lower-alpha', - }, - 'ol[type="I"]': { - listStyleType: 'upper-roman', - }, - 'ol[type="i"]': { - listStyleType: 'lower-roman', - }, - 'ol[type="I" s]': { - listStyleType: 'upper-roman', - }, - 'ol[type="i" s]': { - listStyleType: 'lower-roman', - }, - 'ol[type="1"]': { - listStyleType: 'decimal', - }, - ul: { - listStyleType: 'disc', - }, - 'ol > li::marker': { - fontWeight: '400', - color: 'var(--tw-prose-counters)', - }, - 'ul > li::marker': { - color: 'var(--tw-prose-bullets)', - }, - dt: { - color: 'var(--tw-prose-headings)', - fontWeight: '600', - }, - hr: { - borderColor: 'var(--tw-prose-hr)', - borderTopWidth: 1, - }, - blockquote: { - fontWeight: '500', - fontStyle: 'italic', - color: 'var(--tw-prose-quotes)', - borderInlineStartWidth: '0.25rem', - borderInlineStartColor: 'var(--tw-prose-quote-borders)', - quotes: '"\\201C""\\201D""\\2018""\\2019"', - }, - 'blockquote p:first-of-type::before': { - content: 'open-quote', - }, - 'blockquote p:last-of-type::after': { - content: 'close-quote', - }, - h1: { - color: 'var(--tw-prose-headings)', - fontWeight: '800', - }, - 'h1 strong': { - fontWeight: '900', - color: 'inherit', - }, - h2: { - color: 'var(--tw-prose-headings)', - fontWeight: '700', - }, - 'h2 strong': { - fontWeight: '800', - color: 'inherit', - }, - h3: { - color: 'var(--tw-prose-headings)', - fontWeight: '600', - }, - 'h3 strong': { - fontWeight: '700', - color: 'inherit', - }, - h4: { - color: 'var(--tw-prose-headings)', - fontWeight: '600', - }, - 'h4 strong': { - fontWeight: '700', - color: 'inherit', - }, - img: {}, // Required to maintain correct order when merging - picture: { - display: 'block', - }, - video: {}, // Required to maintain correct order when merging - kbd: { - fontWeight: '500', - fontFamily: 'inherit', - color: 'var(--tw-prose-kbd)', - boxShadow: - '0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%)', - }, - code: { - color: 'var(--tw-prose-code)', - fontWeight: '600', - }, - 'code::before': { - content: '"`"', - }, - 'code::after': { - content: '"`"', - }, - 'a code': { - color: 'inherit', - }, - 'h1 code': { - color: 'inherit', - }, - 'h2 code': { - color: 'inherit', - }, - 'h3 code': { - color: 'inherit', - }, - 'h4 code': { - color: 'inherit', - }, - 'blockquote code': { - color: 'inherit', - }, - 'thead th code': { - color: 'inherit', - }, - pre: { - color: 'var(--tw-prose-pre-code)', - backgroundColor: 'var(--tw-prose-pre-bg)', - overflowX: 'auto', - fontWeight: '400', - }, - 'pre code': { - backgroundColor: 'transparent', - borderWidth: '0', - borderRadius: '0', - padding: '0', - fontWeight: 'inherit', - color: 'inherit', - fontSize: 'inherit', - fontFamily: 'inherit', - lineHeight: 'inherit', - }, - 'pre code::before': { - content: 'none', - }, - 'pre code::after': { - content: 'none', - }, - table: { - width: '100%', - tableLayout: 'auto', - marginTop: em(32, 16), - marginBottom: em(32, 16), - }, - thead: { - borderBottomWidth: '1px', - borderBottomColor: 'var(--tw-prose-th-borders)', - }, - 'thead th': { - color: 'var(--tw-prose-headings)', - fontWeight: '600', - verticalAlign: 'bottom', - }, - 'tbody tr': { - borderBottomWidth: '1px', - borderBottomColor: 'var(--tw-prose-td-borders)', - }, - 'tbody tr:last-child': { - borderBottomWidth: '0', - }, - 'tbody td': { - verticalAlign: 'baseline', - }, - tfoot: { - borderTopWidth: '1px', - borderTopColor: 'var(--tw-prose-th-borders)', - }, - 'tfoot td': { - verticalAlign: 'top', - }, - 'th, td': { - textAlign: 'start', - }, - 'figure > *': {}, // Required to maintain correct order when merging - figcaption: { - color: 'var(--tw-prose-captions)', - }, - }, - defaultModifiers.gray.css, - ...defaultModifiers.base.css, - ], - }, - ...defaultModifiers, -} diff --git a/node_modules/@tailwindcss/typography/src/utils.js b/node_modules/@tailwindcss/typography/src/utils.js deleted file mode 100644 index 085f72e122f24e088eedb7f273c6828e453b5134..0000000000000000000000000000000000000000 --- a/node_modules/@tailwindcss/typography/src/utils.js +++ /dev/null @@ -1,62 +0,0 @@ -const isPlainObject = require('lodash.isplainobject') - -const parser = require('postcss-selector-parser') -const parseSelector = parser() - -module.exports = { - isUsableColor(color, values) { - return isPlainObject(values) && color !== 'gray' && values[600] - }, - - /** - * @param {string} selector - */ - commonTrailingPseudos(selector) { - let ast = parseSelector.astSync(selector) - - /** @type {import('postcss-selector-parser').Pseudo[][]} */ - let matrix = [] - - // Put the pseudo elements in reverse order in a sparse, column-major 2D array - for (let [i, sel] of ast.nodes.entries()) { - for (const [j, child] of [...sel.nodes].reverse().entries()) { - // We only care about pseudo elements - if (child.type !== 'pseudo' || !child.value.startsWith('::')) { - break - } - - matrix[j] = matrix[j] || [] - matrix[j][i] = child - } - } - - let trailingPseudos = parser.selector() - - // At this point the pseudo elements are in a column-major 2D array - // This means each row contains one "column" of pseudo elements from each selector - // We can compare all the pseudo elements in a row to see if they are the same - for (const pseudos of matrix) { - // It's a sparse 2D array so there are going to be holes in the rows - // We skip those - if (!pseudos) { - continue - } - - let values = new Set([...pseudos.map((p) => p.value)]) - - // The pseudo elements are not the same - if (values.size > 1) { - break - } - - pseudos.forEach((pseudo) => pseudo.remove()) - trailingPseudos.prepend(pseudos[0]) - } - - if (trailingPseudos.nodes.length) { - return [trailingPseudos.toString(), ast.toString()] - } - - return [null, selector] - }, -} diff --git a/node_modules/@tanstack/query-core/LICENSE b/node_modules/@tanstack/query-core/LICENSE deleted file mode 100644 index 1869e21fc3c80b3010c3e60c5ab6dda077ce1f22..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021-present Tanner Linsley - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@tanstack/query-core/build/legacy/chunk-2HYBKCYP.js b/node_modules/@tanstack/query-core/build/legacy/chunk-2HYBKCYP.js deleted file mode 100644 index 7b4a441f806bd501bf42e8c3b4b1dfd3b3bbcebc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/chunk-2HYBKCYP.js +++ /dev/null @@ -1,39 +0,0 @@ -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); -var __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -export { - __privateGet, - __privateAdd, - __privateSet, - __privateWrapper, - __privateMethod -}; -//# sourceMappingURL=chunk-2HYBKCYP.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/chunk-2HYBKCYP.js.map b/node_modules/@tanstack/query-core/build/legacy/chunk-2HYBKCYP.js.map deleted file mode 100644 index 84c51b288c478ac0d18748007ccfb8cddc797f3a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/chunk-2HYBKCYP.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs deleted file mode 100644 index 1280c3b40fadadd29f18766cda04b2f2eb30eb30..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; - -// src/focusManager.ts -var focusManager_exports = {}; -__export(focusManager_exports, { - FocusManager: () => FocusManager, - focusManager: () => focusManager -}); -module.exports = __toCommonJS(focusManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var _focused, _cleanup, _setup; -var FocusManager = class extends import_subscribable.Subscribable { - constructor() { - super(); - __privateAdd(this, _focused, void 0); - __privateAdd(this, _cleanup, void 0); - __privateAdd(this, _setup, void 0); - __privateSet(this, _setup, (onFocus) => { - if (!import_utils.isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - })); - } - setFocused(focused) { - const changed = __privateGet(this, _focused) !== focused; - if (changed) { - __privateSet(this, _focused, focused); - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - var _a; - if (typeof __privateGet(this, _focused) === "boolean") { - return __privateGet(this, _focused); - } - return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden"; - } -}; -_focused = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var focusManager = new FocusManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - FocusManager, - focusManager -}); -//# sourceMappingURL=focusManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts deleted file mode 100644 index c0f57ac63199f34d1bd931c395187701a41d8049..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.cjs'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts deleted file mode 100644 index da33a8bcabcd77e975e41d4b2e44cb47898ac904..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.js b/node_modules/@tanstack/query-core/build/legacy/focusManager.js deleted file mode 100644 index b60b445db2a84cef521ebdc6d7bbb7d838ab281e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.js +++ /dev/null @@ -1,81 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/focusManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var _focused, _cleanup, _setup; -var FocusManager = class extends Subscribable { - constructor() { - super(); - __privateAdd(this, _focused, void 0); - __privateAdd(this, _cleanup, void 0); - __privateAdd(this, _setup, void 0); - __privateSet(this, _setup, (onFocus) => { - if (!isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - })); - } - setFocused(focused) { - const changed = __privateGet(this, _focused) !== focused; - if (changed) { - __privateSet(this, _focused, focused); - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - var _a; - if (typeof __privateGet(this, _focused) === "boolean") { - return __privateGet(this, _focused); - } - return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden"; - } -}; -_focused = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var focusManager = new FocusManager(); -export { - FocusManager, - focusManager -}; -//# sourceMappingURL=focusManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map b/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map deleted file mode 100644 index 9de77cee1cb3d2c0c7128abfc79693bb33260dfa..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AADzB;AASO,IAAM,eAAN,cAA2B,aAAuB;AAAA,EAMvD,cAAc;AACZ,UAAM;AANR;AACA;AAEA;AAIE,uBAAK,QAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAxC5B;AAyCI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AA/CzC;AAgDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,mBAAK,cAAa;AAClC,QAAI,SAAS;AACX,yBAAK,UAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AA1EvB;AA2EI,QAAI,OAAO,mBAAK,cAAa,WAAW;AACtC,aAAO,mBAAK;AAAA,IACd;AAIA,aAAO,gBAAW,aAAX,mBAAqB,qBAAoB;AAAA,EAClD;AACF;AAzEE;AACA;AAEA;AAwEK,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration-BXpkOXt5.d.cts b/node_modules/@tanstack/query-core/build/legacy/hydration-BXpkOXt5.d.cts deleted file mode 100644 index 93a47810ebd97ffddc736ba3139bbb05cf99ebb4..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration-BXpkOXt5.d.cts +++ /dev/null @@ -1,1297 +0,0 @@ -import { Removable } from './removable.cjs'; -import { Subscribable } from './subscribable.cjs'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface NotifyOptions { - listeners?: boolean; -} -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(notifyOptions?: NotifyOptions): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - cache: QueryCache; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: number): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: QueryKey; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: MutationKey; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTime, query: Query): number | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): boolean; -declare function isPlainObject(o: any): o is Object; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching(filters?: QueryFilters): number; - isMutating(filters?: MutationFilters): number; - getQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData(filters: QueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): TInferredQueryFnData | undefined; - setQueriesData(filters: QueryFilters, updater: Updater, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): MutationObserverOptions; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TContext | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TContext; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - abort?: () => void; - onError?: (error: TError) => void; - onSuccess?: (data: TData) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type DataTag = TType & { - [dataTagSymbol]: TValue; -}; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | ((query: Query) => number); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - */ - staleTime?: StaleTime; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type Optional = Pick, TKey> & OmitKeyof; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTime; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult; -type MutationKey = ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunction = (variables: TVariables) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables) => Promise | TContext | undefined; - onSuccess?: (data: TData, variables: TVariables, context: TContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, context: TContext) => void; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type NotifyOnChangeProps as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, type DataTag as E, type QueryFunction as F, type StaleTime as G, type HydrateOptions as H, type Enabled as I, type QueryPersister as J, type QueryFunctionContext as K, type InitialDataFunction as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type QueriesPlaceholderDataFunction as T, type Updater as U, type QueryKeyHashFunction as V, type GetPreviousPageParamFunction as W, type GetNextPageParamFunction as X, type InfiniteData as Y, type QueryMeta as Z, type NetworkMode as _, type QueryCacheNotifyEvent as a, type FetchContext as a$, type QueryOptions as a0, type InitialPageParam as a1, type InfiniteQueryPageParamsOptions as a2, type ThrowOnError as a3, type QueryObserverOptions as a4, type WithRequired as a5, type Optional as a6, type DefaultedQueryObserverOptions as a7, type InfiniteQueryObserverOptions as a8, type DefaultedInfiniteQueryObserverOptions as a9, type InfiniteQueryObserverRefetchErrorResult as aA, type InfiniteQueryObserverSuccessResult as aB, type DefinedInfiniteQueryObserverResult as aC, type InfiniteQueryObserverResult as aD, type MutationKey as aE, type MutationStatus as aF, type MutationScope as aG, type MutationMeta as aH, type MutationFunction as aI, type MutationOptions as aJ, type MutationObserverOptions as aK, type MutateOptions as aL, type MutateFunction as aM, type MutationObserverBaseResult as aN, type MutationObserverIdleResult as aO, type MutationObserverLoadingResult as aP, type MutationObserverErrorResult as aQ, type MutationObserverSuccessResult as aR, type MutationObserverResult as aS, type QueryClientConfig as aT, type DefaultOptions as aU, type CancelOptions as aV, type SetDataOptions as aW, type NotifyEventType as aX, type NotifyEvent as aY, type QueryBehavior as aZ, type NotifyOptions as a_, type FetchQueryOptions as aa, type EnsureQueryDataOptions as ab, type EnsureInfiniteQueryDataOptions as ac, type FetchInfiniteQueryOptions as ad, type ResultOptions as ae, type RefetchOptions as af, type InvalidateQueryFilters as ag, type RefetchQueryFilters as ah, type InvalidateOptions as ai, type ResetOptions as aj, type FetchNextPageOptions as ak, type FetchPreviousPageOptions as al, type QueryStatus as am, type FetchStatus as an, type QueryObserverBaseResult as ao, type QueryObserverPendingResult as ap, type QueryObserverLoadingResult as aq, type QueryObserverLoadingErrorResult as ar, type QueryObserverRefetchErrorResult as as, type QueryObserverSuccessResult as at, type DefinedQueryObserverResult as au, type QueryObserverResult as av, type InfiniteQueryObserverBaseResult as aw, type InfiniteQueryObserverPendingResult as ax, type InfiniteQueryObserverLoadingResult as ay, type InfiniteQueryObserverLoadingErrorResult as az, QueryClient as b, type FetchDirection as b0, type FetchMeta as b1, type FetchOptions as b2, type Action$1 as b3, type SetStateOptions as b4, fetchState as b5, type QueryTypeFilter as b6, noop as b7, functionalUpdate as b8, isValidTimeout as b9, timeUntilStale as ba, resolveStaleTime as bb, resolveEnabled as bc, hashQueryKeyByOptions as bd, partialMatchKey as be, shallowEqualObjects as bf, isPlainArray as bg, isPlainObject as bh, sleep as bi, replaceData as bj, addToEnd as bk, addToStart as bl, ensureQueryFn as bm, type QueryStore as bn, type Action as bo, getDefaultState as bp, type Retryer as bq, type RetryValue as br, type RetryDelayValue as bs, canFetch as bt, createRetryer as bu, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, type MutationFilters as g, hashKey as h, isServer as i, type QueryFilters as j, keepPreviousData as k, isCancelledError as l, matchQuery as m, dehydrate as n, hydrate as o, defaultShouldDehydrateQuery as p, defaultShouldDehydrateMutation as q, replaceEqualDeep as r, skipToken as s, type QueryState as t, Query as u, type MutationState as v, Mutation as w, type DehydratedState as x, type Override as y, type DefaultError as z }; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration-mKPlgzt9.d.ts b/node_modules/@tanstack/query-core/build/legacy/hydration-mKPlgzt9.d.ts deleted file mode 100644 index ad7499c1f869ba34470022b3f7fc6ad6748af965..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration-mKPlgzt9.d.ts +++ /dev/null @@ -1,1297 +0,0 @@ -import { Removable } from './removable.js'; -import { Subscribable } from './subscribable.js'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface NotifyOptions { - listeners?: boolean; -} -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(notifyOptions?: NotifyOptions): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - cache: QueryCache; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: number): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: QueryKey; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: MutationKey; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTime, query: Query): number | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): boolean; -declare function isPlainObject(o: any): o is Object; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching(filters?: QueryFilters): number; - isMutating(filters?: MutationFilters): number; - getQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData(filters: QueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): TInferredQueryFnData | undefined; - setQueriesData(filters: QueryFilters, updater: Updater, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): MutationObserverOptions; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TContext | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TContext; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - abort?: () => void; - onError?: (error: TError) => void; - onSuccess?: (data: TData) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type DataTag = TType & { - [dataTagSymbol]: TValue; -}; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | ((query: Query) => number); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - */ - staleTime?: StaleTime; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type Optional = Pick, TKey> & OmitKeyof; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTime; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult; -type MutationKey = ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunction = (variables: TVariables) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables) => Promise | TContext | undefined; - onSuccess?: (data: TData, variables: TVariables, context: TContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, context: TContext) => void; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type NotifyOnChangeProps as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, type DataTag as E, type QueryFunction as F, type StaleTime as G, type HydrateOptions as H, type Enabled as I, type QueryPersister as J, type QueryFunctionContext as K, type InitialDataFunction as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type QueriesPlaceholderDataFunction as T, type Updater as U, type QueryKeyHashFunction as V, type GetPreviousPageParamFunction as W, type GetNextPageParamFunction as X, type InfiniteData as Y, type QueryMeta as Z, type NetworkMode as _, type QueryCacheNotifyEvent as a, type FetchContext as a$, type QueryOptions as a0, type InitialPageParam as a1, type InfiniteQueryPageParamsOptions as a2, type ThrowOnError as a3, type QueryObserverOptions as a4, type WithRequired as a5, type Optional as a6, type DefaultedQueryObserverOptions as a7, type InfiniteQueryObserverOptions as a8, type DefaultedInfiniteQueryObserverOptions as a9, type InfiniteQueryObserverRefetchErrorResult as aA, type InfiniteQueryObserverSuccessResult as aB, type DefinedInfiniteQueryObserverResult as aC, type InfiniteQueryObserverResult as aD, type MutationKey as aE, type MutationStatus as aF, type MutationScope as aG, type MutationMeta as aH, type MutationFunction as aI, type MutationOptions as aJ, type MutationObserverOptions as aK, type MutateOptions as aL, type MutateFunction as aM, type MutationObserverBaseResult as aN, type MutationObserverIdleResult as aO, type MutationObserverLoadingResult as aP, type MutationObserverErrorResult as aQ, type MutationObserverSuccessResult as aR, type MutationObserverResult as aS, type QueryClientConfig as aT, type DefaultOptions as aU, type CancelOptions as aV, type SetDataOptions as aW, type NotifyEventType as aX, type NotifyEvent as aY, type QueryBehavior as aZ, type NotifyOptions as a_, type FetchQueryOptions as aa, type EnsureQueryDataOptions as ab, type EnsureInfiniteQueryDataOptions as ac, type FetchInfiniteQueryOptions as ad, type ResultOptions as ae, type RefetchOptions as af, type InvalidateQueryFilters as ag, type RefetchQueryFilters as ah, type InvalidateOptions as ai, type ResetOptions as aj, type FetchNextPageOptions as ak, type FetchPreviousPageOptions as al, type QueryStatus as am, type FetchStatus as an, type QueryObserverBaseResult as ao, type QueryObserverPendingResult as ap, type QueryObserverLoadingResult as aq, type QueryObserverLoadingErrorResult as ar, type QueryObserverRefetchErrorResult as as, type QueryObserverSuccessResult as at, type DefinedQueryObserverResult as au, type QueryObserverResult as av, type InfiniteQueryObserverBaseResult as aw, type InfiniteQueryObserverPendingResult as ax, type InfiniteQueryObserverLoadingResult as ay, type InfiniteQueryObserverLoadingErrorResult as az, QueryClient as b, type FetchDirection as b0, type FetchMeta as b1, type FetchOptions as b2, type Action$1 as b3, type SetStateOptions as b4, fetchState as b5, type QueryTypeFilter as b6, noop as b7, functionalUpdate as b8, isValidTimeout as b9, timeUntilStale as ba, resolveStaleTime as bb, resolveEnabled as bc, hashQueryKeyByOptions as bd, partialMatchKey as be, shallowEqualObjects as bf, isPlainArray as bg, isPlainObject as bh, sleep as bi, replaceData as bj, addToEnd as bk, addToStart as bl, ensureQueryFn as bm, type QueryStore as bn, type Action as bo, getDefaultState as bp, type Retryer as bq, type RetryValue as br, type RetryDelayValue as bs, canFetch as bt, createRetryer as bu, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, type MutationFilters as g, hashKey as h, isServer as i, type QueryFilters as j, keepPreviousData as k, isCancelledError as l, matchQuery as m, dehydrate as n, hydrate as o, defaultShouldDehydrateQuery as p, defaultShouldDehydrateMutation as q, replaceEqualDeep as r, skipToken as s, type QueryState as t, Query as u, type MutationState as v, Mutation as w, type DehydratedState as x, type Override as y, type DefaultError as z }; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs deleted file mode 100644 index 98b735223493b302a2d71b0329b8de6ae597d988..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs +++ /dev/null @@ -1,149 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/hydration.ts -var hydration_exports = {}; -__export(hydration_exports, { - defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, - dehydrate: () => dehydrate, - hydrate: () => hydrate -}); -module.exports = __toCommonJS(hydration_exports); -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData) { - var _a; - return { - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: (_a = query.promise) == null ? void 0 : _a.then(serializeData).catch((error) => { - if (process.env.NODE_ENV !== "production") { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }) - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function dehydrate(client, options = {}) { - var _a, _b, _c; - const filterMutation = options.shouldDehydrateMutation ?? ((_a = client.getDefaultOptions().dehydrate) == null ? void 0 : _a.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; - const serializeData = options.serializeData ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.serializeData) ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - var _a, _b; - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = ((_a = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions }) => { - var _a2, _b2; - mutationCache.build( - client, - { - ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.mutations, - ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations, - ...mutationOptions - }, - state - ); - }); - queries.forEach(({ queryKey, state, queryHash, meta, promise }) => { - var _a2, _b2; - let query = queryCache.get(queryHash); - const data = state.data === void 0 ? state.data : deserializeData(state.data); - if (query) { - if (query.state.dataUpdatedAt < state.dataUpdatedAt) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.queries, - ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle" - } - ); - } - if (promise) { - const initialPromise = Promise.resolve(promise).then(deserializeData); - void query.fetch(void 0, { initialPromise }); - } - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -}); -//# sourceMappingURL=hydration.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map deleted file mode 100644 index 922325e02fc0bad7270b909abf74e5960a9e1d28..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n): DehydratedQuery {\n return {\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: query.promise?.then(serializeData).catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n }),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(({ queryKey, state, queryHash, meta, promise }) => {\n let query = queryCache.get(queryHash)\n\n const data =\n state.data === undefined ? state.data : deserializeData(state.data)\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n if (query.state.dataUpdatedAt < state.dataUpdatedAt) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n },\n )\n }\n\n if (promise) {\n // Note: `Promise.resolve` required cause\n // RSC transformed promises are not thenable\n const initialPromise = Promise.resolve(promise).then(deserializeData)\n\n // this doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n void query.fetch(undefined, { initialPromise })\n }\n })\n}\n"],"mappings":"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","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts b/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts deleted file mode 100644 index 5b615de20768b712de1e77b2dcb2ba8579b7cfea..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts b/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts deleted file mode 100644 index 99a3dd78335dc6f1a16d8392e0ddc01c51dd5618..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.js.map b/node_modules/@tanstack/query-core/build/legacy/hydration.js.map deleted file mode 100644 index 67576491226e11a607ce520f8efcbd7543d72023..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n): DehydratedQuery {\n return {\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: query.promise?.then(serializeData).catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n }),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(({ queryKey, state, queryHash, meta, promise }) => {\n let query = queryCache.get(queryHash)\n\n const data =\n state.data === undefined ? state.data : deserializeData(state.data)\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n if (query.state.dataUpdatedAt < state.dataUpdatedAt) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n },\n )\n }\n\n if (promise) {\n // Note: `Promise.resolve` required cause\n // RSC transformed promises are not thenable\n const initialPromise = Promise.resolve(promise).then(deserializeData)\n\n // this doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n void query.fetch(undefined, { initialPromise })\n }\n })\n}\n"],"mappings":"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","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.cjs b/node_modules/@tanstack/query-core/build/legacy/index.cjs deleted file mode 100644 index 61f777e4f5c5ce06ca42b0729fababff29942548..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.cjs +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - CancelledError: () => import_retryer.CancelledError, - InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, - Mutation: () => import_mutation.Mutation, - MutationCache: () => import_mutationCache.MutationCache, - MutationObserver: () => import_mutationObserver.MutationObserver, - QueriesObserver: () => import_queriesObserver.QueriesObserver, - Query: () => import_query.Query, - QueryCache: () => import_queryCache.QueryCache, - QueryClient: () => import_queryClient.QueryClient, - QueryObserver: () => import_queryObserver.QueryObserver, - defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, - dehydrate: () => import_hydration.dehydrate, - focusManager: () => import_focusManager.focusManager, - hashKey: () => import_utils.hashKey, - hydrate: () => import_hydration.hydrate, - isCancelledError: () => import_retryer2.isCancelledError, - isServer: () => import_utils.isServer, - keepPreviousData: () => import_utils.keepPreviousData, - matchMutation: () => import_utils.matchMutation, - matchQuery: () => import_utils.matchQuery, - notifyManager: () => import_notifyManager.notifyManager, - onlineManager: () => import_onlineManager.onlineManager, - replaceEqualDeep: () => import_utils.replaceEqualDeep, - skipToken: () => import_utils.skipToken -}); -module.exports = __toCommonJS(src_exports); -var import_retryer = require("./retryer.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_queryClient = require("./queryClient.cjs"); -var import_queryObserver = require("./queryObserver.cjs"); -var import_queriesObserver = require("./queriesObserver.cjs"); -var import_infiniteQueryObserver = require("./infiniteQueryObserver.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_mutationObserver = require("./mutationObserver.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_utils = require("./utils.cjs"); -var import_retryer2 = require("./retryer.cjs"); -var import_hydration = require("./hydration.cjs"); -__reExport(src_exports, require("./types.cjs"), module.exports); -var import_query = require("./query.cjs"); -var import_mutation = require("./mutation.cjs"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - notifyManager, - onlineManager, - replaceEqualDeep, - skipToken, - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.cjs.map b/node_modules/@tanstack/query-core/build/legacy/index.cjs.map deleted file mode 100644 index 23b0a18f13811ecfdeb64f0f2c9182ea50e1a1a7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA+B;AAC/B,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,6BAAgC;AAChC,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAQO;AAEP,IAAAA,kBAAiC;AACjC,uBAKO;AAGP,wBAAc,wBAlCd;AAoCA,mBAAsB;AAEtB,sBAAyB;","names":["import_retryer"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.d.cts b/node_modules/@tanstack/query-core/build/legacy/index.d.cts deleted file mode 100644 index 0ea9ddf4fcdb4ff5df78b29482a57c52f2a83f4c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.d.cts +++ /dev/null @@ -1,8 +0,0 @@ -export { aV as CancelOptions, C as CancelledError, E as DataTag, z as DefaultError, aU as DefaultOptions, a9 as DefaultedInfiniteQueryObserverOptions, a7 as DefaultedQueryObserverOptions, aC as DefinedInfiniteQueryObserverResult, au as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, I as Enabled, ac as EnsureInfiniteQueryDataOptions, ab as EnsureQueryDataOptions, ad as FetchInfiniteQueryOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, aa as FetchQueryOptions, an as FetchStatus, X as GetNextPageParamFunction, W as GetPreviousPageParamFunction, H as HydrateOptions, Y as InfiniteData, aw as InfiniteQueryObserverBaseResult, az as InfiniteQueryObserverLoadingErrorResult, ay as InfiniteQueryObserverLoadingResult, a8 as InfiniteQueryObserverOptions, ax as InfiniteQueryObserverPendingResult, aA as InfiniteQueryObserverRefetchErrorResult, aD as InfiniteQueryObserverResult, aB as InfiniteQueryObserverSuccessResult, a2 as InfiniteQueryPageParamsOptions, L as InitialDataFunction, a1 as InitialPageParam, ai as InvalidateOptions, ag as InvalidateQueryFilters, aM as MutateFunction, aL as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aI as MutationFunction, aE as MutationKey, aH as MutationMeta, e as MutationObserver, aN as MutationObserverBaseResult, aQ as MutationObserverErrorResult, aO as MutationObserverIdleResult, aP as MutationObserverLoadingResult, aK as MutationObserverOptions, aS as MutationObserverResult, aR as MutationObserverSuccessResult, aJ as MutationOptions, aG as MutationScope, v as MutationState, aF as MutationStatus, _ as NetworkMode, N as NoInfer, aY as NotifyEvent, aX as NotifyEventType, $ as NotifyOnChangeProps, O as OmitKeyof, a6 as Optional, y as Override, P as PlaceholderDataFunction, T as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aT as QueryClientConfig, j as QueryFilters, F as QueryFunction, K as QueryFunctionContext, A as QueryKey, V as QueryKeyHashFunction, Z as QueryMeta, c as QueryObserver, ao as QueryObserverBaseResult, ar as QueryObserverLoadingErrorResult, aq as QueryObserverLoadingResult, a4 as QueryObserverOptions, ap as QueryObserverPendingResult, as as QueryObserverRefetchErrorResult, av as QueryObserverResult, at as QueryObserverSuccessResult, a0 as QueryOptions, J as QueryPersister, t as QueryState, am as QueryStatus, af as RefetchOptions, ah as RefetchQueryFilters, R as Register, aj as ResetOptions, ae as ResultOptions, aW as SetDataOptions, S as SkipToken, G as StaleTime, a3 as ThrowOnError, U as Updater, a5 as WithRequired, B as dataTagSymbol, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, h as hashKey, o as hydrate, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken } from './hydration-BXpkOXt5.cjs'; -export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs'; -export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs'; -export { notifyManager } from './notifyManager.cjs'; -export { focusManager } from './focusManager.cjs'; -export { onlineManager } from './onlineManager.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/index.js b/node_modules/@tanstack/query-core/build/legacy/index.js deleted file mode 100644 index 63d9470751cf4c52b55aefb05ea5528532a77efc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.js +++ /dev/null @@ -1,61 +0,0 @@ -import "./chunk-2HYBKCYP.js"; - -// src/index.ts -import { CancelledError } from "./retryer.js"; -import { QueryCache } from "./queryCache.js"; -import { QueryClient } from "./queryClient.js"; -import { QueryObserver } from "./queryObserver.js"; -import { QueriesObserver } from "./queriesObserver.js"; -import { InfiniteQueryObserver } from "./infiniteQueryObserver.js"; -import { MutationCache } from "./mutationCache.js"; -import { MutationObserver } from "./mutationObserver.js"; -import { notifyManager } from "./notifyManager.js"; -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { - hashKey, - replaceEqualDeep, - isServer, - matchQuery, - matchMutation, - keepPreviousData, - skipToken -} from "./utils.js"; -import { isCancelledError } from "./retryer.js"; -import { - dehydrate, - hydrate, - defaultShouldDehydrateQuery, - defaultShouldDehydrateMutation -} from "./hydration.js"; -export * from "./types.js"; -import { Query } from "./query.js"; -import { Mutation } from "./mutation.js"; -export { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - notifyManager, - onlineManager, - replaceEqualDeep, - skipToken -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.js.map b/node_modules/@tanstack/query-core/build/legacy/index.js.map deleted file mode 100644 index 71ce4da093655da37cf130312a5d0687a787a5a2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;AAEA,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,cAAc;AAEd,SAAS,aAAa;AAEtB,SAAS,gBAAgB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs deleted file mode 100644 index 3eba4922c56f21e8d49a1733bed813ef1445341e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryBehavior.ts -var infiniteQueryBehavior_exports = {}; -__export(infiniteQueryBehavior_exports, { - hasNextPage: () => hasNextPage, - hasPreviousPage: () => hasPreviousPage, - infiniteQueryBehavior: () => infiniteQueryBehavior -}); -module.exports = __toCommonJS(infiniteQueryBehavior_exports); -var import_utils = require("./utils.cjs"); -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - var _a, _b, _c, _d, _e; - const options = context.options; - const direction = (_c = (_b = (_a = context.fetchOptions) == null ? void 0 : _a.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; - const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; - const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - if (context.signal.aborted) { - cancelled = true; - } else { - context.signal.addEventListener("abort", () => { - cancelled = true; - }); - } - return context.signal; - } - }); - }; - const queryFn = (0, import_utils.ensureQueryFn)(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const queryFnContext = { - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext); - const page = await queryFn( - queryFnContext - ); - const { maxPages } = context.options; - const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - var _a2, _b2; - return (_b2 = (_a2 = context.options).persister) == null ? void 0 : _b2.call( - _a2, - fetchFn, - { - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - var _a; - return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) - return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) - return false; - return getPreviousPageParam(options, data) != null; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}); -//# sourceMappingURL=infiniteQueryBehavior.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts deleted file mode 100644 index 7dc85ee9996afcb7875c1a8b6a8a55cd7bf6a87b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import { aZ as QueryBehavior, Y as InfiniteData, a2 as InfiniteQueryPageParamsOptions } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts deleted file mode 100644 index 689844339453cb6247e129f3d0585139de5b1e71..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { aZ as QueryBehavior, Y as InfiniteData, a2 as InfiniteQueryPageParamsOptions } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js deleted file mode 100644 index 28dc0540051fc3c71f300858526f898a5631f80e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js +++ /dev/null @@ -1,127 +0,0 @@ -import "./chunk-2HYBKCYP.js"; - -// src/infiniteQueryBehavior.ts -import { addToEnd, addToStart, ensureQueryFn } from "./utils.js"; -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - var _a, _b, _c, _d, _e; - const options = context.options; - const direction = (_c = (_b = (_a = context.fetchOptions) == null ? void 0 : _a.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; - const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; - const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - if (context.signal.aborted) { - cancelled = true; - } else { - context.signal.addEventListener("abort", () => { - cancelled = true; - }); - } - return context.signal; - } - }); - }; - const queryFn = ensureQueryFn(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const queryFnContext = { - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext); - const page = await queryFn( - queryFnContext - ); - const { maxPages } = context.options; - const addTo = previous ? addToStart : addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - var _a2, _b2; - return (_b2 = (_a2 = context.options).persister) == null ? void 0 : _b2.call( - _a2, - fetchFn, - { - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - var _a; - return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) - return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) - return false; - return getPreviousPageParam(options, data) != null; -} -export { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}; -//# sourceMappingURL=infiniteQueryBehavior.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map deleted file mode 100644 index 3995acb531fcecd5eeb5e5fe7d3e751dc18989af..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import { addToEnd, addToStart, ensureQueryFn } from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true\n } else {\n context.signal.addEventListener('abort', () => {\n cancelled = true\n })\n }\n return context.signal\n },\n })\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n const page = await queryFn(\n queryFnContext as QueryFunctionContext,\n )\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";;;AAAA,SAAS,UAAU,YAAY,qBAAqB;AAU7C,SAAS,sBACd,OACsE;AACtE,SAAO;AAAA,IACL,SAAS,CAAC,SAAS,UAAU;AAdjC;AAeM,YAAM,UAAU,QAAQ;AACxB,YAAM,aAAY,yBAAQ,iBAAR,mBAAsB,SAAtB,mBAA4B,cAA5B,mBAAuC;AACzD,YAAM,aAAW,aAAQ,MAAM,SAAd,mBAAoB,UAAS,CAAC;AAC/C,YAAM,kBAAgB,aAAQ,MAAM,SAAd,mBAAoB,eAAc,CAAC;AACzD,UAAI,SAAgC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,EAAE;AAChE,UAAI,cAAc;AAElB,YAAM,UAAU,YAAY;AAC1B,YAAI,YAAY;AAChB,cAAM,oBAAoB,CAAC,WAAoB;AAC7C,iBAAO,eAAe,QAAQ,UAAU;AAAA,YACtC,YAAY;AAAA,YACZ,KAAK,MAAM;AACT,kBAAI,QAAQ,OAAO,SAAS;AAC1B,4BAAY;AAAA,cACd,OAAO;AACL,wBAAQ,OAAO,iBAAiB,SAAS,MAAM;AAC7C,8BAAY;AAAA,gBACd,CAAC;AAAA,cACH;AACA,qBAAO,QAAQ;AAAA,YACjB;AAAA,UACF,CAAC;AAAA,QACH;AAEA,cAAM,UAAU,cAAc,QAAQ,SAAS,QAAQ,YAAY;AAGnE,cAAM,YAAY,OAChB,MACA,OACA,aACmC;AACnC,cAAI,WAAW;AACb,mBAAO,QAAQ,OAAO;AAAA,UACxB;AAEA,cAAI,SAAS,QAAQ,KAAK,MAAM,QAAQ;AACtC,mBAAO,QAAQ,QAAQ,IAAI;AAAA,UAC7B;AAEA,gBAAM,iBAGF;AAAA,YACF,UAAU,QAAQ;AAAA,YAClB,WAAW;AAAA,YACX,WAAW,WAAW,aAAa;AAAA,YACnC,MAAM,QAAQ,QAAQ;AAAA,UACxB;AAEA,4BAAkB,cAAc;AAEhC,gBAAM,OAAO,MAAM;AAAA,YACjB;AAAA,UACF;AAEA,gBAAM,EAAE,SAAS,IAAI,QAAQ;AAC7B,gBAAM,QAAQ,WAAW,aAAa;AAEtC,iBAAO;AAAA,YACL,OAAO,MAAM,KAAK,OAAO,MAAM,QAAQ;AAAA,YACvC,YAAY,MAAM,KAAK,YAAY,OAAO,QAAQ;AAAA,UACpD;AAAA,QACF;AAGA,YAAI,aAAa,SAAS,QAAQ;AAChC,gBAAM,WAAW,cAAc;AAC/B,gBAAM,cAAc,WAAW,uBAAuB;AACtD,gBAAM,UAAU;AAAA,YACd,OAAO;AAAA,YACP,YAAY;AAAA,UACd;AACA,gBAAM,QAAQ,YAAY,SAAS,OAAO;AAE1C,mBAAS,MAAM,UAAU,SAAS,OAAO,QAAQ;AAAA,QACnD,OAAO;AACL,gBAAM,iBAAiB,SAAS,SAAS;AAGzC,aAAG;AACD,kBAAM,QACJ,gBAAgB,IACX,cAAc,CAAC,KAAK,QAAQ,mBAC7B,iBAAiB,SAAS,MAAM;AACtC,gBAAI,cAAc,KAAK,SAAS,MAAM;AACpC;AAAA,YACF;AACA,qBAAS,MAAM,UAAU,QAAQ,KAAK;AACtC;AAAA,UACF,SAAS,cAAc;AAAA,QACzB;AAEA,eAAO;AAAA,MACT;AACA,UAAI,QAAQ,QAAQ,WAAW;AAC7B,gBAAQ,UAAU,MAAM;AAhHhC,cAAAA,KAAAC;AAiHU,kBAAOA,OAAAD,MAAA,QAAQ,SAAQ,cAAhB,gBAAAC,IAAA;AAAA,YAAAD;AAAA,YACL;AAAA,YACA;AAAA,cACE,UAAU,QAAQ;AAAA,cAClB,MAAM,QAAQ,QAAQ;AAAA,cACtB,QAAQ,QAAQ;AAAA,YAClB;AAAA,YACA;AAAA;AAAA,QAEJ;AAAA,MACF,OAAO;AACL,gBAAQ,UAAU;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,iBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,QAAM,YAAY,MAAM,SAAS;AACjC,SAAO,MAAM,SAAS,IAClB,QAAQ;AAAA,IACN,MAAM,SAAS;AAAA,IACf;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,EACF,IACA;AACN;AAEA,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AApJvB;AAqJE,SAAO,MAAM,SAAS,KAClB,aAAQ,yBAAR,iCAA+B,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,cAC/D;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC;AAAM,WAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ;AAAsB,WAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs deleted file mode 100644 index 868dcbfb484792010d2b82bee171faff871f2cc3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryObserver.ts -var infiniteQueryObserver_exports = {}; -__export(infiniteQueryObserver_exports, { - InfiniteQueryObserver: () => InfiniteQueryObserver -}); -module.exports = __toCommonJS(infiniteQueryObserver_exports); -var import_queryObserver = require("./queryObserver.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options, notifyOptions) { - super.setOptions( - { - ...options, - behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() - }, - notifyOptions - ); - } - getOptimisticResult(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - var _a, _b; - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), - hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - InfiniteQueryObserver -}); -//# sourceMappingURL=infiniteQueryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map deleted file mode 100644 index b7a5b5ddcea73f50d2456fe8c3b4bc4828e5125f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n notifyOptions?: NotifyOptions,\n ): void {\n super.setOptions(\n {\n ...options,\n behavior: infiniteQueryBehavior(),\n },\n notifyOptions,\n )\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAqBA,IAAM,wBAAN,cAOG,mCAMR;AAAA,EA8BA,YACE,QACA,SAQA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAQA,eACM;AACN,UAAM;AAAA,MACJ;AAAA,QACE,GAAG;AAAA,QACH,cAAU,oDAAsB;AAAA,MAClC;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,oBACE,SAQ4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAQ4C;AAnKhD;AAoKI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts deleted file mode 100644 index 3dd38e57cb793f844d70475eb0d89589b8df33d6..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts +++ /dev/null @@ -1,20 +0,0 @@ -import { z as DefaultError, Y as InfiniteData, A as QueryKey, c as QueryObserver, aD as InfiniteQueryObserverResult, b as QueryClient, a8 as InfiniteQueryObserverOptions, a_ as NotifyOptions, a9 as DefaultedInfiniteQueryObserverOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, u as Query } from './hydration-BXpkOXt5.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts deleted file mode 100644 index d2c74ac0b9dac20b55e40b91879165fdb4384b4b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { z as DefaultError, Y as InfiniteData, A as QueryKey, c as QueryObserver, aD as InfiniteQueryObserverResult, b as QueryClient, a8 as InfiniteQueryObserverOptions, a_ as NotifyOptions, a9 as DefaultedInfiniteQueryObserverOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, u as Query } from './hydration-mKPlgzt9.js'; -import { Subscribable } from './subscribable.js'; -import './removable.js'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js deleted file mode 100644 index 6f357dcf516ff7a02b36d262a14989aefafd187b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js +++ /dev/null @@ -1,77 +0,0 @@ -import "./chunk-2HYBKCYP.js"; - -// src/infiniteQueryObserver.ts -import { QueryObserver } from "./queryObserver.js"; -import { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -} from "./infiniteQueryBehavior.js"; -var InfiniteQueryObserver = class extends QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options, notifyOptions) { - super.setOptions( - { - ...options, - behavior: infiniteQueryBehavior() - }, - notifyOptions - ); - } - getOptimisticResult(options) { - options.behavior = infiniteQueryBehavior(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - var _a, _b; - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -export { - InfiniteQueryObserver -}; -//# sourceMappingURL=infiniteQueryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map deleted file mode 100644 index 66db511e8f49b8c35a419cc3d66a9c8e4e4b1028..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n notifyOptions?: NotifyOptions,\n ): void {\n super.setOptions(\n {\n ...options,\n behavior: infiniteQueryBehavior(),\n },\n notifyOptions,\n )\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAqBA,IAAM,wBAAN,cAOG,cAMR;AAAA,EA8BA,YACE,QACA,SAQA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAQA,eACM;AACN,UAAM;AAAA,MACJ;AAAA,QACE,GAAG;AAAA,QACH,UAAU,sBAAsB;AAAA,MAClC;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,oBACE,SAQ4C;AAC5C,YAAQ,WAAW,sBAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAQ4C;AAnKhD;AAoKI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,aAAa,YAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,iBAAiB,gBAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs deleted file mode 100644 index 19f7494a71d1703d99ee5c6565c4bd898c769402..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs +++ /dev/null @@ -1,298 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -// src/mutation.ts -var mutation_exports = {}; -__export(mutation_exports, { - Mutation: () => Mutation, - getDefaultState: () => getDefaultState -}); -module.exports = __toCommonJS(mutation_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_removable = require("./removable.cjs"); -var import_retryer = require("./retryer.cjs"); -var _observers, _mutationCache, _retryer, _dispatch, dispatch_fn; -var Mutation = class extends import_removable.Removable { - constructor(config) { - super(); - __privateAdd(this, _dispatch); - __privateAdd(this, _observers, void 0); - __privateAdd(this, _mutationCache, void 0); - __privateAdd(this, _retryer, void 0); - this.mutationId = config.mutationId; - __privateSet(this, _mutationCache, config.mutationCache); - __privateSet(this, _observers, []); - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!__privateGet(this, _observers).includes(observer)) { - __privateGet(this, _observers).push(observer); - this.clearGcTimeout(); - __privateGet(this, _mutationCache).notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); - this.scheduleGc(); - __privateGet(this, _mutationCache).notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!__privateGet(this, _observers).length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - __privateGet(this, _mutationCache).remove(this); - } - } - } - continue() { - var _a; - return ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t; - __privateSet(this, _retryer, (0, import_retryer.createRetryer)({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "continue" }); - }, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => __privateGet(this, _mutationCache).canRun(this) - })); - const restored = this.state.status === "pending"; - const isPaused = !__privateGet(this, _retryer).canStart(); - try { - if (!restored) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pending", variables, isPaused }); - await ((_b = (_a = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b.call( - _a, - variables, - this - )); - const context = await ((_d = (_c = this.options).onMutate) == null ? void 0 : _d.call(_c, variables)); - if (context !== this.state.context) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await __privateGet(this, _retryer).start(); - await ((_f = (_e = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _f.call( - _e, - data, - variables, - this.state.context, - this - )); - await ((_h = (_g = this.options).onSuccess) == null ? void 0 : _h.call(_g, data, variables, this.state.context)); - await ((_j = (_i = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _j.call( - _i, - data, - null, - this.state.variables, - this.state.context, - this - )); - await ((_l = (_k = this.options).onSettled) == null ? void 0 : _l.call(_k, data, null, variables, this.state.context)); - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "success", data }); - return data; - } catch (error) { - try { - await ((_n = (_m = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _n.call( - _m, - error, - variables, - this.state.context, - this - )); - await ((_p = (_o = this.options).onError) == null ? void 0 : _p.call( - _o, - error, - variables, - this.state.context - )); - await ((_r = (_q = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _r.call( - _q, - void 0, - error, - this.state.variables, - this.state.context, - this - )); - await ((_t = (_s = this.options).onSettled) == null ? void 0 : _t.call( - _s, - void 0, - error, - variables, - this.state.context - )); - throw error; - } finally { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "error", error }); - } - } finally { - __privateGet(this, _mutationCache).runNext(this); - } - } -}; -_observers = new WeakMap(); -_mutationCache = new WeakMap(); -_retryer = new WeakMap(); -_dispatch = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - __privateGet(this, _observers).forEach((observer) => { - observer.onMutationUpdate(action); - }); - __privateGet(this, _mutationCache).notify({ - mutation: this, - type: "updated", - action - }); - }); -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Mutation, - getDefaultState -}); -//# sourceMappingURL=mutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.js b/node_modules/@tanstack/query-core/build/legacy/mutation.js deleted file mode 100644 index d80c89f46cad0635c0431b33c311bfc95690b6b4..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.js +++ /dev/null @@ -1,257 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/mutation.ts -import { notifyManager } from "./notifyManager.js"; -import { Removable } from "./removable.js"; -import { createRetryer } from "./retryer.js"; -var _observers, _mutationCache, _retryer, _dispatch, dispatch_fn; -var Mutation = class extends Removable { - constructor(config) { - super(); - __privateAdd(this, _dispatch); - __privateAdd(this, _observers, void 0); - __privateAdd(this, _mutationCache, void 0); - __privateAdd(this, _retryer, void 0); - this.mutationId = config.mutationId; - __privateSet(this, _mutationCache, config.mutationCache); - __privateSet(this, _observers, []); - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!__privateGet(this, _observers).includes(observer)) { - __privateGet(this, _observers).push(observer); - this.clearGcTimeout(); - __privateGet(this, _mutationCache).notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); - this.scheduleGc(); - __privateGet(this, _mutationCache).notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!__privateGet(this, _observers).length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - __privateGet(this, _mutationCache).remove(this); - } - } - } - continue() { - var _a; - return ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t; - __privateSet(this, _retryer, createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "continue" }); - }, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => __privateGet(this, _mutationCache).canRun(this) - })); - const restored = this.state.status === "pending"; - const isPaused = !__privateGet(this, _retryer).canStart(); - try { - if (!restored) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pending", variables, isPaused }); - await ((_b = (_a = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b.call( - _a, - variables, - this - )); - const context = await ((_d = (_c = this.options).onMutate) == null ? void 0 : _d.call(_c, variables)); - if (context !== this.state.context) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await __privateGet(this, _retryer).start(); - await ((_f = (_e = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _f.call( - _e, - data, - variables, - this.state.context, - this - )); - await ((_h = (_g = this.options).onSuccess) == null ? void 0 : _h.call(_g, data, variables, this.state.context)); - await ((_j = (_i = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _j.call( - _i, - data, - null, - this.state.variables, - this.state.context, - this - )); - await ((_l = (_k = this.options).onSettled) == null ? void 0 : _l.call(_k, data, null, variables, this.state.context)); - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "success", data }); - return data; - } catch (error) { - try { - await ((_n = (_m = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _n.call( - _m, - error, - variables, - this.state.context, - this - )); - await ((_p = (_o = this.options).onError) == null ? void 0 : _p.call( - _o, - error, - variables, - this.state.context - )); - await ((_r = (_q = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _r.call( - _q, - void 0, - error, - this.state.variables, - this.state.context, - this - )); - await ((_t = (_s = this.options).onSettled) == null ? void 0 : _t.call( - _s, - void 0, - error, - variables, - this.state.context - )); - throw error; - } finally { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "error", error }); - } - } finally { - __privateGet(this, _mutationCache).runNext(this); - } - } -}; -_observers = new WeakMap(); -_mutationCache = new WeakMap(); -_retryer = new WeakMap(); -_dispatch = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - __privateGet(this, _observers).forEach((observer) => { - observer.onMutationUpdate(action); - }); - __privateGet(this, _mutationCache).notify({ - mutation: this, - type: "updated", - action - }); - }); -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -export { - Mutation, - getDefaultState -}; -//# sourceMappingURL=mutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.js.map b/node_modules/@tanstack/query-core/build/legacy/mutation.js.map deleted file mode 100644 index 8fba658e4dac3eeac50b1fc74c769c56f9c7fcdc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface MutationConfig {\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TContext = unknown,\n> {\n context: TContext | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TContext\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TContext = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #observers: Array>\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(config: MutationConfig) {\n super()\n\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n return this.options.mutationFn(variables)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (!restored) {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n await this.#mutationCache.config.onMutate?.(\n variables,\n this as Mutation,\n )\n const context = await this.options.onMutate?.(variables)\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSuccess?.(data, variables, this.state.context!)\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSettled?.(data, null, variables, this.state.context)\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n )\n throw error\n } finally {\n this.#dispatch({ type: 'error', error: error as TError })\n }\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TContext,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs deleted file mode 100644 index d152201f35f75155bc7498b43a718fdfd3ccdd4e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs +++ /dev/null @@ -1,153 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); - -// src/mutationCache.ts -var mutationCache_exports = {}; -__export(mutationCache_exports, { - MutationCache: () => MutationCache -}); -module.exports = __toCommonJS(mutationCache_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_mutation = require("./mutation.cjs"); -var import_utils = require("./utils.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var _mutations, _mutationId; -var MutationCache = class extends import_subscribable.Subscribable { - constructor(config = {}) { - super(); - this.config = config; - __privateAdd(this, _mutations, void 0); - __privateAdd(this, _mutationId, void 0); - __privateSet(this, _mutations, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationId, Date.now()); - } - build(client, options, state) { - const mutation = new import_mutation.Mutation({ - mutationCache: this, - mutationId: ++__privateWrapper(this, _mutationId)._, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - const scope = scopeFor(mutation); - const mutations = __privateGet(this, _mutations).get(scope) ?? []; - mutations.push(mutation); - __privateGet(this, _mutations).set(scope, mutations); - this.notify({ type: "added", mutation }); - } - remove(mutation) { - var _a; - const scope = scopeFor(mutation); - if (__privateGet(this, _mutations).has(scope)) { - const mutations = (_a = __privateGet(this, _mutations).get(scope)) == null ? void 0 : _a.filter((x) => x !== mutation); - if (mutations) { - if (mutations.length === 0) { - __privateGet(this, _mutations).delete(scope); - } else { - __privateGet(this, _mutations).set(scope, mutations); - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - var _a; - const firstPendingMutation = (_a = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a.find((m) => m.state.status === "pending"); - return !firstPendingMutation || firstPendingMutation === mutation; - } - runNext(mutation) { - var _a; - const foundMutation = (_a = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a.find((m) => m !== mutation && m.state.isPaused); - return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); - } - clear() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((mutation) => { - this.remove(mutation); - }); - }); - } - getAll() { - return [...__privateGet(this, _mutations).values()].flat(); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => (0, import_utils.matchMutation)(filters, mutation)); - } - notify(event) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return import_notifyManager.notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(import_utils.noop)) - ) - ); - } -}; -_mutations = new WeakMap(); -_mutationId = new WeakMap(); -function scopeFor(mutation) { - var _a; - return ((_a = mutation.options.scope) == null ? void 0 : _a.id) ?? String(mutation.mutationId); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationCache -}); -//# sourceMappingURL=mutationCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map deleted file mode 100644 index 4e4d0c36661b218324fd04e70f244efa4b60e2d0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type { DefaultError, MutationOptions, NotifyEvent } from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Map()\n this.#mutationId = Date.now()\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n const mutations = this.#mutations.get(scope) ?? []\n mutations.push(mutation)\n this.#mutations.set(scope, mutations)\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n if (this.#mutations.has(scope)) {\n const mutations = this.#mutations\n .get(scope)\n ?.filter((x) => x !== mutation)\n if (mutations) {\n if (mutations.length === 0) {\n this.#mutations.delete(scope)\n } else {\n this.#mutations.set(scope, mutations)\n }\n }\n }\n\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const firstPendingMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m.state.status === 'pending')\n\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n }\n\n runNext(mutation: Mutation): Promise {\n const foundMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((mutation) => {\n this.remove(mutation)\n })\n })\n }\n\n getAll(): Array {\n return [...this.#mutations.values()].flat()\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TContext = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id ?? String(mutation.mutationId)\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts deleted file mode 100644 index 2721783142bad18b147228854ee4ca9bcc276c90..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-BXpkOXt5.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map deleted file mode 100644 index 6044deb45f7b6b4e566969c06afcc823955f3bf0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type { DefaultError, MutationOptions, NotifyEvent } from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Map()\n this.#mutationId = Date.now()\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n const mutations = this.#mutations.get(scope) ?? []\n mutations.push(mutation)\n this.#mutations.set(scope, mutations)\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n if (this.#mutations.has(scope)) {\n const mutations = this.#mutations\n .get(scope)\n ?.filter((x) => x !== mutation)\n if (mutations) {\n if (mutations.length === 0) {\n this.#mutations.delete(scope)\n } else {\n this.#mutations.set(scope, mutations)\n }\n }\n }\n\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const firstPendingMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m.state.status === 'pending')\n\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n }\n\n runNext(mutation: Mutation): Promise {\n const foundMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((mutation) => {\n this.remove(mutation)\n })\n })\n }\n\n getAll(): Array {\n return [...this.#mutations.values()].flat()\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TContext = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id ?? String(mutation.mutationId)\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs deleted file mode 100644 index dc3ea6b52b8042a092c2f4b4609ba097cd401b8b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -// src/mutationObserver.ts -var mutationObserver_exports = {}; -__export(mutationObserver_exports, { - MutationObserver: () => MutationObserver -}); -module.exports = __toCommonJS(mutationObserver_exports); -var import_mutation = require("./mutation.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var _client, _currentResult, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify, notify_fn; -var MutationObserver = class extends import_subscribable.Subscribable { - constructor(client, options) { - super(); - __privateAdd(this, _updateResult); - __privateAdd(this, _notify); - __privateAdd(this, _client, void 0); - __privateAdd(this, _currentResult, void 0); - __privateAdd(this, _currentMutation, void 0); - __privateAdd(this, _mutateOptions, void 0); - __privateSet(this, _client, client); - this.setOptions(options); - this.bindMethods(); - __privateMethod(this, _updateResult, updateResult_fn).call(this); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - var _a; - const prevOptions = this.options; - this.options = __privateGet(this, _client).defaultMutationOptions(options); - if (!(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - __privateGet(this, _client).getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: __privateGet(this, _currentMutation), - observer: this - }); - } - if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && (0, import_utils.hashKey)(prevOptions.mutationKey) !== (0, import_utils.hashKey)(this.options.mutationKey)) { - this.reset(); - } else if (((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state.status) === "pending") { - __privateGet(this, _currentMutation).setOptions(this.options); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - } - } - onMutationUpdate(action) { - __privateMethod(this, _updateResult, updateResult_fn).call(this); - __privateMethod(this, _notify, notify_fn).call(this, action); - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - reset() { - var _a; - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, void 0); - __privateMethod(this, _updateResult, updateResult_fn).call(this); - __privateMethod(this, _notify, notify_fn).call(this); - } - mutate(variables, options) { - var _a; - __privateSet(this, _mutateOptions, options); - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); - __privateGet(this, _currentMutation).addObserver(this); - return __privateGet(this, _currentMutation).execute(variables); - } -}; -_client = new WeakMap(); -_currentResult = new WeakMap(); -_currentMutation = new WeakMap(); -_mutateOptions = new WeakMap(); -_updateResult = new WeakSet(); -updateResult_fn = function() { - var _a; - const state = ((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state) ?? (0, import_mutation.getDefaultState)(); - __privateSet(this, _currentResult, { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }); -}; -_notify = new WeakSet(); -notify_fn = function(action) { - import_notifyManager.notifyManager.batch(() => { - var _a, _b, _c, _d, _e, _f, _g, _h; - if (__privateGet(this, _mutateOptions) && this.hasListeners()) { - const variables = __privateGet(this, _currentResult).variables; - const context = __privateGet(this, _currentResult).context; - if ((action == null ? void 0 : action.type) === "success") { - (_b = (_a = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call(_a, action.data, variables, context); - (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call(_c, action.data, null, variables, context); - } else if ((action == null ? void 0 : action.type) === "error") { - (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call(_e, action.error, variables, context); - (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( - _g, - void 0, - action.error, - variables, - context - ); - } - } - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationObserver -}); -//# sourceMappingURL=mutationObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map deleted file mode 100644 index 310c020d75119b83274cb9e672a45798bd9c9964..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult =\n undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(action: Action): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TContext\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const context = this.#currentResult.context\n\n if (action?.type === 'success') {\n this.#mutateOptions.onSuccess?.(action.data, variables, context!)\n this.#mutateOptions.onSettled?.(action.data, null, variables, context)\n } else if (action?.type === 'error') {\n this.#mutateOptions.onError?.(action.error, variables, context)\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n context,\n )\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts deleted file mode 100644 index 9404b76d8df3e765cec35ea06d68fe3cae01dabe..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { e as MutationObserver } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts deleted file mode 100644 index 68158f2a41b53e9efbc2ab338651425700ef7b4b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { e as MutationObserver } from './hydration-mKPlgzt9.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js deleted file mode 100644 index 88e62eeb5e31bec0bb5542bf34cc1343a4336b3b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js +++ /dev/null @@ -1,125 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/mutationObserver.ts -import { getDefaultState } from "./mutation.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -import { hashKey, shallowEqualObjects } from "./utils.js"; -var _client, _currentResult, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify, notify_fn; -var MutationObserver = class extends Subscribable { - constructor(client, options) { - super(); - __privateAdd(this, _updateResult); - __privateAdd(this, _notify); - __privateAdd(this, _client, void 0); - __privateAdd(this, _currentResult, void 0); - __privateAdd(this, _currentMutation, void 0); - __privateAdd(this, _mutateOptions, void 0); - __privateSet(this, _client, client); - this.setOptions(options); - this.bindMethods(); - __privateMethod(this, _updateResult, updateResult_fn).call(this); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - var _a; - const prevOptions = this.options; - this.options = __privateGet(this, _client).defaultMutationOptions(options); - if (!shallowEqualObjects(this.options, prevOptions)) { - __privateGet(this, _client).getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: __privateGet(this, _currentMutation), - observer: this - }); - } - if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { - this.reset(); - } else if (((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state.status) === "pending") { - __privateGet(this, _currentMutation).setOptions(this.options); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - } - } - onMutationUpdate(action) { - __privateMethod(this, _updateResult, updateResult_fn).call(this); - __privateMethod(this, _notify, notify_fn).call(this, action); - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - reset() { - var _a; - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, void 0); - __privateMethod(this, _updateResult, updateResult_fn).call(this); - __privateMethod(this, _notify, notify_fn).call(this); - } - mutate(variables, options) { - var _a; - __privateSet(this, _mutateOptions, options); - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); - __privateGet(this, _currentMutation).addObserver(this); - return __privateGet(this, _currentMutation).execute(variables); - } -}; -_client = new WeakMap(); -_currentResult = new WeakMap(); -_currentMutation = new WeakMap(); -_mutateOptions = new WeakMap(); -_updateResult = new WeakSet(); -updateResult_fn = function() { - var _a; - const state = ((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state) ?? getDefaultState(); - __privateSet(this, _currentResult, { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }); -}; -_notify = new WeakSet(); -notify_fn = function(action) { - notifyManager.batch(() => { - var _a, _b, _c, _d, _e, _f, _g, _h; - if (__privateGet(this, _mutateOptions) && this.hasListeners()) { - const variables = __privateGet(this, _currentResult).variables; - const context = __privateGet(this, _currentResult).context; - if ((action == null ? void 0 : action.type) === "success") { - (_b = (_a = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call(_a, action.data, variables, context); - (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call(_c, action.data, null, variables, context); - } else if ((action == null ? void 0 : action.type) === "error") { - (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call(_e, action.error, variables, context); - (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( - _g, - void 0, - action.error, - variables, - context - ); - } - } - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - }); -}; -export { - MutationObserver -}; -//# sourceMappingURL=mutationObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map deleted file mode 100644 index df1e4becdb8875cd47be22ca14d1149f0061bfbd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult =\n undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(action: Action): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TContext\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const context = this.#currentResult.context\n\n if (action?.type === 'success') {\n this.#mutateOptions.onSuccess?.(action.data, variables, context!)\n this.#mutateOptions.onSettled?.(action.data, null, variables, context)\n } else if (action?.type === 'error') {\n this.#mutateOptions.onError?.(action.error, variables, context)\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n context,\n )\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs deleted file mode 100644 index e915e77720edaf58c73048a79ae089b80c7efa07..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/notifyManager.ts -var notifyManager_exports = {}; -__export(notifyManager_exports, { - createNotifyManager: () => createNotifyManager, - notifyManager: () => notifyManager -}); -module.exports = __toCommonJS(notifyManager_exports); -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = (cb) => setTimeout(cb, 0); - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createNotifyManager, - notifyManager -}); -//# sourceMappingURL=notifyManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map deleted file mode 100644 index c990a2813019db4663592df5b1b481f64e7d6717..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAA+B,CAAC,OAAO,WAAW,IAAI,CAAC;AAE3D,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts deleted file mode 100644 index 57955e77debb00a0ac4bafd117ec517f0d99277d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts +++ /dev/null @@ -1,45 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts deleted file mode 100644 index 57955e77debb00a0ac4bafd117ec517f0d99277d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js deleted file mode 100644 index 078ccbcad5fd718ed1064d2d99827099160939e8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js +++ /dev/null @@ -1,85 +0,0 @@ -import "./chunk-2HYBKCYP.js"; - -// src/notifyManager.ts -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = (cb) => setTimeout(cb, 0); - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -export { - createNotifyManager, - notifyManager -}; -//# sourceMappingURL=notifyManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map deleted file mode 100644 index aa6a19bd31138d3b2ccd3793ebc2a61e4cad0f94..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;AAYO,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAA+B,CAAC,OAAO,WAAW,IAAI,CAAC;AAE3D,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs deleted file mode 100644 index a46b312683584dd77844f53608aa83e96aa9cef3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; - -// src/onlineManager.ts -var onlineManager_exports = {}; -__export(onlineManager_exports, { - OnlineManager: () => OnlineManager, - onlineManager: () => onlineManager -}); -module.exports = __toCommonJS(onlineManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var _online, _cleanup, _setup; -var OnlineManager = class extends import_subscribable.Subscribable { - constructor() { - super(); - __privateAdd(this, _online, true); - __privateAdd(this, _cleanup, void 0); - __privateAdd(this, _setup, void 0); - __privateSet(this, _setup, (onOnline) => { - if (!import_utils.isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup(this.setOnline.bind(this))); - } - setOnline(online) { - const changed = __privateGet(this, _online) !== online; - if (changed) { - __privateSet(this, _online, online); - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return __privateGet(this, _online); - } -}; -_online = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var onlineManager = new OnlineManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - OnlineManager, - onlineManager -}); -//# sourceMappingURL=onlineManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts deleted file mode 100644 index 4362a5c84c19c3abd125e3d39609af233c6c7d69..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (online: boolean) => void; -type SetupFn = (setOnline: Listener) => (() => void) | undefined; -declare class OnlineManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setOnline(online: boolean): void; - isOnline(): boolean; -} -declare const onlineManager: OnlineManager; - -export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js deleted file mode 100644 index 84c9fafa1fdd2e9b0f060e0237a4f45d826370bc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js +++ /dev/null @@ -1,70 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/onlineManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var _online, _cleanup, _setup; -var OnlineManager = class extends Subscribable { - constructor() { - super(); - __privateAdd(this, _online, true); - __privateAdd(this, _cleanup, void 0); - __privateAdd(this, _setup, void 0); - __privateSet(this, _setup, (onOnline) => { - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup(this.setOnline.bind(this))); - } - setOnline(online) { - const changed = __privateGet(this, _online) !== online; - if (changed) { - __privateSet(this, _online, online); - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return __privateGet(this, _online); - } -}; -_online = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var onlineManager = new OnlineManager(); -export { - OnlineManager, - onlineManager -}; -//# sourceMappingURL=onlineManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map deleted file mode 100644 index 92e725dc2acff5590d8e1f8ac7dc859743441468..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AADzB;AAMO,IAAM,gBAAN,cAA4B,aAAuB;AAAA,EAMxD,cAAc;AACZ,UAAM;AANR,gCAAU;AACV;AAEA;AAIE,uBAAK,QAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAzC5B;AA0CI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AAhDzC;AAiDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,mBAAK,aAAY;AAEjC,QAAI,SAAS;AACX,yBAAK,SAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,mBAAK;AAAA,EACd;AACF;AA7DE;AACA;AAEA;AA4DK,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map deleted file mode 100644 index 201252af13665eaf3c22541bf4b47f276edd8eb4..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\n\nfunction difference(array1: Array, array2: Array): Array {\n return array1.filter((x) => !array2.includes(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n notifyOptions?: NotifyOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map((query) => query.queryHash)\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions, notifyOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return\n }\n\n this.#observers = newObservers\n this.#result = newResult\n\n if (!this.hasListeners()) {\n return\n }\n\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine)\n },\n () => {\n return this.#trackResult(result, queries)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n queries: Array,\n ) {\n const matches = this.#findMatchingObservers(queries)\n\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n ): TCombinedResult {\n if (combine) {\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map(\n this.#observers.map((observer) => [observer.options.queryHash, observer]),\n )\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)\n if (match) {\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer: match,\n })\n } else {\n const existingObserver = this.#observers.find(\n (o) => o.options.queryHash === defaultedOptions.queryHash,\n )\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer:\n existingObserver ??\n new QueryObserver(this.#client, defaultedOptions),\n })\n }\n })\n\n return observers.sort((a, b) => {\n return (\n queries.findIndex(\n (q) => q.queryHash === a.defaultedQueryOptions.queryHash,\n ) -\n queries.findIndex(\n (q) => q.queryHash === b.defaultedQueryOptions.queryHash,\n )\n )\n })\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newResult = this.#combineResult(\n this.#trackResult(this.#result, this.#queries),\n this.#options?.combine,\n )\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts deleted file mode 100644 index 2cb110c8db10f1da6151afea73351f284caabd26..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts +++ /dev/null @@ -1,27 +0,0 @@ -import { av as QueryObserverResult, b as QueryClient, a4 as QueryObserverOptions, a_ as NotifyOptions, u as Query, A as QueryKey, c as QueryObserver } from './hydration-BXpkOXt5.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type QueriesObserverListener = (result: Array) => void; -type CombineFn = (result: Array) => TCombinedResult; -interface QueriesObserverOptions> { - combine?: CombineFn; -} -declare class QueriesObserver> extends Subscribable { - #private; - constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - destroy(): void; - setQueries(queries: Array, options?: QueriesObserverOptions, notifyOptions?: NotifyOptions): void; - getCurrentResult(): Array; - getQueries(): Query[]; - getObservers(): QueryObserver[]; - getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array - ]; -} - -export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js deleted file mode 100644 index 6bf82c8b858cb1816fcbe1617611543780497a11..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js +++ /dev/null @@ -1,226 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/queriesObserver.ts -import { notifyManager } from "./notifyManager.js"; -import { QueryObserver } from "./queryObserver.js"; -import { Subscribable } from "./subscribable.js"; -import { replaceEqualDeep } from "./utils.js"; -function difference(array1, array2) { - return array1.filter((x) => !array2.includes(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var _client, _result, _queries, _options, _observers, _combinedResult, _lastCombine, _lastResult, _trackResult, trackResult_fn, _combineResult, combineResult_fn, _findMatchingObservers, findMatchingObservers_fn, _onUpdate, onUpdate_fn, _notify, notify_fn; -var QueriesObserver = class extends Subscribable { - constructor(client, queries, options) { - super(); - __privateAdd(this, _trackResult); - __privateAdd(this, _combineResult); - __privateAdd(this, _findMatchingObservers); - __privateAdd(this, _onUpdate); - __privateAdd(this, _notify); - __privateAdd(this, _client, void 0); - __privateAdd(this, _result, void 0); - __privateAdd(this, _queries, void 0); - __privateAdd(this, _options, void 0); - __privateAdd(this, _observers, void 0); - __privateAdd(this, _combinedResult, void 0); - __privateAdd(this, _lastCombine, void 0); - __privateAdd(this, _lastResult, void 0); - __privateSet(this, _client, client); - __privateSet(this, _options, options); - __privateSet(this, _queries, []); - __privateSet(this, _observers, []); - __privateSet(this, _result, []); - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - __privateGet(this, _observers).forEach((observer) => { - observer.subscribe((result) => { - __privateMethod(this, _onUpdate, onUpdate_fn).call(this, observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - __privateGet(this, _observers).forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options, notifyOptions) { - __privateSet(this, _queries, queries); - __privateSet(this, _options, options); - if (process.env.NODE_ENV !== "production") { - const queryHashes = queries.map((query) => query.queryHash); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - notifyManager.batch(() => { - const prevObservers = __privateGet(this, _observers); - const newObserverMatches = __privateMethod(this, _findMatchingObservers, findMatchingObservers_fn).call(this, __privateGet(this, _queries)); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions, notifyOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - if (prevObservers.length === newObservers.length && !hasIndexChange) { - return; - } - __privateSet(this, _observers, newObservers); - __privateSet(this, _result, newResult); - if (!this.hasListeners()) { - return; - } - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - __privateMethod(this, _onUpdate, onUpdate_fn).call(this, observer, result); - }); - }); - __privateMethod(this, _notify, notify_fn).call(this); - }); - } - getCurrentResult() { - return __privateGet(this, _result); - } - getQueries() { - return __privateGet(this, _observers).map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return __privateGet(this, _observers); - } - getOptimisticResult(queries, combine) { - const matches = __privateMethod(this, _findMatchingObservers, findMatchingObservers_fn).call(this, queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - return [ - result, - (r) => { - return __privateMethod(this, _combineResult, combineResult_fn).call(this, r ?? result, combine); - }, - () => { - return __privateMethod(this, _trackResult, trackResult_fn).call(this, result, queries); - } - ]; - } -}; -_client = new WeakMap(); -_result = new WeakMap(); -_queries = new WeakMap(); -_options = new WeakMap(); -_observers = new WeakMap(); -_combinedResult = new WeakMap(); -_lastCombine = new WeakMap(); -_lastResult = new WeakMap(); -_trackResult = new WeakSet(); -trackResult_fn = function(result, queries) { - const matches = __privateMethod(this, _findMatchingObservers, findMatchingObservers_fn).call(this, queries); - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); -}; -_combineResult = new WeakSet(); -combineResult_fn = function(input, combine) { - if (combine) { - if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || combine !== __privateGet(this, _lastCombine)) { - __privateSet(this, _lastCombine, combine); - __privateSet(this, _lastResult, __privateGet(this, _result)); - __privateSet(this, _combinedResult, replaceEqualDeep( - __privateGet(this, _combinedResult), - combine(input) - )); - } - return __privateGet(this, _combinedResult); - } - return input; -}; -_findMatchingObservers = new WeakSet(); -findMatchingObservers_fn = function(queries) { - const prevObserversMap = new Map( - __privateGet(this, _observers).map((observer) => [observer.options.queryHash, observer]) - ); - const observers = []; - queries.forEach((options) => { - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); - const match = prevObserversMap.get(defaultedOptions.queryHash); - if (match) { - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer: match - }); - } else { - const existingObserver = __privateGet(this, _observers).find( - (o) => o.options.queryHash === defaultedOptions.queryHash - ); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer: existingObserver ?? new QueryObserver(__privateGet(this, _client), defaultedOptions) - }); - } - }); - return observers.sort((a, b) => { - return queries.findIndex( - (q) => q.queryHash === a.defaultedQueryOptions.queryHash - ) - queries.findIndex( - (q) => q.queryHash === b.defaultedQueryOptions.queryHash - ); - }); -}; -_onUpdate = new WeakSet(); -onUpdate_fn = function(observer, result) { - const index = __privateGet(this, _observers).indexOf(observer); - if (index !== -1) { - __privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result)); - __privateMethod(this, _notify, notify_fn).call(this); - } -}; -_notify = new WeakSet(); -notify_fn = function() { - var _a; - if (this.hasListeners()) { - const previousResult = __privateGet(this, _combinedResult); - const newResult = __privateMethod(this, _combineResult, combineResult_fn).call(this, __privateMethod(this, _trackResult, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _queries)), (_a = __privateGet(this, _options)) == null ? void 0 : _a.combine); - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(__privateGet(this, _result)); - }); - }); - } - } -}; -export { - QueriesObserver -}; -//# sourceMappingURL=queriesObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map deleted file mode 100644 index 608c492dc60cdb715d6d7850b0b462b84a4bf823..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\n\nfunction difference(array1: Array, array2: Array): Array {\n return array1.filter((x) => !array2.includes(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n notifyOptions?: NotifyOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map((query) => query.queryHash)\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions, notifyOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return\n }\n\n this.#observers = newObservers\n this.#result = newResult\n\n if (!this.hasListeners()) {\n return\n }\n\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine)\n },\n () => {\n return this.#trackResult(result, queries)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n queries: Array,\n ) {\n const matches = this.#findMatchingObservers(queries)\n\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n ): TCombinedResult {\n if (combine) {\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map(\n this.#observers.map((observer) => [observer.options.queryHash, observer]),\n )\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)\n if (match) {\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer: match,\n })\n } else {\n const existingObserver = this.#observers.find(\n (o) => o.options.queryHash === defaultedOptions.queryHash,\n )\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer:\n existingObserver ??\n new QueryObserver(this.#client, defaultedOptions),\n })\n }\n })\n\n return observers.sort((a, b) => {\n return (\n queries.findIndex(\n (q) => q.queryHash === a.defaultedQueryOptions.queryHash,\n ) -\n queries.findIndex(\n (q) => q.queryHash === b.defaultedQueryOptions.queryHash,\n )\n )\n })\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newResult = this.#combineResult(\n this.#trackResult(this.#result, this.#queries),\n this.#options?.combine,\n )\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.cjs b/node_modules/@tanstack/query-core/build/legacy/query.cjs deleted file mode 100644 index d051b207ee7af64de0faaba4a2683ecf9a2aeb8d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.cjs +++ /dev/null @@ -1,443 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -// src/query.ts -var query_exports = {}; -__export(query_exports, { - Query: () => Query, - fetchState: () => fetchState -}); -module.exports = __toCommonJS(query_exports); -var import_utils = require("./utils.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_retryer = require("./retryer.cjs"); -var import_removable = require("./removable.cjs"); -var _initialState, _revertState, _cache, _retryer, _defaultOptions, _abortSignalConsumed, _dispatch, dispatch_fn; -var Query = class extends import_removable.Removable { - constructor(config) { - super(); - __privateAdd(this, _dispatch); - __privateAdd(this, _initialState, void 0); - __privateAdd(this, _revertState, void 0); - __privateAdd(this, _cache, void 0); - __privateAdd(this, _retryer, void 0); - __privateAdd(this, _defaultOptions, void 0); - __privateAdd(this, _abortSignalConsumed, void 0); - __privateSet(this, _abortSignalConsumed, false); - __privateSet(this, _defaultOptions, config.defaultOptions); - this.setOptions(config.options); - this.observers = []; - __privateSet(this, _cache, config.cache); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - __privateSet(this, _initialState, getDefaultState(this.options)); - this.state = config.state ?? __privateGet(this, _initialState); - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - var _a; - return (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - } - setOptions(options) { - this.options = { ...__privateGet(this, _defaultOptions), ...options }; - this.updateGcTime(this.options.gcTime); - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - __privateGet(this, _cache).remove(this); - } - } - setData(newData, options) { - const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - data, - type: "success", - dataUpdatedAt: options == null ? void 0 : options.updatedAt, - manual: options == null ? void 0 : options.manual - }); - return data; - } - setState(state, setStateOptions) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); - } - cancel(options) { - var _a, _b; - const promise = (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); - return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(__privateGet(this, _initialState)); - } - isActive() { - return this.observers.some( - (observer) => (0, import_utils.resolveEnabled)(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === import_utils.skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStale() { - if (this.state.isInvalidated) { - return true; - } - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0; - } - isStaleByTime(staleTime = 0) { - return this.state.isInvalidated || this.state.data === void 0 || !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - onOnline() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (__privateGet(this, _retryer)) { - if (__privateGet(this, _abortSignalConsumed)) { - __privateGet(this, _retryer).cancel({ revert: true }); - } else { - __privateGet(this, _retryer).cancelRetry(); - } - } - this.scheduleGc(); - } - __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "invalidate" }); - } - } - fetch(options, fetchOptions) { - var _a, _b, _c; - if (this.state.fetchStatus !== "idle") { - if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { - this.cancel({ silent: true }); - } else if (__privateGet(this, _retryer)) { - __privateGet(this, _retryer).continueRetry(); - return __privateGet(this, _retryer).promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - __privateSet(this, _abortSignalConsumed, true); - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = (0, import_utils.ensureQueryFn)(this.options, fetchOptions); - const queryFnContext = { - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext); - __privateSet(this, _abortSignalConsumed, false); - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const context = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - state: this.state, - fetchFn - }; - addSignalProperty(context); - (_a = this.options.behavior) == null ? void 0 : _a.onFetch( - context, - this - ); - __privateSet(this, _revertState, this.state); - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_b = context.fetchOptions) == null ? void 0 : _b.meta)) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "fetch", meta: (_c = context.fetchOptions) == null ? void 0 : _c.meta }); - } - const onError = (error) => { - var _a2, _b2, _c2, _d; - if (!((0, import_retryer.isCancelledError)(error) && error.silent)) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - type: "error", - error - }); - } - if (!(0, import_retryer.isCancelledError)(error)) { - (_b2 = (_a2 = __privateGet(this, _cache).config).onError) == null ? void 0 : _b2.call( - _a2, - error, - this - ); - (_d = (_c2 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d.call( - _c2, - this.state.data, - error, - this - ); - } - this.scheduleGc(); - }; - __privateSet(this, _retryer, (0, import_retryer.createRetryer)({ - initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, - fn: context.fetchFn, - abort: abortController.abort.bind(abortController), - onSuccess: (data) => { - var _a2, _b2, _c2, _d; - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - onError(new Error(`${this.queryHash} data is undefined`)); - return; - } - try { - this.setData(data); - } catch (error) { - onError(error); - return; - } - (_b2 = (_a2 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b2.call(_a2, data, this); - (_d = (_c2 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d.call( - _c2, - data, - this.state.error, - this - ); - this.scheduleGc(); - }, - onError, - onFail: (failureCount, error) => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - })); - return __privateGet(this, _retryer).start(); - } -}; -_initialState = new WeakMap(); -_revertState = new WeakMap(); -_cache = new WeakMap(); -_retryer = new WeakMap(); -_defaultOptions = new WeakMap(); -_abortSignalConsumed = new WeakMap(); -_dispatch = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - return { - ...state, - data: action.data, - dataUpdateCount: state.dataUpdateCount + 1, - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success", - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - case "error": - const error = action.error; - if ((0, import_retryer.isCancelledError)(error) && error.revert && __privateGet(this, _revertState)) { - return { ...__privateGet(this, _revertState), fetchStatus: "idle" }; - } - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error" - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - __privateGet(this, _cache).notify({ query: this, type: "updated", action }); - }); -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: (0, import_retryer.canFetch)(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Query, - fetchState -}); -//# sourceMappingURL=query.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.cjs.map b/node_modules/@tanstack/query-core/build/legacy/query.cjs.map deleted file mode 100644 index 190ba1dae9296a0977a088430d1a847d6d75914c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { canFetch, createRetryer, isCancelledError } from './retryer'\nimport { Removable } from './removable'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n} from './types'\nimport type { QueryCache } from './queryCache'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n cache: QueryCache\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#cache = config.cache\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStale(): boolean {\n if (this.state.isInvalidated) {\n return true\n }\n\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined\n }\n\n isStaleByTime(staleTime = 0): boolean {\n return (\n this.state.isInvalidated ||\n this.state.data === undefined ||\n !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n )\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `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']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: this.queryKey,\n meta: this.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn as QueryFunction,\n queryFnContext as QueryFunctionContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext as QueryFunctionContext)\n }\n\n // Trigger behavior hook\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n\n this.options.behavior?.onFetch(\n context as FetchContext,\n this as unknown as Query,\n )\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n const onError = (error: TError | { silent?: boolean }) => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n }\n\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n onError(new Error(`${this.queryHash} data is undefined`) as any)\n return\n }\n\n try {\n this.setData(data)\n } catch (error) {\n onError(error as TError)\n return\n }\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n\n // Schedule query gc after fetching\n this.scheduleGc()\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n return this.#retryer.start()\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n case 'error':\n const error = action.error\n\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: 'idle' }\n }\n\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? (options.initialDataUpdatedAt as () => number | undefined)()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":"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","names":["_a","_b","_c"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.d.cts b/node_modules/@tanstack/query-core/build/legacy/query.d.cts deleted file mode 100644 index 7421e44321ef2b6e6372b0e656d9a43b31ce6b00..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.cjs'; -export { b3 as Action, a$ as FetchContext, b0 as FetchDirection, b1 as FetchMeta, b2 as FetchOptions, u as Query, aZ as QueryBehavior, t as QueryState, b4 as SetStateOptions, b5 as fetchState } from './hydration-BXpkOXt5.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/query.d.ts b/node_modules/@tanstack/query-core/build/legacy/query.d.ts deleted file mode 100644 index 3ec6a1b2f17d630bf1b69b783c5d0783310f148b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.js'; -export { b3 as Action, a$ as FetchContext, b0 as FetchDirection, b1 as FetchMeta, b2 as FetchOptions, u as Query, aZ as QueryBehavior, t as QueryState, b4 as SetStateOptions, b5 as fetchState } from './hydration-mKPlgzt9.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/query.js b/node_modules/@tanstack/query-core/build/legacy/query.js deleted file mode 100644 index 90a75e647cd9f9a7911cb16d4bc253b1d1a7ed28..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.js +++ /dev/null @@ -1,409 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/query.ts -import { - ensureQueryFn, - noop, - replaceData, - resolveEnabled, - skipToken, - timeUntilStale -} from "./utils.js"; -import { notifyManager } from "./notifyManager.js"; -import { canFetch, createRetryer, isCancelledError } from "./retryer.js"; -import { Removable } from "./removable.js"; -var _initialState, _revertState, _cache, _retryer, _defaultOptions, _abortSignalConsumed, _dispatch, dispatch_fn; -var Query = class extends Removable { - constructor(config) { - super(); - __privateAdd(this, _dispatch); - __privateAdd(this, _initialState, void 0); - __privateAdd(this, _revertState, void 0); - __privateAdd(this, _cache, void 0); - __privateAdd(this, _retryer, void 0); - __privateAdd(this, _defaultOptions, void 0); - __privateAdd(this, _abortSignalConsumed, void 0); - __privateSet(this, _abortSignalConsumed, false); - __privateSet(this, _defaultOptions, config.defaultOptions); - this.setOptions(config.options); - this.observers = []; - __privateSet(this, _cache, config.cache); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - __privateSet(this, _initialState, getDefaultState(this.options)); - this.state = config.state ?? __privateGet(this, _initialState); - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - var _a; - return (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - } - setOptions(options) { - this.options = { ...__privateGet(this, _defaultOptions), ...options }; - this.updateGcTime(this.options.gcTime); - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - __privateGet(this, _cache).remove(this); - } - } - setData(newData, options) { - const data = replaceData(this.state.data, newData, this.options); - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - data, - type: "success", - dataUpdatedAt: options == null ? void 0 : options.updatedAt, - manual: options == null ? void 0 : options.manual - }); - return data; - } - setState(state, setStateOptions) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); - } - cancel(options) { - var _a, _b; - const promise = (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); - return promise ? promise.then(noop).catch(noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(__privateGet(this, _initialState)); - } - isActive() { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStale() { - if (this.state.isInvalidated) { - return true; - } - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0; - } - isStaleByTime(staleTime = 0) { - return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - onOnline() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (__privateGet(this, _retryer)) { - if (__privateGet(this, _abortSignalConsumed)) { - __privateGet(this, _retryer).cancel({ revert: true }); - } else { - __privateGet(this, _retryer).cancelRetry(); - } - } - this.scheduleGc(); - } - __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "invalidate" }); - } - } - fetch(options, fetchOptions) { - var _a, _b, _c; - if (this.state.fetchStatus !== "idle") { - if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { - this.cancel({ silent: true }); - } else if (__privateGet(this, _retryer)) { - __privateGet(this, _retryer).continueRetry(); - return __privateGet(this, _retryer).promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - __privateSet(this, _abortSignalConsumed, true); - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions); - const queryFnContext = { - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext); - __privateSet(this, _abortSignalConsumed, false); - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const context = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - state: this.state, - fetchFn - }; - addSignalProperty(context); - (_a = this.options.behavior) == null ? void 0 : _a.onFetch( - context, - this - ); - __privateSet(this, _revertState, this.state); - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_b = context.fetchOptions) == null ? void 0 : _b.meta)) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "fetch", meta: (_c = context.fetchOptions) == null ? void 0 : _c.meta }); - } - const onError = (error) => { - var _a2, _b2, _c2, _d; - if (!(isCancelledError(error) && error.silent)) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - type: "error", - error - }); - } - if (!isCancelledError(error)) { - (_b2 = (_a2 = __privateGet(this, _cache).config).onError) == null ? void 0 : _b2.call( - _a2, - error, - this - ); - (_d = (_c2 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d.call( - _c2, - this.state.data, - error, - this - ); - } - this.scheduleGc(); - }; - __privateSet(this, _retryer, createRetryer({ - initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, - fn: context.fetchFn, - abort: abortController.abort.bind(abortController), - onSuccess: (data) => { - var _a2, _b2, _c2, _d; - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - onError(new Error(`${this.queryHash} data is undefined`)); - return; - } - try { - this.setData(data); - } catch (error) { - onError(error); - return; - } - (_b2 = (_a2 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b2.call(_a2, data, this); - (_d = (_c2 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d.call( - _c2, - data, - this.state.error, - this - ); - this.scheduleGc(); - }, - onError, - onFail: (failureCount, error) => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - })); - return __privateGet(this, _retryer).start(); - } -}; -_initialState = new WeakMap(); -_revertState = new WeakMap(); -_cache = new WeakMap(); -_retryer = new WeakMap(); -_defaultOptions = new WeakMap(); -_abortSignalConsumed = new WeakMap(); -_dispatch = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - return { - ...state, - data: action.data, - dataUpdateCount: state.dataUpdateCount + 1, - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success", - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - case "error": - const error = action.error; - if (isCancelledError(error) && error.revert && __privateGet(this, _revertState)) { - return { ...__privateGet(this, _revertState), fetchStatus: "idle" }; - } - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error" - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - __privateGet(this, _cache).notify({ query: this, type: "updated", action }); - }); -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -export { - Query, - fetchState -}; -//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.js.map b/node_modules/@tanstack/query-core/build/legacy/query.js.map deleted file mode 100644 index 9059cd0318c5eadbb22370787e8c542b92b2533c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { canFetch, createRetryer, isCancelledError } from './retryer'\nimport { Removable } from './removable'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n} from './types'\nimport type { QueryCache } from './queryCache'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n cache: QueryCache\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#cache = config.cache\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStale(): boolean {\n if (this.state.isInvalidated) {\n return true\n }\n\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined\n }\n\n isStaleByTime(staleTime = 0): boolean {\n return (\n this.state.isInvalidated ||\n this.state.data === undefined ||\n !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n )\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `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']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: this.queryKey,\n meta: this.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn as QueryFunction,\n queryFnContext as QueryFunctionContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext as QueryFunctionContext)\n }\n\n // Trigger behavior hook\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n\n this.options.behavior?.onFetch(\n context as FetchContext,\n this as unknown as Query,\n )\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n const onError = (error: TError | { silent?: boolean }) => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n }\n\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n onError(new Error(`${this.queryHash} data is undefined`) as any)\n return\n }\n\n try {\n this.setData(data)\n } catch (error) {\n onError(error as TError)\n return\n }\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n\n // Schedule query gc after fetching\n this.scheduleGc()\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n return this.#retryer.start()\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n case 'error':\n const error = action.error\n\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: 'idle' }\n }\n\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? (options.initialDataUpdatedAt as () => number | undefined)()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":"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","names":["_a","_b","_c"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map deleted file mode 100644 index 72d6bdb51f2f93170f94e238c6c8ff12ad653ec3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkD;AAClD,mBAAsB;AACtB,2BAA8B;AAC9B,0BAA6B;AAH7B;AA2FO,IAAM,aAAN,cAAyB,iCAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAFnB;AAIE,uBAAK,UAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EAEA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,iBAAa,oCAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,mBAAM;AAAA,QAChB,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,OAAwC;AAC1C,QAAI,CAAC,mBAAK,UAAS,IAAI,MAAM,SAAS,GAAG;AACvC,yBAAK,UAAS,IAAI,MAAM,WAAW,KAAK;AAExC,WAAK,OAAO;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,OAAO,OAAwC;AAC7C,UAAM,aAAa,mBAAK,UAAS,IAAI,MAAM,SAAS;AAEpD,QAAI,YAAY;AACd,YAAM,QAAQ;AAEd,UAAI,eAAe,OAAO;AACxB,2BAAK,UAAS,OAAO,MAAM,SAAS;AAAA,MACtC;AAEA,WAAK,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACxC;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,aAAK,OAAO,KAAK;AAAA,MACnB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,IAME,WAC2D;AAC3D,WAAO,mBAAK,UAAS,IAAI,SAAS;AAAA,EAGpC;AAAA,EAEA,SAAuB;AACrB,WAAO,CAAC,GAAG,mBAAK,UAAS,OAAO,CAAC;AAAA,EACnC;AAAA,EAEA,KACE,SACgD;AAChD,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,cACzB,yBAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAAwB,CAAC,GAAiB;AAChD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,cAAU,yBAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAlIE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts deleted file mode 100644 index 1efcf0a487f1265a41c8f913670fdcb478b57493..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { Q as QueryCache, a as QueryCacheNotifyEvent, bn as QueryStore } from './hydration-BXpkOXt5.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.js b/node_modules/@tanstack/query-core/build/legacy/queryCache.js deleted file mode 100644 index 4cb7e28e706b2da8095b3c33f67e99bdc1caf098..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.js +++ /dev/null @@ -1,105 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/queryCache.ts -import { hashQueryKeyByOptions, matchQuery } from "./utils.js"; -import { Query } from "./query.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -var _queries; -var QueryCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - __privateAdd(this, _queries, void 0); - __privateSet(this, _queries, /* @__PURE__ */ new Map()); - } - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new Query({ - cache: this, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!__privateGet(this, _queries).has(query.queryHash)) { - __privateGet(this, _queries).set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = __privateGet(this, _queries).get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - __privateGet(this, _queries).delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return __privateGet(this, _queries).get(queryHash); - } - getAll() { - return [...__privateGet(this, _queries).values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => matchQuery(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; -_queries = new WeakMap(); -export { - QueryCache -}; -//# sourceMappingURL=queryCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map b/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map deleted file mode 100644 index 854c3a540b487cf1455b504377b3f21bd60299a7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAH7B;AA2FO,IAAM,aAAN,cAAyB,aAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAFnB;AAIE,uBAAK,UAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EAEA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,aAAa,sBAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,MAAM;AAAA,QAChB,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,OAAwC;AAC1C,QAAI,CAAC,mBAAK,UAAS,IAAI,MAAM,SAAS,GAAG;AACvC,yBAAK,UAAS,IAAI,MAAM,WAAW,KAAK;AAExC,WAAK,OAAO;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,OAAO,OAAwC;AAC7C,UAAM,aAAa,mBAAK,UAAS,IAAI,MAAM,SAAS;AAEpD,QAAI,YAAY;AACd,YAAM,QAAQ;AAEd,UAAI,eAAe,OAAO;AACxB,2BAAK,UAAS,OAAO,MAAM,SAAS;AAAA,MACtC;AAEA,WAAK,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACxC;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,aAAK,OAAO,KAAK;AAAA,MACnB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,IAME,WAC2D;AAC3D,WAAO,mBAAK,UAAS,IAAI,SAAS;AAAA,EAGpC;AAAA,EAEA,SAAuB;AACrB,WAAO,CAAC,GAAG,mBAAK,UAAS,OAAO,CAAC;AAAA,EACnC;AAAA,EAEA,KACE,SACgD;AAChD,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,UACzB,WAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAAwB,CAAC,GAAiB;AAChD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,UAAU,WAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,kBAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAlIE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs deleted file mode 100644 index 598144427bd1b56def65039c832a8ec06876b425..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs +++ /dev/null @@ -1,350 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); - -// src/queryClient.ts -var queryClient_exports = {}; -__export(queryClient_exports, { - QueryClient: () => QueryClient -}); -module.exports = __toCommonJS(queryClient_exports); -var import_utils = require("./utils.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; -var QueryClient = class { - constructor(config = {}) { - __privateAdd(this, _queryCache, void 0); - __privateAdd(this, _mutationCache, void 0); - __privateAdd(this, _defaultOptions, void 0); - __privateAdd(this, _queryDefaults, void 0); - __privateAdd(this, _mutationDefaults, void 0); - __privateAdd(this, _mountCount, void 0); - __privateAdd(this, _unsubscribeFocus, void 0); - __privateAdd(this, _unsubscribeOnline, void 0); - __privateSet(this, _queryCache, config.queryCache || new import_queryCache.QueryCache()); - __privateSet(this, _mutationCache, config.mutationCache || new import_mutationCache.MutationCache()); - __privateSet(this, _defaultOptions, config.defaultOptions || {}); - __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mountCount, 0); - } - mount() { - __privateWrapper(this, _mountCount)._++; - if (__privateGet(this, _mountCount) !== 1) - return; - __privateSet(this, _unsubscribeFocus, import_focusManager.focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onFocus(); - } - })); - __privateSet(this, _unsubscribeOnline, import_onlineManager.onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onOnline(); - } - })); - } - unmount() { - var _a, _b; - __privateWrapper(this, _mountCount)._--; - if (__privateGet(this, _mountCount) !== 0) - return; - (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); - __privateSet(this, _unsubscribeFocus, void 0); - (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); - __privateSet(this, _unsubscribeOnline, void 0); - } - isFetching(filters) { - return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; - } - getQueryData(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; - } - ensureQueryData(options) { - const cachedData = this.getQueryData(options.queryKey); - if (cachedData === void 0) - return this.fetchQuery(options); - else { - const defaultedOptions = this.defaultQueryOptions(options); - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - } - getQueriesData(filters) { - return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = __privateGet(this, _queryCache).get( - defaultedOptions.queryHash - ); - const prevData = query == null ? void 0 : query.state.data; - const data = (0, import_utils.functionalUpdate)(updater, prevData); - if (data === void 0) { - return void 0; - } - return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return import_notifyManager.notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state; - } - removeQueries(filters) { - const queryCache = __privateGet(this, _queryCache); - import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = __privateGet(this, _queryCache); - const refetchFilters = { - type: "active", - ...filters - }; - return import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries(refetchFilters, options); - }); - } - cancelQueries(filters = {}, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = import_notifyManager.notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); - } - invalidateQueries(filters = {}, options = {}) { - return import_notifyManager.notifyManager.batch(() => { - __privateGet(this, _queryCache).findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters.refetchType === "none") { - return Promise.resolve(); - } - const refetchFilters = { - ...filters, - type: filters.refetchType ?? filters.type ?? "active" - }; - return this.refetchQueries(refetchFilters, options); - }); - } - refetchQueries(filters = {}, options) { - const fetchOptions = { - ...options, - cancelRefetch: (options == null ? void 0 : options.cancelRefetch) ?? true - }; - const promises = import_notifyManager.notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(import_utils.noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(import_utils.noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - return query.isStaleByTime( - (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - fetchInfiniteQuery(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - ensureInfiniteQueryData(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (import_onlineManager.onlineManager.isOnline()) { - return __privateGet(this, _mutationCache).resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return __privateGet(this, _queryCache); - } - getMutationCache() { - return __privateGet(this, _mutationCache); - } - getDefaultOptions() { - return __privateGet(this, _defaultOptions); - } - setDefaultOptions(options) { - __privateSet(this, _defaultOptions, options); - } - setQueryDefaults(queryKey, options) { - __privateGet(this, _queryDefaults).set((0, import_utils.hashKey)(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...__privateGet(this, _queryDefaults).values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - __privateGet(this, _mutationDefaults).set((0, import_utils.hashKey)(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...__privateGet(this, _mutationDefaults).values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...__privateGet(this, _defaultOptions).queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === import_utils.skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options == null ? void 0 : options._defaulted) { - return options; - } - return { - ...__privateGet(this, _defaultOptions).mutations, - ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - __privateGet(this, _queryCache).clear(); - __privateGet(this, _mutationCache).clear(); - } -}; -_queryCache = new WeakMap(); -_mutationCache = new WeakMap(); -_defaultOptions = new WeakMap(); -_queryDefaults = new WeakMap(); -_mutationDefaults = new WeakMap(); -_mountCount = new WeakMap(); -_unsubscribeFocus = new WeakMap(); -_unsubscribeOnline = new WeakMap(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClient -}); -//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map deleted file mode 100644 index 7186ceffe239097c00d38a206c4a31b94a38417f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DataTag,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching(filters?: QueryFilters): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating(filters?: MutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined\n getQueryData(queryKey: QueryKey) {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)?.state.data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const cachedData = this.getQueryData(options.queryKey)\n\n if (cachedData === undefined) return this.fetchQuery(options)\n else {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n }\n\n getQueriesData(\n filters: QueryFilters,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): TInferredQueryFnData | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData(\n filters: QueryFilters,\n updater: Updater,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)\n ?.state\n }\n\n removeQueries(filters?: QueryFilters): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise {\n const queryCache = this.#queryCache\n\n const refetchFilters: RefetchQueryFilters = {\n type: 'active',\n ...filters,\n }\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n cancelQueries(\n filters: QueryFilters = {},\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters: InvalidateQueryFilters = {},\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters.refetchType === 'none') {\n return Promise.resolve()\n }\n const refetchFilters: RefetchQueryFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? 'active',\n }\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n refetchQueries(\n filters: RefetchQueryFilters = {},\n options?: RefetchOptions,\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n let result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): MutationObserverOptions {\n const defaults = [...this.#mutationDefaults.values()]\n\n let result: MutationObserverOptions = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (\n defaultedOptions.enabled !== true &&\n defaultedOptions.queryFn === skipToken\n ) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts deleted file mode 100644 index b6bafe2bcce5392ffdd145afdee6d9f3f6f4cc98..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { b as QueryClient } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.js b/node_modules/@tanstack/query-core/build/legacy/queryClient.js deleted file mode 100644 index 746cd112589d692da80fe86288167750b821ad36..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.js +++ /dev/null @@ -1,314 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet, - __privateWrapper -} from "./chunk-2HYBKCYP.js"; - -// src/queryClient.ts -import { - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - noop, - partialMatchKey, - resolveStaleTime, - skipToken -} from "./utils.js"; -import { QueryCache } from "./queryCache.js"; -import { MutationCache } from "./mutationCache.js"; -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { notifyManager } from "./notifyManager.js"; -import { infiniteQueryBehavior } from "./infiniteQueryBehavior.js"; -var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; -var QueryClient = class { - constructor(config = {}) { - __privateAdd(this, _queryCache, void 0); - __privateAdd(this, _mutationCache, void 0); - __privateAdd(this, _defaultOptions, void 0); - __privateAdd(this, _queryDefaults, void 0); - __privateAdd(this, _mutationDefaults, void 0); - __privateAdd(this, _mountCount, void 0); - __privateAdd(this, _unsubscribeFocus, void 0); - __privateAdd(this, _unsubscribeOnline, void 0); - __privateSet(this, _queryCache, config.queryCache || new QueryCache()); - __privateSet(this, _mutationCache, config.mutationCache || new MutationCache()); - __privateSet(this, _defaultOptions, config.defaultOptions || {}); - __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mountCount, 0); - } - mount() { - __privateWrapper(this, _mountCount)._++; - if (__privateGet(this, _mountCount) !== 1) - return; - __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onFocus(); - } - })); - __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onOnline(); - } - })); - } - unmount() { - var _a, _b; - __privateWrapper(this, _mountCount)._--; - if (__privateGet(this, _mountCount) !== 0) - return; - (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); - __privateSet(this, _unsubscribeFocus, void 0); - (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); - __privateSet(this, _unsubscribeOnline, void 0); - } - isFetching(filters) { - return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; - } - getQueryData(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; - } - ensureQueryData(options) { - const cachedData = this.getQueryData(options.queryKey); - if (cachedData === void 0) - return this.fetchQuery(options); - else { - const defaultedOptions = this.defaultQueryOptions(options); - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - } - getQueriesData(filters) { - return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = __privateGet(this, _queryCache).get( - defaultedOptions.queryHash - ); - const prevData = query == null ? void 0 : query.state.data; - const data = functionalUpdate(updater, prevData); - if (data === void 0) { - return void 0; - } - return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state; - } - removeQueries(filters) { - const queryCache = __privateGet(this, _queryCache); - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = __privateGet(this, _queryCache); - const refetchFilters = { - type: "active", - ...filters - }; - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries(refetchFilters, options); - }); - } - cancelQueries(filters = {}, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(noop).catch(noop); - } - invalidateQueries(filters = {}, options = {}) { - return notifyManager.batch(() => { - __privateGet(this, _queryCache).findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters.refetchType === "none") { - return Promise.resolve(); - } - const refetchFilters = { - ...filters, - type: filters.refetchType ?? filters.type ?? "active" - }; - return this.refetchQueries(refetchFilters, options); - }); - } - refetchQueries(filters = {}, options) { - const fetchOptions = { - ...options, - cancelRefetch: (options == null ? void 0 : options.cancelRefetch) ?? true - }; - const promises = notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(noop).catch(noop); - } - fetchInfiniteQuery(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(noop).catch(noop); - } - ensureInfiniteQueryData(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (onlineManager.isOnline()) { - return __privateGet(this, _mutationCache).resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return __privateGet(this, _queryCache); - } - getMutationCache() { - return __privateGet(this, _mutationCache); - } - getDefaultOptions() { - return __privateGet(this, _defaultOptions); - } - setDefaultOptions(options) { - __privateSet(this, _defaultOptions, options); - } - setQueryDefaults(queryKey, options) { - __privateGet(this, _queryDefaults).set(hashKey(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...__privateGet(this, _queryDefaults).values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...__privateGet(this, _mutationDefaults).values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...__privateGet(this, _defaultOptions).queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options == null ? void 0 : options._defaulted) { - return options; - } - return { - ...__privateGet(this, _defaultOptions).mutations, - ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - __privateGet(this, _queryCache).clear(); - __privateGet(this, _mutationCache).clear(); - } -}; -_queryCache = new WeakMap(); -_mutationCache = new WeakMap(); -_defaultOptions = new WeakMap(); -_queryDefaults = new WeakMap(); -_mutationDefaults = new WeakMap(); -_mountCount = new WeakMap(); -_unsubscribeFocus = new WeakMap(); -_unsubscribeOnline = new WeakMap(); -export { - QueryClient -}; -//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map b/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map deleted file mode 100644 index 6b758a7de5cc134e88234f41b05cb9b01fc3c804..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DataTag,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching(filters?: QueryFilters): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating(filters?: MutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined\n getQueryData(queryKey: QueryKey) {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)?.state.data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const cachedData = this.getQueryData(options.queryKey)\n\n if (cachedData === undefined) return this.fetchQuery(options)\n else {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n }\n\n getQueriesData(\n filters: QueryFilters,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): TInferredQueryFnData | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData(\n filters: QueryFilters,\n updater: Updater,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)\n ?.state\n }\n\n removeQueries(filters?: QueryFilters): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise {\n const queryCache = this.#queryCache\n\n const refetchFilters: RefetchQueryFilters = {\n type: 'active',\n ...filters,\n }\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n cancelQueries(\n filters: QueryFilters = {},\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters: InvalidateQueryFilters = {},\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters.refetchType === 'none') {\n return Promise.resolve()\n }\n const refetchFilters: RefetchQueryFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? 'active',\n }\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n refetchQueries(\n filters: RefetchQueryFilters = {},\n options?: RefetchOptions,\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n let result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): MutationObserverOptions {\n const defaults = [...this.#mutationDefaults.values()]\n\n let result: MutationObserverOptions = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (\n defaultedOptions.enabled !== true &&\n defaultedOptions.queryFn === skipToken\n ) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs deleted file mode 100644 index 045d0044b5451aa1cc5731b0bb0c6a67bd8130ef..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs +++ /dev/null @@ -1,553 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -// src/queryObserver.ts -var queryObserver_exports = {}; -__export(queryObserver_exports, { - QueryObserver: () => QueryObserver -}); -module.exports = __toCommonJS(queryObserver_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_query = require("./query.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _executeFetch, executeFetch_fn, _updateStaleTimeout, updateStaleTimeout_fn, _computeRefetchInterval, computeRefetchInterval_fn, _updateRefetchInterval, updateRefetchInterval_fn, _updateTimers, updateTimers_fn, _clearStaleTimeout, clearStaleTimeout_fn, _clearRefetchInterval, clearRefetchInterval_fn, _updateQuery, updateQuery_fn, _notify, notify_fn; -var QueryObserver = class extends import_subscribable.Subscribable { - constructor(client, options) { - super(); - this.options = options; - __privateAdd(this, _executeFetch); - __privateAdd(this, _updateStaleTimeout); - __privateAdd(this, _computeRefetchInterval); - __privateAdd(this, _updateRefetchInterval); - __privateAdd(this, _updateTimers); - __privateAdd(this, _clearStaleTimeout); - __privateAdd(this, _clearRefetchInterval); - __privateAdd(this, _updateQuery); - __privateAdd(this, _notify); - __privateAdd(this, _client, void 0); - __privateAdd(this, _currentQuery, void 0); - __privateAdd(this, _currentQueryInitialState, void 0); - __privateAdd(this, _currentResult, void 0); - __privateAdd(this, _currentResultState, void 0); - __privateAdd(this, _currentResultOptions, void 0); - __privateAdd(this, _currentThenable, void 0); - __privateAdd(this, _selectError, void 0); - __privateAdd(this, _selectFn, void 0); - __privateAdd(this, _selectResult, void 0); - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - __privateAdd(this, _lastQueryWithDefinedData, void 0); - __privateAdd(this, _staleTimeoutId, void 0); - __privateAdd(this, _refetchIntervalId, void 0); - __privateAdd(this, _currentRefetchInterval, void 0); - __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); - __privateSet(this, _client, client); - __privateSet(this, _selectError, null); - __privateSet(this, _currentThenable, (0, import_thenable.pendingThenable)()); - if (!this.options.experimental_prefetchInRender) { - __privateGet(this, _currentThenable).reject( - new Error("experimental_prefetchInRender feature flag is not enabled") - ); - } - this.bindMethods(); - this.setOptions(options); - } - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - __privateGet(this, _currentQuery).addObserver(this); - if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { - __privateMethod(this, _executeFetch, executeFetch_fn).call(this); - } else { - this.updateResult(); - } - __privateMethod(this, _updateTimers, updateTimers_fn).call(this); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - __privateGet(this, _currentQuery), - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - __privateGet(this, _currentQuery), - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - __privateMethod(this, _clearStaleTimeout, clearStaleTimeout_fn).call(this); - __privateMethod(this, _clearRefetchInterval, clearRefetchInterval_fn).call(this); - __privateGet(this, _currentQuery).removeObserver(this); - } - setOptions(options, notifyOptions) { - const prevOptions = this.options; - const prevQuery = __privateGet(this, _currentQuery); - this.options = __privateGet(this, _client).defaultQueryOptions(options); - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { - throw new Error( - "Expected enabled to be a boolean or a callback that returns a boolean" - ); - } - __privateMethod(this, _updateQuery, updateQuery_fn).call(this); - __privateGet(this, _currentQuery).setOptions(this.options); - if (prevOptions._defaulted && !(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - __privateGet(this, _client).getQueryCache().notify({ - type: "observerOptionsUpdated", - query: __privateGet(this, _currentQuery), - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - __privateGet(this, _currentQuery), - prevQuery, - this.options, - prevOptions - )) { - __privateMethod(this, _executeFetch, executeFetch_fn).call(this); - } - this.updateResult(notifyOptions); - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, __privateGet(this, _currentQuery)) || (0, import_utils.resolveStaleTime)(this.options.staleTime, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveStaleTime)(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { - __privateMethod(this, _updateStaleTimeout, updateStaleTimeout_fn).call(this); - } - const nextRefetchInterval = __privateMethod(this, _computeRefetchInterval, computeRefetchInterval_fn).call(this); - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { - __privateMethod(this, _updateRefetchInterval, updateRefetchInterval_fn).call(this, nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - __privateSet(this, _currentResult, result); - __privateSet(this, _currentResultOptions, this.options); - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); - } - return result; - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - trackResult(result, onPropTracked) { - const trackedResult = {}; - Object.keys(result).forEach((key) => { - Object.defineProperty(trackedResult, key, { - configurable: false, - enumerable: true, - get: () => { - this.trackProp(key); - onPropTracked == null ? void 0 : onPropTracked(key); - return result[key]; - } - }); - }); - return trackedResult; - } - trackProp(key) { - __privateGet(this, _trackedProps).add(key); - } - getCurrentQuery() { - return __privateGet(this, _currentQuery); - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return __privateMethod(this, _executeFetch, executeFetch_fn).call(this, { - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return __privateGet(this, _currentResult); - }); - } - createResult(query, options) { - var _a; - const prevQuery = __privateGet(this, _currentQuery); - const prevOptions = this.options; - const prevResult = __privateGet(this, _currentResult); - const prevResultState = __privateGet(this, _currentResultState); - const prevResultOptions = __privateGet(this, _currentResultOptions); - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...(0, import_query.fetchState)(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - if (options.select && newState.data !== void 0) { - if (prevResult && newState.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { - data = __privateGet(this, _selectResult); - } else { - try { - __privateSet(this, _selectFn, options.select); - data = options.select(newState.data); - data = (0, import_utils.replaceData)(prevResult == null ? void 0 : prevResult.data, data, options); - __privateSet(this, _selectResult, data); - __privateSet(this, _selectError, null); - } catch (selectError) { - __privateSet(this, _selectError, selectError); - } - } - } else { - data = newState.data; - } - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { - placeholderData = prevResult.data; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - (_a = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a.state.data, - __privateGet(this, _lastQueryWithDefinedData) - ) : options.placeholderData; - if (options.select && placeholderData !== void 0) { - try { - placeholderData = options.select(placeholderData); - __privateSet(this, _selectError, null); - } catch (selectError) { - __privateSet(this, _selectError, selectError); - } - } - } - if (placeholderData !== void 0) { - status = "success"; - data = (0, import_utils.replaceData)( - prevResult == null ? void 0 : prevResult.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (__privateGet(this, _selectError)) { - error = __privateGet(this, _selectError); - data = __privateGet(this, _selectResult); - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: __privateGet(this, _currentThenable) - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const finalizeThenableIfPossible = (thenable) => { - if (nextResult.status === "error") { - thenable.reject(nextResult.error); - } else if (nextResult.data !== void 0) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = __privateSet(this, _currentThenable, nextResult.promise = (0, import_thenable.pendingThenable)()); - finalizeThenableIfPossible(pending); - }; - const prevThenable = __privateGet(this, _currentThenable); - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (nextResult.status === "error" || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult(notifyOptions) { - const prevResult = __privateGet(this, _currentResult); - const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); - __privateSet(this, _currentResultOptions, this.options); - if (__privateGet(this, _currentResultState).data !== void 0) { - __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); - } - if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { - return; - } - __privateSet(this, _currentResult, nextResult); - const defaultNotifyOptions = {}; - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? __privateGet(this, _trackedProps) - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(__privateGet(this, _currentResult)).some((key) => { - const typedKey = key; - const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && shouldNotifyListeners()) { - defaultNotifyOptions.listeners = true; - } - __privateMethod(this, _notify, notify_fn).call(this, { ...defaultNotifyOptions, ...notifyOptions }); - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - __privateMethod(this, _updateTimers, updateTimers_fn).call(this); - } - } -}; -_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(); -_executeFetch = new WeakSet(); -executeFetch_fn = function(fetchOptions) { - __privateMethod(this, _updateQuery, updateQuery_fn).call(this); - let promise = __privateGet(this, _currentQuery).fetch( - this.options, - fetchOptions - ); - if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { - promise = promise.catch(import_utils.noop); - } - return promise; -}; -_updateStaleTimeout = new WeakSet(); -updateStaleTimeout_fn = function() { - __privateMethod(this, _clearStaleTimeout, clearStaleTimeout_fn).call(this); - const staleTime = (0, import_utils.resolveStaleTime)( - this.options.staleTime, - __privateGet(this, _currentQuery) - ); - if (import_utils.isServer || __privateGet(this, _currentResult).isStale || !(0, import_utils.isValidTimeout)(staleTime)) { - return; - } - const time = (0, import_utils.timeUntilStale)(__privateGet(this, _currentResult).dataUpdatedAt, staleTime); - const timeout = time + 1; - __privateSet(this, _staleTimeoutId, setTimeout(() => { - if (!__privateGet(this, _currentResult).isStale) { - this.updateResult(); - } - }, timeout)); -}; -_computeRefetchInterval = new WeakSet(); -computeRefetchInterval_fn = function() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false; -}; -_updateRefetchInterval = new WeakSet(); -updateRefetchInterval_fn = function(nextInterval) { - __privateMethod(this, _clearRefetchInterval, clearRefetchInterval_fn).call(this); - __privateSet(this, _currentRefetchInterval, nextInterval); - if (import_utils.isServer || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) === false || !(0, import_utils.isValidTimeout)(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) { - return; - } - __privateSet(this, _refetchIntervalId, setInterval(() => { - if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { - __privateMethod(this, _executeFetch, executeFetch_fn).call(this); - } - }, __privateGet(this, _currentRefetchInterval))); -}; -_updateTimers = new WeakSet(); -updateTimers_fn = function() { - __privateMethod(this, _updateStaleTimeout, updateStaleTimeout_fn).call(this); - __privateMethod(this, _updateRefetchInterval, updateRefetchInterval_fn).call(this, __privateMethod(this, _computeRefetchInterval, computeRefetchInterval_fn).call(this)); -}; -_clearStaleTimeout = new WeakSet(); -clearStaleTimeout_fn = function() { - if (__privateGet(this, _staleTimeoutId)) { - clearTimeout(__privateGet(this, _staleTimeoutId)); - __privateSet(this, _staleTimeoutId, void 0); - } -}; -_clearRefetchInterval = new WeakSet(); -clearRefetchInterval_fn = function() { - if (__privateGet(this, _refetchIntervalId)) { - clearInterval(__privateGet(this, _refetchIntervalId)); - __privateSet(this, _refetchIntervalId, void 0); - } -}; -_updateQuery = new WeakSet(); -updateQuery_fn = function() { - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); - if (query === __privateGet(this, _currentQuery)) { - return; - } - const prevQuery = __privateGet(this, _currentQuery); - __privateSet(this, _currentQuery, query); - __privateSet(this, _currentQueryInitialState, query.state); - if (this.hasListeners()) { - prevQuery == null ? void 0 : prevQuery.removeObserver(this); - query.addObserver(this); - } -}; -_notify = new WeakSet(); -notify_fn = function(notifyOptions) { - import_notifyManager.notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - } - __privateGet(this, _client).getQueryCache().notify({ - query: __privateGet(this, _currentQuery), - type: "observerResultsUpdated" - }); - }); -}; -function shouldLoadOnMount(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if ((0, import_utils.resolveEnabled)(options.enabled, query) !== false) { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || (0, import_utils.resolveEnabled)(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.isStaleByTime((0, import_utils.resolveStaleTime)(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryObserver -}); -//# sourceMappingURL=queryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts deleted file mode 100644 index 919ac9c8b515827af0c763180dc667be6c507759..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { a_ as NotifyOptions, c as QueryObserver } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts deleted file mode 100644 index c8e840c3a83e51fc68c39a781d5208a2b574baac..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { a_ as NotifyOptions, c as QueryObserver } from './hydration-mKPlgzt9.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.cjs b/node_modules/@tanstack/query-core/build/legacy/removable.cjs deleted file mode 100644 index 2c4e72bcc906a4334b8078fcd955e9c575df2b12..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.cjs +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; - -// src/removable.ts -var removable_exports = {}; -__export(removable_exports, { - Removable: () => Removable -}); -module.exports = __toCommonJS(removable_exports); -var import_utils = require("./utils.cjs"); -var _gcTimeout; -var Removable = class { - constructor() { - __privateAdd(this, _gcTimeout, void 0); - } - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if ((0, import_utils.isValidTimeout)(this.gcTime)) { - __privateSet(this, _gcTimeout, setTimeout(() => { - this.optionalRemove(); - }, this.gcTime)); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (__privateGet(this, _gcTimeout)) { - clearTimeout(__privateGet(this, _gcTimeout)); - __privateSet(this, _gcTimeout, void 0); - } - } -}; -_gcTimeout = new WeakMap(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Removable -}); -//# sourceMappingURL=removable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map deleted file mode 100644 index 62afb2b0053561f338e4cae42089009a5a1448b2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { isServer, isValidTimeout } from './utils'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ReturnType\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyC;AAAzC;AAEO,IAAe,YAAf,MAAyB;AAAA,EAAzB;AAEL;AAAA;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,YAAI,6BAAe,KAAK,MAAM,GAAG;AAC/B,yBAAK,YAAa,WAAW,MAAM;AACjC,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,wBAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,mBAAK,aAAY;AACnB,mBAAa,mBAAK,WAAU;AAC5B,yBAAK,YAAa;AAAA,IACpB;AAAA,EACF;AAGF;AAhCE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.d.ts b/node_modules/@tanstack/query-core/build/legacy/removable.d.ts deleted file mode 100644 index 7b825258ea2753c461f842634e60a9c4ae0f6f1f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare abstract class Removable { - #private; - gcTime: number; - destroy(): void; - protected scheduleGc(): void; - protected updateGcTime(newGcTime: number | undefined): void; - protected clearGcTimeout(): void; - protected abstract optionalRemove(): void; -} - -export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.js b/node_modules/@tanstack/query-core/build/legacy/removable.js deleted file mode 100644 index 9ba0e08795c9c45e60585f32cf76013752e3172d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.js +++ /dev/null @@ -1,42 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-2HYBKCYP.js"; - -// src/removable.ts -import { isServer, isValidTimeout } from "./utils.js"; -var _gcTimeout; -var Removable = class { - constructor() { - __privateAdd(this, _gcTimeout, void 0); - } - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if (isValidTimeout(this.gcTime)) { - __privateSet(this, _gcTimeout, setTimeout(() => { - this.optionalRemove(); - }, this.gcTime)); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (__privateGet(this, _gcTimeout)) { - clearTimeout(__privateGet(this, _gcTimeout)); - __privateSet(this, _gcTimeout, void 0); - } - } -}; -_gcTimeout = new WeakMap(); -export { - Removable -}; -//# sourceMappingURL=removable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs deleted file mode 100644 index 566f50d51b5ebb6905877d18bf9988cd2c69b65b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs +++ /dev/null @@ -1,169 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/retryer.ts -var retryer_exports = {}; -__export(retryer_exports, { - CancelledError: () => CancelledError, - canFetch: () => canFetch, - createRetryer: () => createRetryer, - isCancelledError: () => isCancelledError -}); -module.exports = __toCommonJS(retryer_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options == null ? void 0 : options.revert; - this.silent = options == null ? void 0 : options.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let isResolved = false; - let continueFn; - const thenable = (0, import_thenable.pendingThenable)(); - const cancel = (cancelOptions) => { - var _a; - if (!isResolved) { - reject(new CancelledError(cancelOptions)); - (_a = config.abort) == null ? void 0 : _a.call(config); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => import_focusManager.focusManager.isFocused() && (config.networkMode === "always" || import_onlineManager.onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - var _a; - if (!isResolved) { - isResolved = true; - (_a = config.onSuccess) == null ? void 0 : _a.call(config, value); - continueFn == null ? void 0 : continueFn(); - thenable.resolve(value); - } - }; - const reject = (value) => { - var _a; - if (!isResolved) { - isResolved = true; - (_a = config.onError) == null ? void 0 : _a.call(config, value); - continueFn == null ? void 0 : continueFn(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - var _a; - continueFn = (value) => { - if (isResolved || canContinue()) { - continueResolve(value); - } - }; - (_a = config.onPause) == null ? void 0 : _a.call(config); - }).then(() => { - var _a; - continueFn = void 0; - if (!isResolved) { - (_a = config.onContinue) == null ? void 0 : _a.call(config); - } - }); - }; - const run = () => { - if (isResolved) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - var _a; - if (isResolved) { - return; - } - const retry = config.retry ?? (import_utils.isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - (_a = config.onFail) == null ? void 0 : _a.call(config, failureCount, error); - (0, import_utils.sleep)(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - cancel, - continue: () => { - continueFn == null ? void 0 : continueFn(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - canFetch, - createRetryer, - isCancelledError -}); -//# sourceMappingURL=retryer.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map deleted file mode 100644 index 903110fbd569b9b5e79ffd8468c728a5c18475dd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n abort?: () => void\n onError?: (error: TError) => void\n onSuccess?: (data: TData) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let isResolved = false\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions))\n\n config.abort?.()\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onSuccess?.(value)\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onError?.(value)\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts b/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts deleted file mode 100644 index 07176a6f1c2a92e528d536fb6ffd608f98ae2353..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { C as CancelledError, bs as RetryDelayValue, br as RetryValue, bq as Retryer, bt as canFetch, bu as createRetryer, l as isCancelledError } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.js.map b/node_modules/@tanstack/query-core/build/legacy/retryer.js.map deleted file mode 100644 index b2e70c92f6e390ad4d985a5e601a36d4a40676b0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n abort?: () => void\n onError?: (error: TError) => void\n onSuccess?: (data: TData) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let isResolved = false\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions))\n\n config.abort?.()\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onSuccess?.(value)\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onError?.(value)\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs deleted file mode 100644 index c40260212a663cfe1429671865b8c9942db423ee..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/subscribable.ts -var subscribable_exports = {}; -__export(subscribable_exports, { - Subscribable: () => Subscribable -}); -module.exports = __toCommonJS(subscribable_exports); -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Subscribable -}); -//# sourceMappingURL=subscribable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map deleted file mode 100644 index 43f833686ac6b56783105e9e082b692fa09c5ed3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts deleted file mode 100644 index 5ac4d3d1d29a0dcca0fd226569f4e4996bda5f9d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare class Subscribable { - protected listeners: Set; - constructor(); - subscribe(listener: TListener): () => void; - hasListeners(): boolean; - protected onSubscribe(): void; - protected onUnsubscribe(): void; -} - -export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map b/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map deleted file mode 100644 index ae0fe0d4d4a830e025f63f51ea758ea16d72cdfc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs deleted file mode 100644 index ef17bd511b8a0e2f5df545913d846791ebdc4833..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/thenable.ts -var thenable_exports = {}; -__export(thenable_exports, { - pendingThenable: () => pendingThenable -}); -module.exports = __toCommonJS(thenable_exports); -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - pendingThenable -}); -//# sourceMappingURL=thenable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map deleted file mode 100644 index 5e0dd3fafcd754d752a9654ae2c8e9910150bf20..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCO,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.js b/node_modules/@tanstack/query-core/build/legacy/thenable.js deleted file mode 100644 index fc9df3e7809ff870add4d5133341e8e6190632ed..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.js +++ /dev/null @@ -1,38 +0,0 @@ -import "./chunk-2HYBKCYP.js"; - -// src/thenable.ts -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -export { - pendingThenable -}; -//# sourceMappingURL=thenable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.js.map b/node_modules/@tanstack/query-core/build/legacy/thenable.js.map deleted file mode 100644 index a881d9e388c76d708a42edf4e5e0d0bd951a8765..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n"],"mappings":";;;AAyCO,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.cjs b/node_modules/@tanstack/query-core/build/legacy/types.cjs deleted file mode 100644 index d22152bc67861f6fd334ace0ed3fdd09464cc941..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.cjs +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.d.cts b/node_modules/@tanstack/query-core/build/legacy/types.d.cts deleted file mode 100644 index 361fa747c732d1e4c8dbdcbd87d2aaa881fcf75f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { aV as CancelOptions, E as DataTag, z as DefaultError, aU as DefaultOptions, a9 as DefaultedInfiniteQueryObserverOptions, a7 as DefaultedQueryObserverOptions, aC as DefinedInfiniteQueryObserverResult, au as DefinedQueryObserverResult, I as Enabled, ac as EnsureInfiniteQueryDataOptions, ab as EnsureQueryDataOptions, ad as FetchInfiniteQueryOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, aa as FetchQueryOptions, an as FetchStatus, X as GetNextPageParamFunction, W as GetPreviousPageParamFunction, Y as InfiniteData, aw as InfiniteQueryObserverBaseResult, az as InfiniteQueryObserverLoadingErrorResult, ay as InfiniteQueryObserverLoadingResult, a8 as InfiniteQueryObserverOptions, ax as InfiniteQueryObserverPendingResult, aA as InfiniteQueryObserverRefetchErrorResult, aD as InfiniteQueryObserverResult, aB as InfiniteQueryObserverSuccessResult, a2 as InfiniteQueryPageParamsOptions, L as InitialDataFunction, a1 as InitialPageParam, ai as InvalidateOptions, ag as InvalidateQueryFilters, aM as MutateFunction, aL as MutateOptions, aI as MutationFunction, aE as MutationKey, aH as MutationMeta, aN as MutationObserverBaseResult, aQ as MutationObserverErrorResult, aO as MutationObserverIdleResult, aP as MutationObserverLoadingResult, aK as MutationObserverOptions, aS as MutationObserverResult, aR as MutationObserverSuccessResult, aJ as MutationOptions, aG as MutationScope, aF as MutationStatus, _ as NetworkMode, N as NoInfer, aY as NotifyEvent, aX as NotifyEventType, $ as NotifyOnChangeProps, O as OmitKeyof, a6 as Optional, y as Override, P as PlaceholderDataFunction, T as QueriesPlaceholderDataFunction, aT as QueryClientConfig, F as QueryFunction, K as QueryFunctionContext, A as QueryKey, V as QueryKeyHashFunction, Z as QueryMeta, ao as QueryObserverBaseResult, ar as QueryObserverLoadingErrorResult, aq as QueryObserverLoadingResult, a4 as QueryObserverOptions, ap as QueryObserverPendingResult, as as QueryObserverRefetchErrorResult, av as QueryObserverResult, at as QueryObserverSuccessResult, a0 as QueryOptions, J as QueryPersister, am as QueryStatus, af as RefetchOptions, ah as RefetchQueryFilters, R as Register, aj as ResetOptions, ae as ResultOptions, aW as SetDataOptions, G as StaleTime, a3 as ThrowOnError, a5 as WithRequired, B as dataTagSymbol } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/types.d.ts b/node_modules/@tanstack/query-core/build/legacy/types.d.ts deleted file mode 100644 index 4c67f2e825f959281bd91c0d5e88deab161f8ffd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { aV as CancelOptions, E as DataTag, z as DefaultError, aU as DefaultOptions, a9 as DefaultedInfiniteQueryObserverOptions, a7 as DefaultedQueryObserverOptions, aC as DefinedInfiniteQueryObserverResult, au as DefinedQueryObserverResult, I as Enabled, ac as EnsureInfiniteQueryDataOptions, ab as EnsureQueryDataOptions, ad as FetchInfiniteQueryOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, aa as FetchQueryOptions, an as FetchStatus, X as GetNextPageParamFunction, W as GetPreviousPageParamFunction, Y as InfiniteData, aw as InfiniteQueryObserverBaseResult, az as InfiniteQueryObserverLoadingErrorResult, ay as InfiniteQueryObserverLoadingResult, a8 as InfiniteQueryObserverOptions, ax as InfiniteQueryObserverPendingResult, aA as InfiniteQueryObserverRefetchErrorResult, aD as InfiniteQueryObserverResult, aB as InfiniteQueryObserverSuccessResult, a2 as InfiniteQueryPageParamsOptions, L as InitialDataFunction, a1 as InitialPageParam, ai as InvalidateOptions, ag as InvalidateQueryFilters, aM as MutateFunction, aL as MutateOptions, aI as MutationFunction, aE as MutationKey, aH as MutationMeta, aN as MutationObserverBaseResult, aQ as MutationObserverErrorResult, aO as MutationObserverIdleResult, aP as MutationObserverLoadingResult, aK as MutationObserverOptions, aS as MutationObserverResult, aR as MutationObserverSuccessResult, aJ as MutationOptions, aG as MutationScope, aF as MutationStatus, _ as NetworkMode, N as NoInfer, aY as NotifyEvent, aX as NotifyEventType, $ as NotifyOnChangeProps, O as OmitKeyof, a6 as Optional, y as Override, P as PlaceholderDataFunction, T as QueriesPlaceholderDataFunction, aT as QueryClientConfig, F as QueryFunction, K as QueryFunctionContext, A as QueryKey, V as QueryKeyHashFunction, Z as QueryMeta, ao as QueryObserverBaseResult, ar as QueryObserverLoadingErrorResult, aq as QueryObserverLoadingResult, a4 as QueryObserverOptions, ap as QueryObserverPendingResult, as as QueryObserverRefetchErrorResult, av as QueryObserverResult, at as QueryObserverSuccessResult, a0 as QueryOptions, J as QueryPersister, am as QueryStatus, af as RefetchOptions, ah as RefetchQueryFilters, R as Register, aj as ResetOptions, ae as ResultOptions, aW as SetDataOptions, G as StaleTime, a3 as ThrowOnError, a5 as WithRequired, B as dataTagSymbol } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/types.js b/node_modules/@tanstack/query-core/build/legacy/types.js deleted file mode 100644 index 5b2306a4c52321a5316142318d15fa56711ec12d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.js.map b/node_modules/@tanstack/query-core/build/legacy/types.js.map deleted file mode 100644 index 84c51b288c478ac0d18748007ccfb8cddc797f3a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.cjs b/node_modules/@tanstack/query-core/build/legacy/utils.cjs deleted file mode 100644 index 781ca5de8e35a1c1dff80b7143ae08c26f7cdd4b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.cjs +++ /dev/null @@ -1,293 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - addToEnd: () => addToEnd, - addToStart: () => addToStart, - ensureQueryFn: () => ensureQueryFn, - functionalUpdate: () => functionalUpdate, - hashKey: () => hashKey, - hashQueryKeyByOptions: () => hashQueryKeyByOptions, - isPlainArray: () => isPlainArray, - isPlainObject: () => isPlainObject, - isServer: () => isServer, - isValidTimeout: () => isValidTimeout, - keepPreviousData: () => keepPreviousData, - matchMutation: () => matchMutation, - matchQuery: () => matchQuery, - noop: () => noop, - partialMatchKey: () => partialMatchKey, - replaceData: () => replaceData, - replaceEqualDeep: () => replaceEqualDeep, - resolveEnabled: () => resolveEnabled, - resolveStaleTime: () => resolveStaleTime, - shallowEqualObjects: () => shallowEqualObjects, - skipToken: () => skipToken, - sleep: () => sleep, - timeUntilStale: () => timeUntilStale -}); -module.exports = __toCommonJS(utils_exports); -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { - return void 0; -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key])); - } - return false; -} -function replaceEqualDeep(a, b) { - if (a === b) { - return a; - } - const array = isPlainArray(a) && isPlainArray(b); - if (array || isPlainObject(a) && isPlainObject(b)) { - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? [] : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) { - copy[key] = void 0; - equalItems++; - } else { - copy[key] = replaceEqualDeep(a[key], b[key]); - if (copy[key] === a[key] && a[key] !== void 0) { - equalItems++; - } - } - } - return aSize === bSize && equalItems === aSize ? a : copy; - } - return b; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `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}` - ); - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - skipToken, - sleep, - timeUntilStale -}); -//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map b/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map deleted file mode 100644 index f249eb03f8d8ee880937294b6bc16b62ec550f68..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: QueryKey\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (mutation: Mutation) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: MutationKey\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): undefined {\n return undefined\n}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime: undefined | StaleTime,\n query: Query,\n): number | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T): T\nexport function replaceEqualDeep(a: any, b: any): any {\n if (a === b) {\n return a\n }\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (array || (isPlainObject(a) && isPlainObject(b))) {\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? [] : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i]\n if (\n ((!array && aItems.includes(key)) || array) &&\n a[key] === undefined &&\n b[key] === undefined\n ) {\n copy[key] = undefined\n equalItems++\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key])\n if (copy[key] === a[key] && a[key] !== undefined) {\n equalItems++\n }\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n }\n\n return b\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown) {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nexport function isPlainObject(o: any): o is Object {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `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}`,\n )\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.d.cts b/node_modules/@tanstack/query-core/build/legacy/utils.d.cts deleted file mode 100644 index ab045722d40d71db1922676b22524e1d3ff95d6d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as MutationFilters, j as QueryFilters, b6 as QueryTypeFilter, S as SkipToken, U as Updater, bk as addToEnd, bl as addToStart, bm as ensureQueryFn, b8 as functionalUpdate, h as hashKey, bd as hashQueryKeyByOptions, bg as isPlainArray, bh as isPlainObject, i as isServer, b9 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b7 as noop, be as partialMatchKey, bj as replaceData, r as replaceEqualDeep, bc as resolveEnabled, bb as resolveStaleTime, bf as shallowEqualObjects, s as skipToken, bi as sleep, ba as timeUntilStale } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.d.ts b/node_modules/@tanstack/query-core/build/legacy/utils.d.ts deleted file mode 100644 index 3095a8c40d5e14227f214239de6735945fcacafb..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as MutationFilters, j as QueryFilters, b6 as QueryTypeFilter, S as SkipToken, U as Updater, bk as addToEnd, bl as addToStart, bm as ensureQueryFn, b8 as functionalUpdate, h as hashKey, bd as hashQueryKeyByOptions, bg as isPlainArray, bh as isPlainObject, i as isServer, b9 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b7 as noop, be as partialMatchKey, bj as replaceData, r as replaceEqualDeep, bc as resolveEnabled, bb as resolveStaleTime, bf as shallowEqualObjects, s as skipToken, bi as sleep, ba as timeUntilStale } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs deleted file mode 100644 index 7e872d08a7378a51ea80217abeb92974c9079f61..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/focusManager.ts -var focusManager_exports = {}; -__export(focusManager_exports, { - FocusManager: () => FocusManager, - focusManager: () => focusManager -}); -module.exports = __toCommonJS(focusManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var FocusManager = class extends import_subscribable.Subscribable { - #focused; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onFocus) => { - if (!import_utils.isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - }); - } - setFocused(focused) { - const changed = this.#focused !== focused; - if (changed) { - this.#focused = focused; - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - if (typeof this.#focused === "boolean") { - return this.#focused; - } - return globalThis.document?.visibilityState !== "hidden"; - } -}; -var focusManager = new FocusManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - FocusManager, - focusManager -}); -//# sourceMappingURL=focusManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts b/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts deleted file mode 100644 index c0f57ac63199f34d1bd931c395187701a41d8049..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.cjs'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts b/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts deleted file mode 100644 index da33a8bcabcd77e975e41d4b2e44cb47898ac904..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.js b/node_modules/@tanstack/query-core/build/modern/focusManager.js deleted file mode 100644 index ec162069527770a50ab65e2d4e764e49fb595299..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.js +++ /dev/null @@ -1,68 +0,0 @@ -// src/focusManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var FocusManager = class extends Subscribable { - #focused; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onFocus) => { - if (!isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - }); - } - setFocused(focused) { - const changed = this.#focused !== focused; - if (changed) { - this.#focused = focused; - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - if (typeof this.#focused === "boolean") { - return this.#focused; - } - return globalThis.document?.visibilityState !== "hidden"; - } -}; -var focusManager = new FocusManager(); -export { - FocusManager, - focusManager -}; -//# sourceMappingURL=focusManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.js.map b/node_modules/@tanstack/query-core/build/modern/focusManager.js.map deleted file mode 100644 index 028bb4447eafd47273ab7d09fb763a8bbf5e0ff5..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAQlB,IAAM,eAAN,cAA2B,aAAuB;AAAA,EACvD;AAAA,EACA;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,KAAK,aAAa;AAClC,QAAI,SAAS;AACX,WAAK,WAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AACnB,QAAI,OAAO,KAAK,aAAa,WAAW;AACtC,aAAO,KAAK;AAAA,IACd;AAIA,WAAO,WAAW,UAAU,oBAAoB;AAAA,EAClD;AACF;AAEO,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration-BXpkOXt5.d.cts b/node_modules/@tanstack/query-core/build/modern/hydration-BXpkOXt5.d.cts deleted file mode 100644 index 93a47810ebd97ffddc736ba3139bbb05cf99ebb4..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration-BXpkOXt5.d.cts +++ /dev/null @@ -1,1297 +0,0 @@ -import { Removable } from './removable.cjs'; -import { Subscribable } from './subscribable.cjs'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface NotifyOptions { - listeners?: boolean; -} -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(notifyOptions?: NotifyOptions): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - cache: QueryCache; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: number): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: QueryKey; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: MutationKey; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTime, query: Query): number | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): boolean; -declare function isPlainObject(o: any): o is Object; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching(filters?: QueryFilters): number; - isMutating(filters?: MutationFilters): number; - getQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData(filters: QueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): TInferredQueryFnData | undefined; - setQueriesData(filters: QueryFilters, updater: Updater, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): MutationObserverOptions; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TContext | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TContext; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - abort?: () => void; - onError?: (error: TError) => void; - onSuccess?: (data: TData) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type DataTag = TType & { - [dataTagSymbol]: TValue; -}; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | ((query: Query) => number); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - */ - staleTime?: StaleTime; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type Optional = Pick, TKey> & OmitKeyof; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTime; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult; -type MutationKey = ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunction = (variables: TVariables) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables) => Promise | TContext | undefined; - onSuccess?: (data: TData, variables: TVariables, context: TContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, context: TContext) => void; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type NotifyOnChangeProps as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, type DataTag as E, type QueryFunction as F, type StaleTime as G, type HydrateOptions as H, type Enabled as I, type QueryPersister as J, type QueryFunctionContext as K, type InitialDataFunction as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type QueriesPlaceholderDataFunction as T, type Updater as U, type QueryKeyHashFunction as V, type GetPreviousPageParamFunction as W, type GetNextPageParamFunction as X, type InfiniteData as Y, type QueryMeta as Z, type NetworkMode as _, type QueryCacheNotifyEvent as a, type FetchContext as a$, type QueryOptions as a0, type InitialPageParam as a1, type InfiniteQueryPageParamsOptions as a2, type ThrowOnError as a3, type QueryObserverOptions as a4, type WithRequired as a5, type Optional as a6, type DefaultedQueryObserverOptions as a7, type InfiniteQueryObserverOptions as a8, type DefaultedInfiniteQueryObserverOptions as a9, type InfiniteQueryObserverRefetchErrorResult as aA, type InfiniteQueryObserverSuccessResult as aB, type DefinedInfiniteQueryObserverResult as aC, type InfiniteQueryObserverResult as aD, type MutationKey as aE, type MutationStatus as aF, type MutationScope as aG, type MutationMeta as aH, type MutationFunction as aI, type MutationOptions as aJ, type MutationObserverOptions as aK, type MutateOptions as aL, type MutateFunction as aM, type MutationObserverBaseResult as aN, type MutationObserverIdleResult as aO, type MutationObserverLoadingResult as aP, type MutationObserverErrorResult as aQ, type MutationObserverSuccessResult as aR, type MutationObserverResult as aS, type QueryClientConfig as aT, type DefaultOptions as aU, type CancelOptions as aV, type SetDataOptions as aW, type NotifyEventType as aX, type NotifyEvent as aY, type QueryBehavior as aZ, type NotifyOptions as a_, type FetchQueryOptions as aa, type EnsureQueryDataOptions as ab, type EnsureInfiniteQueryDataOptions as ac, type FetchInfiniteQueryOptions as ad, type ResultOptions as ae, type RefetchOptions as af, type InvalidateQueryFilters as ag, type RefetchQueryFilters as ah, type InvalidateOptions as ai, type ResetOptions as aj, type FetchNextPageOptions as ak, type FetchPreviousPageOptions as al, type QueryStatus as am, type FetchStatus as an, type QueryObserverBaseResult as ao, type QueryObserverPendingResult as ap, type QueryObserverLoadingResult as aq, type QueryObserverLoadingErrorResult as ar, type QueryObserverRefetchErrorResult as as, type QueryObserverSuccessResult as at, type DefinedQueryObserverResult as au, type QueryObserverResult as av, type InfiniteQueryObserverBaseResult as aw, type InfiniteQueryObserverPendingResult as ax, type InfiniteQueryObserverLoadingResult as ay, type InfiniteQueryObserverLoadingErrorResult as az, QueryClient as b, type FetchDirection as b0, type FetchMeta as b1, type FetchOptions as b2, type Action$1 as b3, type SetStateOptions as b4, fetchState as b5, type QueryTypeFilter as b6, noop as b7, functionalUpdate as b8, isValidTimeout as b9, timeUntilStale as ba, resolveStaleTime as bb, resolveEnabled as bc, hashQueryKeyByOptions as bd, partialMatchKey as be, shallowEqualObjects as bf, isPlainArray as bg, isPlainObject as bh, sleep as bi, replaceData as bj, addToEnd as bk, addToStart as bl, ensureQueryFn as bm, type QueryStore as bn, type Action as bo, getDefaultState as bp, type Retryer as bq, type RetryValue as br, type RetryDelayValue as bs, canFetch as bt, createRetryer as bu, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, type MutationFilters as g, hashKey as h, isServer as i, type QueryFilters as j, keepPreviousData as k, isCancelledError as l, matchQuery as m, dehydrate as n, hydrate as o, defaultShouldDehydrateQuery as p, defaultShouldDehydrateMutation as q, replaceEqualDeep as r, skipToken as s, type QueryState as t, Query as u, type MutationState as v, Mutation as w, type DehydratedState as x, type Override as y, type DefaultError as z }; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration-mKPlgzt9.d.ts b/node_modules/@tanstack/query-core/build/modern/hydration-mKPlgzt9.d.ts deleted file mode 100644 index ad7499c1f869ba34470022b3f7fc6ad6748af965..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration-mKPlgzt9.d.ts +++ /dev/null @@ -1,1297 +0,0 @@ -import { Removable } from './removable.js'; -import { Subscribable } from './subscribable.js'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface NotifyOptions { - listeners?: boolean; -} -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(notifyOptions?: NotifyOptions): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - cache: QueryCache; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: number): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: QueryKey; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: MutationKey; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTime, query: Query): number | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): boolean; -declare function isPlainObject(o: any): o is Object; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching(filters?: QueryFilters): number; - isMutating(filters?: MutationFilters): number; - getQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData(filters: QueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): TInferredQueryFnData | undefined; - setQueriesData(filters: QueryFilters, updater: Updater, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState ? TaggedValue : TQueryFnData>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): MutationObserverOptions; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, context: unknown, mutation: Mutation) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TContext | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TContext; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - abort?: () => void; - onError?: (error: TError) => void; - onSuccess?: (data: TData) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type DataTag = TType & { - [dataTagSymbol]: TValue; -}; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | ((query: Query) => number); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - */ - staleTime?: StaleTime; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type Optional = Pick, TKey> & OmitKeyof; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTime; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult; -type MutationKey = ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunction = (variables: TVariables) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables) => Promise | TContext | undefined; - onSuccess?: (data: TData, variables: TVariables, context: TContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, context: TContext) => void; - onError?: (error: TError, variables: TVariables, context: TContext | undefined) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, context: TContext | undefined) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type NotifyOnChangeProps as $, type QueryKey as A, dataTagSymbol as B, CancelledError as C, type DehydrateOptions as D, type DataTag as E, type QueryFunction as F, type StaleTime as G, type HydrateOptions as H, type Enabled as I, type QueryPersister as J, type QueryFunctionContext as K, type InitialDataFunction as L, MutationCache as M, type NoInfer as N, type OmitKeyof as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type SkipToken as S, type QueriesPlaceholderDataFunction as T, type Updater as U, type QueryKeyHashFunction as V, type GetPreviousPageParamFunction as W, type GetNextPageParamFunction as X, type InfiniteData as Y, type QueryMeta as Z, type NetworkMode as _, type QueryCacheNotifyEvent as a, type FetchContext as a$, type QueryOptions as a0, type InitialPageParam as a1, type InfiniteQueryPageParamsOptions as a2, type ThrowOnError as a3, type QueryObserverOptions as a4, type WithRequired as a5, type Optional as a6, type DefaultedQueryObserverOptions as a7, type InfiniteQueryObserverOptions as a8, type DefaultedInfiniteQueryObserverOptions as a9, type InfiniteQueryObserverRefetchErrorResult as aA, type InfiniteQueryObserverSuccessResult as aB, type DefinedInfiniteQueryObserverResult as aC, type InfiniteQueryObserverResult as aD, type MutationKey as aE, type MutationStatus as aF, type MutationScope as aG, type MutationMeta as aH, type MutationFunction as aI, type MutationOptions as aJ, type MutationObserverOptions as aK, type MutateOptions as aL, type MutateFunction as aM, type MutationObserverBaseResult as aN, type MutationObserverIdleResult as aO, type MutationObserverLoadingResult as aP, type MutationObserverErrorResult as aQ, type MutationObserverSuccessResult as aR, type MutationObserverResult as aS, type QueryClientConfig as aT, type DefaultOptions as aU, type CancelOptions as aV, type SetDataOptions as aW, type NotifyEventType as aX, type NotifyEvent as aY, type QueryBehavior as aZ, type NotifyOptions as a_, type FetchQueryOptions as aa, type EnsureQueryDataOptions as ab, type EnsureInfiniteQueryDataOptions as ac, type FetchInfiniteQueryOptions as ad, type ResultOptions as ae, type RefetchOptions as af, type InvalidateQueryFilters as ag, type RefetchQueryFilters as ah, type InvalidateOptions as ai, type ResetOptions as aj, type FetchNextPageOptions as ak, type FetchPreviousPageOptions as al, type QueryStatus as am, type FetchStatus as an, type QueryObserverBaseResult as ao, type QueryObserverPendingResult as ap, type QueryObserverLoadingResult as aq, type QueryObserverLoadingErrorResult as ar, type QueryObserverRefetchErrorResult as as, type QueryObserverSuccessResult as at, type DefinedQueryObserverResult as au, type QueryObserverResult as av, type InfiniteQueryObserverBaseResult as aw, type InfiniteQueryObserverPendingResult as ax, type InfiniteQueryObserverLoadingResult as ay, type InfiniteQueryObserverLoadingErrorResult as az, QueryClient as b, type FetchDirection as b0, type FetchMeta as b1, type FetchOptions as b2, type Action$1 as b3, type SetStateOptions as b4, fetchState as b5, type QueryTypeFilter as b6, noop as b7, functionalUpdate as b8, isValidTimeout as b9, timeUntilStale as ba, resolveStaleTime as bb, resolveEnabled as bc, hashQueryKeyByOptions as bd, partialMatchKey as be, shallowEqualObjects as bf, isPlainArray as bg, isPlainObject as bh, sleep as bi, replaceData as bj, addToEnd as bk, addToStart as bl, ensureQueryFn as bm, type QueryStore as bn, type Action as bo, getDefaultState as bp, type Retryer as bq, type RetryValue as br, type RetryDelayValue as bs, canFetch as bt, createRetryer as bu, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, matchMutation as f, type MutationFilters as g, hashKey as h, isServer as i, type QueryFilters as j, keepPreviousData as k, isCancelledError as l, matchQuery as m, dehydrate as n, hydrate as o, defaultShouldDehydrateQuery as p, defaultShouldDehydrateMutation as q, replaceEqualDeep as r, skipToken as s, type QueryState as t, Query as u, type MutationState as v, Mutation as w, type DehydratedState as x, type Override as y, type DefaultError as z }; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.cjs b/node_modules/@tanstack/query-core/build/modern/hydration.cjs deleted file mode 100644 index d56e831ceffc05b4866261bbe33fb2ed1a3e7467..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.cjs +++ /dev/null @@ -1,144 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/hydration.ts -var hydration_exports = {}; -__export(hydration_exports, { - defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, - dehydrate: () => dehydrate, - hydrate: () => hydrate -}); -module.exports = __toCommonJS(hydration_exports); -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData) { - return { - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: query.promise?.then(serializeData).catch((error) => { - if (process.env.NODE_ENV !== "production") { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }) - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function dehydrate(client, options = {}) { - const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; - const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions }) => { - mutationCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.mutations, - ...options?.defaultOptions?.mutations, - ...mutationOptions - }, - state - ); - }); - queries.forEach(({ queryKey, state, queryHash, meta, promise }) => { - let query = queryCache.get(queryHash); - const data = state.data === void 0 ? state.data : deserializeData(state.data); - if (query) { - if (query.state.dataUpdatedAt < state.dataUpdatedAt) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.queries, - ...options?.defaultOptions?.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle" - } - ); - } - if (promise) { - const initialPromise = Promise.resolve(promise).then(deserializeData); - void query.fetch(void 0, { initialPromise }); - } - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -}); -//# sourceMappingURL=hydration.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map b/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map deleted file mode 100644 index 4d15012a018d89cf2df606dcb77452c5a568831f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n): DehydratedQuery {\n return {\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: query.promise?.then(serializeData).catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n }),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(({ queryKey, state, queryHash, meta, promise }) => {\n let query = queryCache.get(queryHash)\n\n const data =\n state.data === undefined ? state.data : deserializeData(state.data)\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n if (query.state.dataUpdatedAt < state.dataUpdatedAt) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n },\n )\n }\n\n if (promise) {\n // Note: `Promise.resolve` required cause\n // RSC transformed promises are not thenable\n const initialPromise = Promise.resolve(promise).then(deserializeData)\n\n // this doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n void query.fetch(undefined, { initialPromise })\n }\n })\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.d.cts b/node_modules/@tanstack/query-core/build/modern/hydration.d.cts deleted file mode 100644 index 5b615de20768b712de1e77b2dcb2ba8579b7cfea..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.d.ts b/node_modules/@tanstack/query-core/build/modern/hydration.d.ts deleted file mode 100644 index 99a3dd78335dc6f1a16d8392e0ddc01c51dd5618..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { D as DehydrateOptions, x as DehydratedState, H as HydrateOptions, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, o as hydrate } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.js.map b/node_modules/@tanstack/query-core/build/modern/hydration.js.map deleted file mode 100644 index f8518aa7a4a76056822b3d3079b6f5f5c7207b12..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n): DehydratedQuery {\n return {\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: query.promise?.then(serializeData).catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n }),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(({ queryKey, state, queryHash, meta, promise }) => {\n let query = queryCache.get(queryHash)\n\n const data =\n state.data === undefined ? state.data : deserializeData(state.data)\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n if (query.state.dataUpdatedAt < state.dataUpdatedAt) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n },\n )\n }\n\n if (promise) {\n // Note: `Promise.resolve` required cause\n // RSC transformed promises are not thenable\n const initialPromise = Promise.resolve(promise).then(deserializeData)\n\n // this doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n void query.fetch(undefined, { initialPromise })\n }\n })\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.cjs b/node_modules/@tanstack/query-core/build/modern/index.cjs deleted file mode 100644 index 61f777e4f5c5ce06ca42b0729fababff29942548..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/index.cjs +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - CancelledError: () => import_retryer.CancelledError, - InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, - Mutation: () => import_mutation.Mutation, - MutationCache: () => import_mutationCache.MutationCache, - MutationObserver: () => import_mutationObserver.MutationObserver, - QueriesObserver: () => import_queriesObserver.QueriesObserver, - Query: () => import_query.Query, - QueryCache: () => import_queryCache.QueryCache, - QueryClient: () => import_queryClient.QueryClient, - QueryObserver: () => import_queryObserver.QueryObserver, - defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, - dehydrate: () => import_hydration.dehydrate, - focusManager: () => import_focusManager.focusManager, - hashKey: () => import_utils.hashKey, - hydrate: () => import_hydration.hydrate, - isCancelledError: () => import_retryer2.isCancelledError, - isServer: () => import_utils.isServer, - keepPreviousData: () => import_utils.keepPreviousData, - matchMutation: () => import_utils.matchMutation, - matchQuery: () => import_utils.matchQuery, - notifyManager: () => import_notifyManager.notifyManager, - onlineManager: () => import_onlineManager.onlineManager, - replaceEqualDeep: () => import_utils.replaceEqualDeep, - skipToken: () => import_utils.skipToken -}); -module.exports = __toCommonJS(src_exports); -var import_retryer = require("./retryer.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_queryClient = require("./queryClient.cjs"); -var import_queryObserver = require("./queryObserver.cjs"); -var import_queriesObserver = require("./queriesObserver.cjs"); -var import_infiniteQueryObserver = require("./infiniteQueryObserver.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_mutationObserver = require("./mutationObserver.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_utils = require("./utils.cjs"); -var import_retryer2 = require("./retryer.cjs"); -var import_hydration = require("./hydration.cjs"); -__reExport(src_exports, require("./types.cjs"), module.exports); -var import_query = require("./query.cjs"); -var import_mutation = require("./mutation.cjs"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - notifyManager, - onlineManager, - replaceEqualDeep, - skipToken, - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.cjs.map b/node_modules/@tanstack/query-core/build/modern/index.cjs.map deleted file mode 100644 index 23b0a18f13811ecfdeb64f0f2c9182ea50e1a1a7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA+B;AAC/B,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,6BAAgC;AAChC,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAQO;AAEP,IAAAA,kBAAiC;AACjC,uBAKO;AAGP,wBAAc,wBAlCd;AAoCA,mBAAsB;AAEtB,sBAAyB;","names":["import_retryer"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.d.cts b/node_modules/@tanstack/query-core/build/modern/index.d.cts deleted file mode 100644 index 0ea9ddf4fcdb4ff5df78b29482a57c52f2a83f4c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/index.d.cts +++ /dev/null @@ -1,8 +0,0 @@ -export { aV as CancelOptions, C as CancelledError, E as DataTag, z as DefaultError, aU as DefaultOptions, a9 as DefaultedInfiniteQueryObserverOptions, a7 as DefaultedQueryObserverOptions, aC as DefinedInfiniteQueryObserverResult, au as DefinedQueryObserverResult, D as DehydrateOptions, x as DehydratedState, I as Enabled, ac as EnsureInfiniteQueryDataOptions, ab as EnsureQueryDataOptions, ad as FetchInfiniteQueryOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, aa as FetchQueryOptions, an as FetchStatus, X as GetNextPageParamFunction, W as GetPreviousPageParamFunction, H as HydrateOptions, Y as InfiniteData, aw as InfiniteQueryObserverBaseResult, az as InfiniteQueryObserverLoadingErrorResult, ay as InfiniteQueryObserverLoadingResult, a8 as InfiniteQueryObserverOptions, ax as InfiniteQueryObserverPendingResult, aA as InfiniteQueryObserverRefetchErrorResult, aD as InfiniteQueryObserverResult, aB as InfiniteQueryObserverSuccessResult, a2 as InfiniteQueryPageParamsOptions, L as InitialDataFunction, a1 as InitialPageParam, ai as InvalidateOptions, ag as InvalidateQueryFilters, aM as MutateFunction, aL as MutateOptions, w as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, g as MutationFilters, aI as MutationFunction, aE as MutationKey, aH as MutationMeta, e as MutationObserver, aN as MutationObserverBaseResult, aQ as MutationObserverErrorResult, aO as MutationObserverIdleResult, aP as MutationObserverLoadingResult, aK as MutationObserverOptions, aS as MutationObserverResult, aR as MutationObserverSuccessResult, aJ as MutationOptions, aG as MutationScope, v as MutationState, aF as MutationStatus, _ as NetworkMode, N as NoInfer, aY as NotifyEvent, aX as NotifyEventType, $ as NotifyOnChangeProps, O as OmitKeyof, a6 as Optional, y as Override, P as PlaceholderDataFunction, T as QueriesPlaceholderDataFunction, u as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, aT as QueryClientConfig, j as QueryFilters, F as QueryFunction, K as QueryFunctionContext, A as QueryKey, V as QueryKeyHashFunction, Z as QueryMeta, c as QueryObserver, ao as QueryObserverBaseResult, ar as QueryObserverLoadingErrorResult, aq as QueryObserverLoadingResult, a4 as QueryObserverOptions, ap as QueryObserverPendingResult, as as QueryObserverRefetchErrorResult, av as QueryObserverResult, at as QueryObserverSuccessResult, a0 as QueryOptions, J as QueryPersister, t as QueryState, am as QueryStatus, af as RefetchOptions, ah as RefetchQueryFilters, R as Register, aj as ResetOptions, ae as ResultOptions, aW as SetDataOptions, S as SkipToken, G as StaleTime, a3 as ThrowOnError, U as Updater, a5 as WithRequired, B as dataTagSymbol, q as defaultShouldDehydrateMutation, p as defaultShouldDehydrateQuery, n as dehydrate, h as hashKey, o as hydrate, l as isCancelledError, i as isServer, k as keepPreviousData, f as matchMutation, m as matchQuery, r as replaceEqualDeep, s as skipToken } from './hydration-BXpkOXt5.cjs'; -export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs'; -export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs'; -export { notifyManager } from './notifyManager.cjs'; -export { focusManager } from './focusManager.cjs'; -export { onlineManager } from './onlineManager.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/index.js b/node_modules/@tanstack/query-core/build/modern/index.js deleted file mode 100644 index 18ca88e7e536a1dbb96ed98f172f6d5690a80507..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/index.js +++ /dev/null @@ -1,59 +0,0 @@ -// src/index.ts -import { CancelledError } from "./retryer.js"; -import { QueryCache } from "./queryCache.js"; -import { QueryClient } from "./queryClient.js"; -import { QueryObserver } from "./queryObserver.js"; -import { QueriesObserver } from "./queriesObserver.js"; -import { InfiniteQueryObserver } from "./infiniteQueryObserver.js"; -import { MutationCache } from "./mutationCache.js"; -import { MutationObserver } from "./mutationObserver.js"; -import { notifyManager } from "./notifyManager.js"; -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { - hashKey, - replaceEqualDeep, - isServer, - matchQuery, - matchMutation, - keepPreviousData, - skipToken -} from "./utils.js"; -import { isCancelledError } from "./retryer.js"; -import { - dehydrate, - hydrate, - defaultShouldDehydrateQuery, - defaultShouldDehydrateMutation -} from "./hydration.js"; -export * from "./types.js"; -import { Query } from "./query.js"; -import { Mutation } from "./mutation.js"; -export { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - notifyManager, - onlineManager, - replaceEqualDeep, - skipToken -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.js.map b/node_modules/@tanstack/query-core/build/modern/index.js.map deleted file mode 100644 index 71a3e8bc4c687b6ad698b1e1690acb9378fe2ca3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { CancelledError } from './retryer'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { QueriesObserver } from './queriesObserver'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { notifyManager } from './notifyManager'\nexport { focusManager } from './focusManager'\nexport { onlineManager } from './onlineManager'\nexport {\n hashKey,\n replaceEqualDeep,\n isServer,\n matchQuery,\n matchMutation,\n keepPreviousData,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils'\nexport { isCancelledError } from './retryer'\nexport {\n dehydrate,\n hydrate,\n defaultShouldDehydrateQuery,\n defaultShouldDehydrateMutation,\n} from './hydration'\n\n// Types\nexport * from './types'\nexport type { QueryState } from './query'\nexport { Query } from './query'\nexport type { MutationState } from './mutation'\nexport { Mutation } from './mutation'\nexport type {\n DehydrateOptions,\n DehydratedState,\n HydrateOptions,\n} from './hydration'\nexport type { QueriesObserverOptions } from './queriesObserver'\n"],"mappings":";AAEA,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,cAAc;AAEd,SAAS,aAAa;AAEtB,SAAS,gBAAgB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs deleted file mode 100644 index c9ee441996283b02e5ca983708fe26782e39d89c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryBehavior.ts -var infiniteQueryBehavior_exports = {}; -__export(infiniteQueryBehavior_exports, { - hasNextPage: () => hasNextPage, - hasPreviousPage: () => hasPreviousPage, - infiniteQueryBehavior: () => infiniteQueryBehavior -}); -module.exports = __toCommonJS(infiniteQueryBehavior_exports); -var import_utils = require("./utils.cjs"); -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - const options = context.options; - const direction = context.fetchOptions?.meta?.fetchMore?.direction; - const oldPages = context.state.data?.pages || []; - const oldPageParams = context.state.data?.pageParams || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - if (context.signal.aborted) { - cancelled = true; - } else { - context.signal.addEventListener("abort", () => { - cancelled = true; - }); - } - return context.signal; - } - }); - }; - const queryFn = (0, import_utils.ensureQueryFn)(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const queryFnContext = { - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext); - const page = await queryFn( - queryFnContext - ); - const { maxPages } = context.options; - const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn, - { - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) - return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) - return false; - return getPreviousPageParam(options, data) != null; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}); -//# sourceMappingURL=infiniteQueryBehavior.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map deleted file mode 100644 index 9736aa2057a978e3959665df168101d2bcf48da8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import { addToEnd, addToStart, ensureQueryFn } from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true\n } else {\n context.signal.addEventListener('abort', () => {\n cancelled = true\n })\n }\n return context.signal\n },\n })\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n const page = await queryFn(\n queryFnContext as QueryFunctionContext,\n )\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts deleted file mode 100644 index 7dc85ee9996afcb7875c1a8b6a8a55cd7bf6a87b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import { aZ as QueryBehavior, Y as InfiniteData, a2 as InfiniteQueryPageParamsOptions } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts deleted file mode 100644 index 689844339453cb6247e129f3d0585139de5b1e71..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { aZ as QueryBehavior, Y as InfiniteData, a2 as InfiniteQueryPageParamsOptions } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js deleted file mode 100644 index ce5518fe79da59f6b179f51b3a31a756c764ad34..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js +++ /dev/null @@ -1,121 +0,0 @@ -// src/infiniteQueryBehavior.ts -import { addToEnd, addToStart, ensureQueryFn } from "./utils.js"; -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - const options = context.options; - const direction = context.fetchOptions?.meta?.fetchMore?.direction; - const oldPages = context.state.data?.pages || []; - const oldPageParams = context.state.data?.pageParams || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - if (context.signal.aborted) { - cancelled = true; - } else { - context.signal.addEventListener("abort", () => { - cancelled = true; - }); - } - return context.signal; - } - }); - }; - const queryFn = ensureQueryFn(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const queryFnContext = { - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext); - const page = await queryFn( - queryFnContext - ); - const { maxPages } = context.options; - const addTo = previous ? addToStart : addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn, - { - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) - return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) - return false; - return getPreviousPageParam(options, data) != null; -} -export { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}; -//# sourceMappingURL=infiniteQueryBehavior.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map deleted file mode 100644 index 66007c792884efac9e14f5b2cc56e24f5e7f1c54..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import { addToEnd, addToStart, ensureQueryFn } from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true\n } else {\n context.signal.addEventListener('abort', () => {\n cancelled = true\n })\n }\n return context.signal\n },\n })\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n const page = await queryFn(\n queryFnContext as QueryFunctionContext,\n )\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs deleted file mode 100644 index 5abab84fe7dba07d4189add24eeb9b75da35313d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryObserver.ts -var infiniteQueryObserver_exports = {}; -__export(infiniteQueryObserver_exports, { - InfiniteQueryObserver: () => InfiniteQueryObserver -}); -module.exports = __toCommonJS(infiniteQueryObserver_exports); -var import_queryObserver = require("./queryObserver.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options, notifyOptions) { - super.setOptions( - { - ...options, - behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() - }, - notifyOptions - ); - } - getOptimisticResult(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = state.fetchMeta?.fetchMore?.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), - hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - InfiniteQueryObserver -}); -//# sourceMappingURL=infiniteQueryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map deleted file mode 100644 index 3ae4efb1d01894b3279edabed31aedbad3e98829..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n notifyOptions?: NotifyOptions,\n ): void {\n super.setOptions(\n {\n ...options,\n behavior: infiniteQueryBehavior(),\n },\n notifyOptions,\n )\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAqBA,IAAM,wBAAN,cAOG,mCAMR;AAAA,EA8BA,YACE,QACA,SAQA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAQA,eACM;AACN,UAAM;AAAA,MACJ;AAAA,QACE,GAAG;AAAA,QACH,cAAU,oDAAsB;AAAA,MAClC;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,oBACE,SAQ4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAQ4C;AAC5C,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,iBAAiB,MAAM,WAAW,WAAW;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts deleted file mode 100644 index 3dd38e57cb793f844d70475eb0d89589b8df33d6..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts +++ /dev/null @@ -1,20 +0,0 @@ -import { z as DefaultError, Y as InfiniteData, A as QueryKey, c as QueryObserver, aD as InfiniteQueryObserverResult, b as QueryClient, a8 as InfiniteQueryObserverOptions, a_ as NotifyOptions, a9 as DefaultedInfiniteQueryObserverOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, u as Query } from './hydration-BXpkOXt5.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts deleted file mode 100644 index d2c74ac0b9dac20b55e40b91879165fdb4384b4b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { z as DefaultError, Y as InfiniteData, A as QueryKey, c as QueryObserver, aD as InfiniteQueryObserverResult, b as QueryClient, a8 as InfiniteQueryObserverOptions, a_ as NotifyOptions, a9 as DefaultedInfiniteQueryObserverOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, u as Query } from './hydration-mKPlgzt9.js'; -import { Subscribable } from './subscribable.js'; -import './removable.js'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions, notifyOptions?: NotifyOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js deleted file mode 100644 index 93b4ad69acc3447b63bad121f388abe6ccdaadc2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js +++ /dev/null @@ -1,74 +0,0 @@ -// src/infiniteQueryObserver.ts -import { QueryObserver } from "./queryObserver.js"; -import { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -} from "./infiniteQueryBehavior.js"; -var InfiniteQueryObserver = class extends QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options, notifyOptions) { - super.setOptions( - { - ...options, - behavior: infiniteQueryBehavior() - }, - notifyOptions - ); - } - getOptimisticResult(options) { - options.behavior = infiniteQueryBehavior(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = state.fetchMeta?.fetchMore?.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -export { - InfiniteQueryObserver -}; -//# sourceMappingURL=infiniteQueryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map deleted file mode 100644 index b31cf7e30faf4d9a7e767716b5482b65ac9b865f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n notifyOptions?: NotifyOptions,\n ): void {\n super.setOptions(\n {\n ...options,\n behavior: infiniteQueryBehavior(),\n },\n notifyOptions,\n )\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAqBA,IAAM,wBAAN,cAOG,cAMR;AAAA,EA8BA,YACE,QACA,SAQA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAQA,eACM;AACN,UAAM;AAAA,MACJ;AAAA,QACE,GAAG;AAAA,QACH,UAAU,sBAAsB;AAAA,MAClC;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,oBACE,SAQ4C;AAC5C,YAAQ,WAAW,sBAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAQ4C;AAC5C,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,iBAAiB,MAAM,WAAW,WAAW;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,aAAa,YAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,iBAAiB,gBAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.cjs b/node_modules/@tanstack/query-core/build/modern/mutation.cjs deleted file mode 100644 index 9929e8eeae40385afce81dec0e6d9b02944e3173..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.cjs +++ /dev/null @@ -1,261 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutation.ts -var mutation_exports = {}; -__export(mutation_exports, { - Mutation: () => Mutation, - getDefaultState: () => getDefaultState -}); -module.exports = __toCommonJS(mutation_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_removable = require("./removable.cjs"); -var import_retryer = require("./retryer.cjs"); -var Mutation = class extends import_removable.Removable { - #observers; - #mutationCache; - #retryer; - constructor(config) { - super(); - this.mutationId = config.mutationId; - this.#mutationCache = config.mutationCache; - this.#observers = []; - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer); - this.clearGcTimeout(); - this.#mutationCache.notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - this.#observers = this.#observers.filter((x) => x !== observer); - this.scheduleGc(); - this.#mutationCache.notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - this.#mutationCache.remove(this); - } - } - } - continue() { - return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - this.#retryer = (0, import_retryer.createRetryer)({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this) - }); - const restored = this.state.status === "pending"; - const isPaused = !this.#retryer.canStart(); - try { - if (!restored) { - this.#dispatch({ type: "pending", variables, isPaused }); - await this.#mutationCache.config.onMutate?.( - variables, - this - ); - const context = await this.options.onMutate?.(variables); - if (context !== this.state.context) { - this.#dispatch({ - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await this.#retryer.start(); - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this - ); - await this.options.onSuccess?.(data, variables, this.state.context); - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this - ); - await this.options.onSettled?.(data, null, variables, this.state.context); - this.#dispatch({ type: "success", data }); - return data; - } catch (error) { - try { - await this.#mutationCache.config.onError?.( - error, - variables, - this.state.context, - this - ); - await this.options.onError?.( - error, - variables, - this.state.context - ); - await this.#mutationCache.config.onSettled?.( - void 0, - error, - this.state.variables, - this.state.context, - this - ); - await this.options.onSettled?.( - void 0, - error, - variables, - this.state.context - ); - throw error; - } finally { - this.#dispatch({ type: "error", error }); - } - } finally { - this.#mutationCache.runNext(this); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action); - }); - this.#mutationCache.notify({ - mutation: this, - type: "updated", - action - }); - }); - } -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Mutation, - getDefaultState -}); -//# sourceMappingURL=mutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.js b/node_modules/@tanstack/query-core/build/modern/mutation.js deleted file mode 100644 index 1bc799087fe63df7b2617438ae36c1e6ae955bfe..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.js +++ /dev/null @@ -1,235 +0,0 @@ -// src/mutation.ts -import { notifyManager } from "./notifyManager.js"; -import { Removable } from "./removable.js"; -import { createRetryer } from "./retryer.js"; -var Mutation = class extends Removable { - #observers; - #mutationCache; - #retryer; - constructor(config) { - super(); - this.mutationId = config.mutationId; - this.#mutationCache = config.mutationCache; - this.#observers = []; - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer); - this.clearGcTimeout(); - this.#mutationCache.notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - this.#observers = this.#observers.filter((x) => x !== observer); - this.scheduleGc(); - this.#mutationCache.notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - this.#mutationCache.remove(this); - } - } - } - continue() { - return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - this.#retryer = createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this) - }); - const restored = this.state.status === "pending"; - const isPaused = !this.#retryer.canStart(); - try { - if (!restored) { - this.#dispatch({ type: "pending", variables, isPaused }); - await this.#mutationCache.config.onMutate?.( - variables, - this - ); - const context = await this.options.onMutate?.(variables); - if (context !== this.state.context) { - this.#dispatch({ - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await this.#retryer.start(); - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this - ); - await this.options.onSuccess?.(data, variables, this.state.context); - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this - ); - await this.options.onSettled?.(data, null, variables, this.state.context); - this.#dispatch({ type: "success", data }); - return data; - } catch (error) { - try { - await this.#mutationCache.config.onError?.( - error, - variables, - this.state.context, - this - ); - await this.options.onError?.( - error, - variables, - this.state.context - ); - await this.#mutationCache.config.onSettled?.( - void 0, - error, - this.state.variables, - this.state.context, - this - ); - await this.options.onSettled?.( - void 0, - error, - variables, - this.state.context - ); - throw error; - } finally { - this.#dispatch({ type: "error", error }); - } - } finally { - this.#mutationCache.runNext(this); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action); - }); - this.#mutationCache.notify({ - mutation: this, - type: "updated", - action - }); - }); - } -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -export { - Mutation, - getDefaultState -}; -//# sourceMappingURL=mutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.js.map b/node_modules/@tanstack/query-core/build/modern/mutation.js.map deleted file mode 100644 index cb8f7b38821d62a4f78c4befd9d59068660ef307..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface MutationConfig {\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TContext = unknown,\n> {\n context: TContext | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TContext\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TContext = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #observers: Array>\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(config: MutationConfig) {\n super()\n\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n return this.options.mutationFn(variables)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (!restored) {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n await this.#mutationCache.config.onMutate?.(\n variables,\n this as Mutation,\n )\n const context = await this.options.onMutate?.(variables)\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSuccess?.(data, variables, this.state.context!)\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSettled?.(data, null, variables, this.state.context)\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n )\n throw error\n } finally {\n this.#dispatch({ type: 'error', error: error as TError })\n }\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TContext,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs deleted file mode 100644 index 84943e8532b7e2329abe1b0da88465b595fac993..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutationCache.ts -var mutationCache_exports = {}; -__export(mutationCache_exports, { - MutationCache: () => MutationCache -}); -module.exports = __toCommonJS(mutationCache_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_mutation = require("./mutation.cjs"); -var import_utils = require("./utils.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var MutationCache = class extends import_subscribable.Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#mutations = /* @__PURE__ */ new Map(); - this.#mutationId = Date.now(); - } - #mutations; - #mutationId; - build(client, options, state) { - const mutation = new import_mutation.Mutation({ - mutationCache: this, - mutationId: ++this.#mutationId, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - const scope = scopeFor(mutation); - const mutations = this.#mutations.get(scope) ?? []; - mutations.push(mutation); - this.#mutations.set(scope, mutations); - this.notify({ type: "added", mutation }); - } - remove(mutation) { - const scope = scopeFor(mutation); - if (this.#mutations.has(scope)) { - const mutations = this.#mutations.get(scope)?.filter((x) => x !== mutation); - if (mutations) { - if (mutations.length === 0) { - this.#mutations.delete(scope); - } else { - this.#mutations.set(scope, mutations); - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - const firstPendingMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m.state.status === "pending"); - return !firstPendingMutation || firstPendingMutation === mutation; - } - runNext(mutation) { - const foundMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m !== mutation && m.state.isPaused); - return foundMutation?.continue() ?? Promise.resolve(); - } - clear() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((mutation) => { - this.remove(mutation); - }); - }); - } - getAll() { - return [...this.#mutations.values()].flat(); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => (0, import_utils.matchMutation)(filters, mutation)); - } - notify(event) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return import_notifyManager.notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(import_utils.noop)) - ) - ); - } -}; -function scopeFor(mutation) { - return mutation.options.scope?.id ?? String(mutation.mutationId); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationCache -}); -//# sourceMappingURL=mutationCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map deleted file mode 100644 index da9a32386571106d88125cc5767da58f524ddf9d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type { DefaultError, MutationOptions, NotifyEvent } from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Map()\n this.#mutationId = Date.now()\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n const mutations = this.#mutations.get(scope) ?? []\n mutations.push(mutation)\n this.#mutations.set(scope, mutations)\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n if (this.#mutations.has(scope)) {\n const mutations = this.#mutations\n .get(scope)\n ?.filter((x) => x !== mutation)\n if (mutations) {\n if (mutations.length === 0) {\n this.#mutations.delete(scope)\n } else {\n this.#mutations.set(scope, mutations)\n }\n }\n }\n\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const firstPendingMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m.state.status === 'pending')\n\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n }\n\n runNext(mutation: Mutation): Promise {\n const foundMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((mutation) => {\n this.remove(mutation)\n })\n })\n }\n\n getAll(): Array {\n return [...this.#mutations.values()].flat()\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TContext = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id ?? String(mutation.mutationId)\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts deleted file mode 100644 index 2721783142bad18b147228854ee4ca9bcc276c90..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { M as MutationCache, d as MutationCacheNotifyEvent } from './hydration-BXpkOXt5.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map b/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map deleted file mode 100644 index 058e59dc89adc8965d9a2ca16b8b6beaf3372c7b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type { DefaultError, MutationOptions, NotifyEvent } from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Map()\n this.#mutationId = Date.now()\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n const mutations = this.#mutations.get(scope) ?? []\n mutations.push(mutation)\n this.#mutations.set(scope, mutations)\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n const scope = scopeFor(mutation)\n if (this.#mutations.has(scope)) {\n const mutations = this.#mutations\n .get(scope)\n ?.filter((x) => x !== mutation)\n if (mutations) {\n if (mutations.length === 0) {\n this.#mutations.delete(scope)\n } else {\n this.#mutations.set(scope, mutations)\n }\n }\n }\n\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const firstPendingMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m.state.status === 'pending')\n\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n }\n\n runNext(mutation: Mutation): Promise {\n const foundMutation = this.#mutations\n .get(scopeFor(mutation))\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((mutation) => {\n this.remove(mutation)\n })\n })\n }\n\n getAll(): Array {\n return [...this.#mutations.values()].flat()\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TContext = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id ?? String(mutation.mutationId)\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs deleted file mode 100644 index f53f065ec6886f8d676b654fe9065f13ff8bee8b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutationObserver.ts -var mutationObserver_exports = {}; -__export(mutationObserver_exports, { - MutationObserver: () => MutationObserver -}); -module.exports = __toCommonJS(mutationObserver_exports); -var import_mutation = require("./mutation.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var MutationObserver = class extends import_subscribable.Subscribable { - #client; - #currentResult = void 0; - #currentMutation; - #mutateOptions; - constructor(client, options) { - super(); - this.#client = client; - this.setOptions(options); - this.bindMethods(); - this.#updateResult(); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - const prevOptions = this.options; - this.options = this.#client.defaultMutationOptions(options); - if (!(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: this.#currentMutation, - observer: this - }); - } - if (prevOptions?.mutationKey && this.options.mutationKey && (0, import_utils.hashKey)(prevOptions.mutationKey) !== (0, import_utils.hashKey)(this.options.mutationKey)) { - this.reset(); - } else if (this.#currentMutation?.state.status === "pending") { - this.#currentMutation.setOptions(this.options); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this); - } - } - onMutationUpdate(action) { - this.#updateResult(); - this.#notify(action); - } - getCurrentResult() { - return this.#currentResult; - } - reset() { - this.#currentMutation?.removeObserver(this); - this.#currentMutation = void 0; - this.#updateResult(); - this.#notify(); - } - mutate(variables, options) { - this.#mutateOptions = options; - this.#currentMutation?.removeObserver(this); - this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); - this.#currentMutation.addObserver(this); - return this.#currentMutation.execute(variables); - } - #updateResult() { - const state = this.#currentMutation?.state ?? (0, import_mutation.getDefaultState)(); - this.#currentResult = { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }; - } - #notify(action) { - import_notifyManager.notifyManager.batch(() => { - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables; - const context = this.#currentResult.context; - if (action?.type === "success") { - this.#mutateOptions.onSuccess?.(action.data, variables, context); - this.#mutateOptions.onSettled?.(action.data, null, variables, context); - } else if (action?.type === "error") { - this.#mutateOptions.onError?.(action.error, variables, context); - this.#mutateOptions.onSettled?.( - void 0, - action.error, - variables, - context - ); - } - } - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - }); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationObserver -}); -//# sourceMappingURL=mutationObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map deleted file mode 100644 index 07ea2980121c14967ba2ea8c0422e8874324b157..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult =\n undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(action: Action): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TContext\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const context = this.#currentResult.context\n\n if (action?.type === 'success') {\n this.#mutateOptions.onSuccess?.(action.data, variables, context!)\n this.#mutateOptions.onSettled?.(action.data, null, variables, context)\n } else if (action?.type === 'error') {\n this.#mutateOptions.onError?.(action.error, variables, context)\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n context,\n )\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts deleted file mode 100644 index 9404b76d8df3e765cec35ea06d68fe3cae01dabe..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { e as MutationObserver } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts deleted file mode 100644 index 68158f2a41b53e9efbc2ab338651425700ef7b4b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { e as MutationObserver } from './hydration-mKPlgzt9.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js deleted file mode 100644 index b6f0434db1d78fbd6b26201a8d184f5434263471..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js +++ /dev/null @@ -1,102 +0,0 @@ -// src/mutationObserver.ts -import { getDefaultState } from "./mutation.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -import { hashKey, shallowEqualObjects } from "./utils.js"; -var MutationObserver = class extends Subscribable { - #client; - #currentResult = void 0; - #currentMutation; - #mutateOptions; - constructor(client, options) { - super(); - this.#client = client; - this.setOptions(options); - this.bindMethods(); - this.#updateResult(); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - const prevOptions = this.options; - this.options = this.#client.defaultMutationOptions(options); - if (!shallowEqualObjects(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: this.#currentMutation, - observer: this - }); - } - if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { - this.reset(); - } else if (this.#currentMutation?.state.status === "pending") { - this.#currentMutation.setOptions(this.options); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this); - } - } - onMutationUpdate(action) { - this.#updateResult(); - this.#notify(action); - } - getCurrentResult() { - return this.#currentResult; - } - reset() { - this.#currentMutation?.removeObserver(this); - this.#currentMutation = void 0; - this.#updateResult(); - this.#notify(); - } - mutate(variables, options) { - this.#mutateOptions = options; - this.#currentMutation?.removeObserver(this); - this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); - this.#currentMutation.addObserver(this); - return this.#currentMutation.execute(variables); - } - #updateResult() { - const state = this.#currentMutation?.state ?? getDefaultState(); - this.#currentResult = { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }; - } - #notify(action) { - notifyManager.batch(() => { - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables; - const context = this.#currentResult.context; - if (action?.type === "success") { - this.#mutateOptions.onSuccess?.(action.data, variables, context); - this.#mutateOptions.onSettled?.(action.data, null, variables, context); - } else if (action?.type === "error") { - this.#mutateOptions.onError?.(action.error, variables, context); - this.#mutateOptions.onSettled?.( - void 0, - action.error, - variables, - context - ); - } - } - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - }); - } -}; -export { - MutationObserver -}; -//# sourceMappingURL=mutationObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map deleted file mode 100644 index 7266cda49416705b57f24bae361b78d55809f81b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult =\n undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(action: Action): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TContext\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const context = this.#currentResult.context\n\n if (action?.type === 'success') {\n this.#mutateOptions.onSuccess?.(action.data, variables, context!)\n this.#mutateOptions.onSettled?.(action.data, null, variables, context)\n } else if (action?.type === 'error') {\n this.#mutateOptions.onError?.(action.error, variables, context)\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n context,\n )\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs deleted file mode 100644 index e915e77720edaf58c73048a79ae089b80c7efa07..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/notifyManager.ts -var notifyManager_exports = {}; -__export(notifyManager_exports, { - createNotifyManager: () => createNotifyManager, - notifyManager: () => notifyManager -}); -module.exports = __toCommonJS(notifyManager_exports); -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = (cb) => setTimeout(cb, 0); - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createNotifyManager, - notifyManager -}); -//# sourceMappingURL=notifyManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map deleted file mode 100644 index c990a2813019db4663592df5b1b481f64e7d6717..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAA+B,CAAC,OAAO,WAAW,IAAI,CAAC;AAE3D,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts deleted file mode 100644 index 57955e77debb00a0ac4bafd117ec517f0d99277d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts +++ /dev/null @@ -1,45 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts deleted file mode 100644 index 57955e77debb00a0ac4bafd117ec517f0d99277d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: (callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.js b/node_modules/@tanstack/query-core/build/modern/notifyManager.js deleted file mode 100644 index 00507bcee6a8e0223b512a8fd0cac885b093c14d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.js +++ /dev/null @@ -1,83 +0,0 @@ -// src/notifyManager.ts -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = (cb) => setTimeout(cb, 0); - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -export { - createNotifyManager, - notifyManager -}; -//# sourceMappingURL=notifyManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map b/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map deleted file mode 100644 index f5e35bb1e909fbd643ae2b7fb6d1dc8b8734389f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";AAYO,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAA+B,CAAC,OAAO,WAAW,IAAI,CAAC;AAE3D,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs deleted file mode 100644 index 69196cf96296774af5945e05cf9b01ac769d673e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/onlineManager.ts -var onlineManager_exports = {}; -__export(onlineManager_exports, { - OnlineManager: () => OnlineManager, - onlineManager: () => onlineManager -}); -module.exports = __toCommonJS(onlineManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var OnlineManager = class extends import_subscribable.Subscribable { - #online = true; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onOnline) => { - if (!import_utils.isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup(this.setOnline.bind(this)); - } - setOnline(online) { - const changed = this.#online !== online; - if (changed) { - this.#online = online; - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return this.#online; - } -}; -var onlineManager = new OnlineManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - OnlineManager, - onlineManager -}); -//# sourceMappingURL=onlineManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts deleted file mode 100644 index 4362a5c84c19c3abd125e3d39609af233c6c7d69..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (online: boolean) => void; -type SetupFn = (setOnline: Listener) => (() => void) | undefined; -declare class OnlineManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setOnline(online: boolean): void; - isOnline(): boolean; -} -declare const onlineManager: OnlineManager; - -export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.js b/node_modules/@tanstack/query-core/build/modern/onlineManager.js deleted file mode 100644 index 2adb2ad682a58429d586195f035c50a0c956aeab..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.js +++ /dev/null @@ -1,58 +0,0 @@ -// src/onlineManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var OnlineManager = class extends Subscribable { - #online = true; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onOnline) => { - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup(this.setOnline.bind(this)); - } - setOnline(online) { - const changed = this.#online !== online; - if (changed) { - this.#online = online; - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return this.#online; - } -}; -var onlineManager = new OnlineManager(); -export { - OnlineManager, - onlineManager -}; -//# sourceMappingURL=onlineManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map b/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map deleted file mode 100644 index 8530d4c9750d14c5e8c97dea0bc92bff8033f946..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAKlB,IAAM,gBAAN,cAA4B,aAAuB;AAAA,EACxD,UAAU;AAAA,EACV;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,KAAK,YAAY;AAEjC,QAAI,SAAS;AACX,WAAK,UAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AACF;AAEO,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map deleted file mode 100644 index 053d32f52844e1bd333dfc3c287b11269901a981..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\n\nfunction difference(array1: Array, array2: Array): Array {\n return array1.filter((x) => !array2.includes(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n notifyOptions?: NotifyOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map((query) => query.queryHash)\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions, notifyOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return\n }\n\n this.#observers = newObservers\n this.#result = newResult\n\n if (!this.hasListeners()) {\n return\n }\n\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine)\n },\n () => {\n return this.#trackResult(result, queries)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n queries: Array,\n ) {\n const matches = this.#findMatchingObservers(queries)\n\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n ): TCombinedResult {\n if (combine) {\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map(\n this.#observers.map((observer) => [observer.options.queryHash, observer]),\n )\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)\n if (match) {\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer: match,\n })\n } else {\n const existingObserver = this.#observers.find(\n (o) => o.options.queryHash === defaultedOptions.queryHash,\n )\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer:\n existingObserver ??\n new QueryObserver(this.#client, defaultedOptions),\n })\n }\n })\n\n return observers.sort((a, b) => {\n return (\n queries.findIndex(\n (q) => q.queryHash === a.defaultedQueryOptions.queryHash,\n ) -\n queries.findIndex(\n (q) => q.queryHash === b.defaultedQueryOptions.queryHash,\n )\n )\n })\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newResult = this.#combineResult(\n this.#trackResult(this.#result, this.#queries),\n this.#options?.combine,\n )\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts deleted file mode 100644 index 2cb110c8db10f1da6151afea73351f284caabd26..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts +++ /dev/null @@ -1,27 +0,0 @@ -import { av as QueryObserverResult, b as QueryClient, a4 as QueryObserverOptions, a_ as NotifyOptions, u as Query, A as QueryKey, c as QueryObserver } from './hydration-BXpkOXt5.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type QueriesObserverListener = (result: Array) => void; -type CombineFn = (result: Array) => TCombinedResult; -interface QueriesObserverOptions> { - combine?: CombineFn; -} -declare class QueriesObserver> extends Subscribable { - #private; - constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - destroy(): void; - setQueries(queries: Array, options?: QueriesObserverOptions, notifyOptions?: NotifyOptions): void; - getCurrentResult(): Array; - getQueries(): Query[]; - getObservers(): QueryObserver[]; - getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array - ]; -} - -export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js deleted file mode 100644 index 40f9aca534c2726c97ca8744dee734188f187e44..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js +++ /dev/null @@ -1,202 +0,0 @@ -// src/queriesObserver.ts -import { notifyManager } from "./notifyManager.js"; -import { QueryObserver } from "./queryObserver.js"; -import { Subscribable } from "./subscribable.js"; -import { replaceEqualDeep } from "./utils.js"; -function difference(array1, array2) { - return array1.filter((x) => !array2.includes(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var QueriesObserver = class extends Subscribable { - #client; - #result; - #queries; - #options; - #observers; - #combinedResult; - #lastCombine; - #lastResult; - constructor(client, queries, options) { - super(); - this.#client = client; - this.#options = options; - this.#queries = []; - this.#observers = []; - this.#result = []; - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#observers.forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#observers.forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options, notifyOptions) { - this.#queries = queries; - this.#options = options; - if (process.env.NODE_ENV !== "production") { - const queryHashes = queries.map((query) => query.queryHash); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - notifyManager.batch(() => { - const prevObservers = this.#observers; - const newObserverMatches = this.#findMatchingObservers(this.#queries); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions, notifyOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - if (prevObservers.length === newObservers.length && !hasIndexChange) { - return; - } - this.#observers = newObservers; - this.#result = newResult; - if (!this.hasListeners()) { - return; - } - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - this.#notify(); - }); - } - getCurrentResult() { - return this.#result; - } - getQueries() { - return this.#observers.map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return this.#observers; - } - getOptimisticResult(queries, combine) { - const matches = this.#findMatchingObservers(queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - return [ - result, - (r) => { - return this.#combineResult(r ?? result, combine); - }, - () => { - return this.#trackResult(result, queries); - } - ]; - } - #trackResult(result, queries) { - const matches = this.#findMatchingObservers(queries); - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); - } - #combineResult(input, combine) { - if (combine) { - if (!this.#combinedResult || this.#result !== this.#lastResult || combine !== this.#lastCombine) { - this.#lastCombine = combine; - this.#lastResult = this.#result; - this.#combinedResult = replaceEqualDeep( - this.#combinedResult, - combine(input) - ); - } - return this.#combinedResult; - } - return input; - } - #findMatchingObservers(queries) { - const prevObserversMap = new Map( - this.#observers.map((observer) => [observer.options.queryHash, observer]) - ); - const observers = []; - queries.forEach((options) => { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const match = prevObserversMap.get(defaultedOptions.queryHash); - if (match) { - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer: match - }); - } else { - const existingObserver = this.#observers.find( - (o) => o.options.queryHash === defaultedOptions.queryHash - ); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer: existingObserver ?? new QueryObserver(this.#client, defaultedOptions) - }); - } - }); - return observers.sort((a, b) => { - return queries.findIndex( - (q) => q.queryHash === a.defaultedQueryOptions.queryHash - ) - queries.findIndex( - (q) => q.queryHash === b.defaultedQueryOptions.queryHash - ); - }); - } - #onUpdate(observer, result) { - const index = this.#observers.indexOf(observer); - if (index !== -1) { - this.#result = replaceAt(this.#result, index, result); - this.#notify(); - } - } - #notify() { - if (this.hasListeners()) { - const previousResult = this.#combinedResult; - const newResult = this.#combineResult( - this.#trackResult(this.#result, this.#queries), - this.#options?.combine - ); - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(this.#result); - }); - }); - } - } - } -}; -export { - QueriesObserver -}; -//# sourceMappingURL=queriesObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map deleted file mode 100644 index 6bb51d14b20f1f7929785d9d12cabb235db9ad9d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\n\nfunction difference(array1: Array, array2: Array): Array {\n return array1.filter((x) => !array2.includes(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n notifyOptions?: NotifyOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map((query) => query.queryHash)\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions, notifyOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return\n }\n\n this.#observers = newObservers\n this.#result = newResult\n\n if (!this.hasListeners()) {\n return\n }\n\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine)\n },\n () => {\n return this.#trackResult(result, queries)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n queries: Array,\n ) {\n const matches = this.#findMatchingObservers(queries)\n\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n ): TCombinedResult {\n if (combine) {\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map(\n this.#observers.map((observer) => [observer.options.queryHash, observer]),\n )\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)\n if (match) {\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer: match,\n })\n } else {\n const existingObserver = this.#observers.find(\n (o) => o.options.queryHash === defaultedOptions.queryHash,\n )\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer:\n existingObserver ??\n new QueryObserver(this.#client, defaultedOptions),\n })\n }\n })\n\n return observers.sort((a, b) => {\n return (\n queries.findIndex(\n (q) => q.queryHash === a.defaultedQueryOptions.queryHash,\n ) -\n queries.findIndex(\n (q) => q.queryHash === b.defaultedQueryOptions.queryHash,\n )\n )\n })\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newResult = this.#combineResult(\n this.#trackResult(this.#result, this.#queries),\n this.#options?.combine,\n )\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.cjs b/node_modules/@tanstack/query-core/build/modern/query.cjs deleted file mode 100644 index 4e3f62b18ad5d61702175bfcc6f9d70193640822..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/query.cjs +++ /dev/null @@ -1,402 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/query.ts -var query_exports = {}; -__export(query_exports, { - Query: () => Query, - fetchState: () => fetchState -}); -module.exports = __toCommonJS(query_exports); -var import_utils = require("./utils.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_retryer = require("./retryer.cjs"); -var import_removable = require("./removable.cjs"); -var Query = class extends import_removable.Removable { - #initialState; - #revertState; - #cache; - #retryer; - #defaultOptions; - #abortSignalConsumed; - constructor(config) { - super(); - this.#abortSignalConsumed = false; - this.#defaultOptions = config.defaultOptions; - this.setOptions(config.options); - this.observers = []; - this.#cache = config.cache; - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - this.#initialState = getDefaultState(this.options); - this.state = config.state ?? this.#initialState; - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - return this.#retryer?.promise; - } - setOptions(options) { - this.options = { ...this.#defaultOptions, ...options }; - this.updateGcTime(this.options.gcTime); - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - this.#cache.remove(this); - } - } - setData(newData, options) { - const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); - this.#dispatch({ - data, - type: "success", - dataUpdatedAt: options?.updatedAt, - manual: options?.manual - }); - return data; - } - setState(state, setStateOptions) { - this.#dispatch({ type: "setState", state, setStateOptions }); - } - cancel(options) { - const promise = this.#retryer?.promise; - this.#retryer?.cancel(options); - return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(this.#initialState); - } - isActive() { - return this.observers.some( - (observer) => (0, import_utils.resolveEnabled)(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === import_utils.skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStale() { - if (this.state.isInvalidated) { - return true; - } - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0; - } - isStaleByTime(staleTime = 0) { - return this.state.isInvalidated || this.state.data === void 0 || !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - onOnline() { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - this.#cache.notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }); - } else { - this.#retryer.cancelRetry(); - } - } - this.scheduleGc(); - } - this.#cache.notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - this.#dispatch({ type: "invalidate" }); - } - } - fetch(options, fetchOptions) { - if (this.state.fetchStatus !== "idle") { - if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { - this.cancel({ silent: true }); - } else if (this.#retryer) { - this.#retryer.continueRetry(); - return this.#retryer.promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true; - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = (0, import_utils.ensureQueryFn)(this.options, fetchOptions); - const queryFnContext = { - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext); - this.#abortSignalConsumed = false; - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const context = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - state: this.state, - fetchFn - }; - addSignalProperty(context); - this.options.behavior?.onFetch( - context, - this - ); - this.#revertState = this.state; - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { - this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); - } - const onError = (error) => { - if (!((0, import_retryer.isCancelledError)(error) && error.silent)) { - this.#dispatch({ - type: "error", - error - }); - } - if (!(0, import_retryer.isCancelledError)(error)) { - this.#cache.config.onError?.( - error, - this - ); - this.#cache.config.onSettled?.( - this.state.data, - error, - this - ); - } - this.scheduleGc(); - }; - this.#retryer = (0, import_retryer.createRetryer)({ - initialPromise: fetchOptions?.initialPromise, - fn: context.fetchFn, - abort: abortController.abort.bind(abortController), - onSuccess: (data) => { - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - onError(new Error(`${this.queryHash} data is undefined`)); - return; - } - try { - this.setData(data); - } catch (error) { - onError(error); - return; - } - this.#cache.config.onSuccess?.(data, this); - this.#cache.config.onSettled?.( - data, - this.state.error, - this - ); - this.scheduleGc(); - }, - onError, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - }); - return this.#retryer.start(); - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - return { - ...state, - data: action.data, - dataUpdateCount: state.dataUpdateCount + 1, - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success", - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - case "error": - const error = action.error; - if ((0, import_retryer.isCancelledError)(error) && error.revert && this.#revertState) { - return { ...this.#revertState, fetchStatus: "idle" }; - } - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error" - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - this.#cache.notify({ query: this, type: "updated", action }); - }); - } -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: (0, import_retryer.canFetch)(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Query, - fetchState -}); -//# sourceMappingURL=query.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.cjs.map b/node_modules/@tanstack/query-core/build/modern/query.cjs.map deleted file mode 100644 index 9188727ebf647719b9e60b2a5a46a07c0836e53d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/query.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { canFetch, createRetryer, isCancelledError } from './retryer'\nimport { Removable } from './removable'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n} from './types'\nimport type { QueryCache } from './queryCache'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n cache: QueryCache\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#cache = config.cache\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStale(): boolean {\n if (this.state.isInvalidated) {\n return true\n }\n\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined\n }\n\n isStaleByTime(staleTime = 0): boolean {\n return (\n this.state.isInvalidated ||\n this.state.data === undefined ||\n !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n )\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `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']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: this.queryKey,\n meta: this.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn as QueryFunction,\n queryFnContext as QueryFunctionContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext as QueryFunctionContext)\n }\n\n // Trigger behavior hook\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n\n this.options.behavior?.onFetch(\n context as FetchContext,\n this as unknown as Query,\n )\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n const onError = (error: TError | { silent?: boolean }) => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n }\n\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n onError(new Error(`${this.queryHash} data is undefined`) as any)\n return\n }\n\n try {\n this.setData(data)\n } catch (error) {\n onError(error as TError)\n return\n }\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n\n // Schedule query gc after fetching\n this.scheduleGc()\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n return this.#retryer.start()\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n case 'error':\n const error = action.error\n\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: 'idle' }\n }\n\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? (options.initialDataUpdatedAt as () => number | undefined)()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.d.cts b/node_modules/@tanstack/query-core/build/modern/query.d.cts deleted file mode 100644 index 7421e44321ef2b6e6372b0e656d9a43b31ce6b00..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/query.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.cjs'; -export { b3 as Action, a$ as FetchContext, b0 as FetchDirection, b1 as FetchMeta, b2 as FetchOptions, u as Query, aZ as QueryBehavior, t as QueryState, b4 as SetStateOptions, b5 as fetchState } from './hydration-BXpkOXt5.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/query.d.ts b/node_modules/@tanstack/query-core/build/modern/query.d.ts deleted file mode 100644 index 3ec6a1b2f17d630bf1b69b783c5d0783310f148b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/query.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.js'; -export { b3 as Action, a$ as FetchContext, b0 as FetchDirection, b1 as FetchMeta, b2 as FetchOptions, u as Query, aZ as QueryBehavior, t as QueryState, b4 as SetStateOptions, b5 as fetchState } from './hydration-mKPlgzt9.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/query.js b/node_modules/@tanstack/query-core/build/modern/query.js deleted file mode 100644 index 48d3050400e47156b0476522fca2126c921148fa..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/query.js +++ /dev/null @@ -1,383 +0,0 @@ -// src/query.ts -import { - ensureQueryFn, - noop, - replaceData, - resolveEnabled, - skipToken, - timeUntilStale -} from "./utils.js"; -import { notifyManager } from "./notifyManager.js"; -import { canFetch, createRetryer, isCancelledError } from "./retryer.js"; -import { Removable } from "./removable.js"; -var Query = class extends Removable { - #initialState; - #revertState; - #cache; - #retryer; - #defaultOptions; - #abortSignalConsumed; - constructor(config) { - super(); - this.#abortSignalConsumed = false; - this.#defaultOptions = config.defaultOptions; - this.setOptions(config.options); - this.observers = []; - this.#cache = config.cache; - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - this.#initialState = getDefaultState(this.options); - this.state = config.state ?? this.#initialState; - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - return this.#retryer?.promise; - } - setOptions(options) { - this.options = { ...this.#defaultOptions, ...options }; - this.updateGcTime(this.options.gcTime); - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - this.#cache.remove(this); - } - } - setData(newData, options) { - const data = replaceData(this.state.data, newData, this.options); - this.#dispatch({ - data, - type: "success", - dataUpdatedAt: options?.updatedAt, - manual: options?.manual - }); - return data; - } - setState(state, setStateOptions) { - this.#dispatch({ type: "setState", state, setStateOptions }); - } - cancel(options) { - const promise = this.#retryer?.promise; - this.#retryer?.cancel(options); - return promise ? promise.then(noop).catch(noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(this.#initialState); - } - isActive() { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStale() { - if (this.state.isInvalidated) { - return true; - } - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0; - } - isStaleByTime(staleTime = 0) { - return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - onOnline() { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - this.#cache.notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }); - } else { - this.#retryer.cancelRetry(); - } - } - this.scheduleGc(); - } - this.#cache.notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - this.#dispatch({ type: "invalidate" }); - } - } - fetch(options, fetchOptions) { - if (this.state.fetchStatus !== "idle") { - if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { - this.cancel({ silent: true }); - } else if (this.#retryer) { - this.#retryer.continueRetry(); - return this.#retryer.promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true; - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions); - const queryFnContext = { - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext); - this.#abortSignalConsumed = false; - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const context = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - state: this.state, - fetchFn - }; - addSignalProperty(context); - this.options.behavior?.onFetch( - context, - this - ); - this.#revertState = this.state; - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { - this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); - } - const onError = (error) => { - if (!(isCancelledError(error) && error.silent)) { - this.#dispatch({ - type: "error", - error - }); - } - if (!isCancelledError(error)) { - this.#cache.config.onError?.( - error, - this - ); - this.#cache.config.onSettled?.( - this.state.data, - error, - this - ); - } - this.scheduleGc(); - }; - this.#retryer = createRetryer({ - initialPromise: fetchOptions?.initialPromise, - fn: context.fetchFn, - abort: abortController.abort.bind(abortController), - onSuccess: (data) => { - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - onError(new Error(`${this.queryHash} data is undefined`)); - return; - } - try { - this.setData(data); - } catch (error) { - onError(error); - return; - } - this.#cache.config.onSuccess?.(data, this); - this.#cache.config.onSettled?.( - data, - this.state.error, - this - ); - this.scheduleGc(); - }, - onError, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - }); - return this.#retryer.start(); - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - return { - ...state, - data: action.data, - dataUpdateCount: state.dataUpdateCount + 1, - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success", - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - case "error": - const error = action.error; - if (isCancelledError(error) && error.revert && this.#revertState) { - return { ...this.#revertState, fetchStatus: "idle" }; - } - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error" - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - this.#cache.notify({ query: this, type: "updated", action }); - }); - } -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -export { - Query, - fetchState -}; -//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.js.map b/node_modules/@tanstack/query-core/build/modern/query.js.map deleted file mode 100644 index 45a1cda5c754ab50d4c10d3856f19002af5d1414..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/query.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { canFetch, createRetryer, isCancelledError } from './retryer'\nimport { Removable } from './removable'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n} from './types'\nimport type { QueryCache } from './queryCache'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n cache: QueryCache\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#cache = config.cache\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStale(): boolean {\n if (this.state.isInvalidated) {\n return true\n }\n\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined\n }\n\n isStaleByTime(staleTime = 0): boolean {\n return (\n this.state.isInvalidated ||\n this.state.data === undefined ||\n !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n )\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `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']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n queryKey: this.queryKey,\n meta: this.meta,\n }\n\n addSignalProperty(queryFnContext)\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn as QueryFunction,\n queryFnContext as QueryFunctionContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext as QueryFunctionContext)\n }\n\n // Trigger behavior hook\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n\n this.options.behavior?.onFetch(\n context as FetchContext,\n this as unknown as Query,\n )\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n const onError = (error: TError | { silent?: boolean }) => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n }\n\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n onError(new Error(`${this.queryHash} data is undefined`) as any)\n return\n }\n\n try {\n this.setData(data)\n } catch (error) {\n onError(error as TError)\n return\n }\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n\n // Schedule query gc after fetching\n this.scheduleGc()\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n return this.#retryer.start()\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n case 'error':\n const error = action.error\n\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: 'idle' }\n }\n\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? (options.initialDataUpdatedAt as () => number | undefined)()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map deleted file mode 100644 index 1d9e8cad928fb6590686068c815ed16ae94e0b86..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkD;AAClD,mBAAsB;AACtB,2BAA8B;AAC9B,0BAA6B;AAwFtB,IAAM,aAAN,cAAyB,iCAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAEjB,SAAK,WAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EALA;AAAA,EAOA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,iBAAa,oCAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,mBAAM;AAAA,QAChB,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,OAAwC;AAC1C,QAAI,CAAC,KAAK,SAAS,IAAI,MAAM,SAAS,GAAG;AACvC,WAAK,SAAS,IAAI,MAAM,WAAW,KAAK;AAExC,WAAK,OAAO;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,OAAO,OAAwC;AAC7C,UAAM,aAAa,KAAK,SAAS,IAAI,MAAM,SAAS;AAEpD,QAAI,YAAY;AACd,YAAM,QAAQ;AAEd,UAAI,eAAe,OAAO;AACxB,aAAK,SAAS,OAAO,MAAM,SAAS;AAAA,MACtC;AAEA,WAAK,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACxC;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,aAAK,OAAO,KAAK;AAAA,MACnB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,IAME,WAC2D;AAC3D,WAAO,KAAK,SAAS,IAAI,SAAS;AAAA,EAGpC;AAAA,EAEA,SAAuB;AACrB,WAAO,CAAC,GAAG,KAAK,SAAS,OAAO,CAAC;AAAA,EACnC;AAAA,EAEA,KACE,SACgD;AAChD,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,cACzB,yBAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAAwB,CAAC,GAAiB;AAChD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,cAAU,yBAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts b/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts deleted file mode 100644 index 1efcf0a487f1265a41c8f913670fdcb478b57493..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { Q as QueryCache, a as QueryCacheNotifyEvent, bn as QueryStore } from './hydration-BXpkOXt5.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.js b/node_modules/@tanstack/query-core/build/modern/queryCache.js deleted file mode 100644 index 5db5761fc14aa461fe699079a56cd4ec93ea2df8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.js +++ /dev/null @@ -1,97 +0,0 @@ -// src/queryCache.ts -import { hashQueryKeyByOptions, matchQuery } from "./utils.js"; -import { Query } from "./query.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -var QueryCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#queries = /* @__PURE__ */ new Map(); - } - #queries; - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new Query({ - cache: this, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!this.#queries.has(query.queryHash)) { - this.#queries.set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = this.#queries.get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - this.#queries.delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return this.#queries.get(queryHash); - } - getAll() { - return [...this.#queries.values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => matchQuery(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; -export { - QueryCache -}; -//# sourceMappingURL=queryCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.js.map b/node_modules/@tanstack/query-core/build/modern/queryCache.js.map deleted file mode 100644 index aa79c9e01ef292470cecf4e2a6abf61bb2ccc0c8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAwFtB,IAAM,aAAN,cAAyB,aAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAEjB,SAAK,WAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EALA;AAAA,EAOA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,aAAa,sBAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,MAAM;AAAA,QAChB,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,OAAwC;AAC1C,QAAI,CAAC,KAAK,SAAS,IAAI,MAAM,SAAS,GAAG;AACvC,WAAK,SAAS,IAAI,MAAM,WAAW,KAAK;AAExC,WAAK,OAAO;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,OAAO,OAAwC;AAC7C,UAAM,aAAa,KAAK,SAAS,IAAI,MAAM,SAAS;AAEpD,QAAI,YAAY;AACd,YAAM,QAAQ;AAEd,UAAI,eAAe,OAAO;AACxB,aAAK,SAAS,OAAO,MAAM,SAAS;AAAA,MACtC;AAEA,WAAK,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACxC;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,aAAK,OAAO,KAAK;AAAA,MACnB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,IAME,WAC2D;AAC3D,WAAO,KAAK,SAAS,IAAI,SAAS;AAAA,EAGpC;AAAA,EAEA,SAAuB;AACrB,WAAO,CAAC,GAAG,KAAK,SAAS,OAAO,CAAC;AAAA,EACnC;AAAA,EAEA,KACE,SACgD;AAChD,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,UACzB,WAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAAwB,CAAC,GAAiB;AAChD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,UAAU,WAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,kBAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs deleted file mode 100644 index a785dd7782c9b7aa4b09812251f03a9b03e4e49b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs +++ /dev/null @@ -1,312 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryClient.ts -var queryClient_exports = {}; -__export(queryClient_exports, { - QueryClient: () => QueryClient -}); -module.exports = __toCommonJS(queryClient_exports); -var import_utils = require("./utils.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var QueryClient = class { - #queryCache; - #mutationCache; - #defaultOptions; - #queryDefaults; - #mutationDefaults; - #mountCount; - #unsubscribeFocus; - #unsubscribeOnline; - constructor(config = {}) { - this.#queryCache = config.queryCache || new import_queryCache.QueryCache(); - this.#mutationCache = config.mutationCache || new import_mutationCache.MutationCache(); - this.#defaultOptions = config.defaultOptions || {}; - this.#queryDefaults = /* @__PURE__ */ new Map(); - this.#mutationDefaults = /* @__PURE__ */ new Map(); - this.#mountCount = 0; - } - mount() { - this.#mountCount++; - if (this.#mountCount !== 1) - return; - this.#unsubscribeFocus = import_focusManager.focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - this.#queryCache.onFocus(); - } - }); - this.#unsubscribeOnline = import_onlineManager.onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - this.#queryCache.onOnline(); - } - }); - } - unmount() { - this.#mountCount--; - if (this.#mountCount !== 0) - return; - this.#unsubscribeFocus?.(); - this.#unsubscribeFocus = void 0; - this.#unsubscribeOnline?.(); - this.#unsubscribeOnline = void 0; - } - isFetching(filters) { - return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; - } - getQueryData(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state.data; - } - ensureQueryData(options) { - const cachedData = this.getQueryData(options.queryKey); - if (cachedData === void 0) - return this.fetchQuery(options); - else { - const defaultedOptions = this.defaultQueryOptions(options); - const query = this.#queryCache.build(this, defaultedOptions); - if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - } - getQueriesData(filters) { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = this.#queryCache.get( - defaultedOptions.queryHash - ); - const prevData = query?.state.data; - const data = (0, import_utils.functionalUpdate)(updater, prevData); - if (data === void 0) { - return void 0; - } - return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return import_notifyManager.notifyManager.batch( - () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state; - } - removeQueries(filters) { - const queryCache = this.#queryCache; - import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = this.#queryCache; - const refetchFilters = { - type: "active", - ...filters - }; - return import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries(refetchFilters, options); - }); - } - cancelQueries(filters = {}, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = import_notifyManager.notifyManager.batch( - () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); - } - invalidateQueries(filters = {}, options = {}) { - return import_notifyManager.notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters.refetchType === "none") { - return Promise.resolve(); - } - const refetchFilters = { - ...filters, - type: filters.refetchType ?? filters.type ?? "active" - }; - return this.refetchQueries(refetchFilters, options); - }); - } - refetchQueries(filters = {}, options) { - const fetchOptions = { - ...options, - cancelRefetch: options?.cancelRefetch ?? true - }; - const promises = import_notifyManager.notifyManager.batch( - () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(import_utils.noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(import_utils.noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = this.#queryCache.build(this, defaultedOptions); - return query.isStaleByTime( - (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - fetchInfiniteQuery(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - ensureInfiniteQueryData(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (import_onlineManager.onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return this.#queryCache; - } - getMutationCache() { - return this.#mutationCache; - } - getDefaultOptions() { - return this.#defaultOptions; - } - setDefaultOptions(options) { - this.#defaultOptions = options; - } - setQueryDefaults(queryKey, options) { - this.#queryDefaults.set((0, import_utils.hashKey)(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...this.#queryDefaults.values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - this.#mutationDefaults.set((0, import_utils.hashKey)(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...this.#mutationDefaults.values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === import_utils.skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options?._defaulted) { - return options; - } - return { - ...this.#defaultOptions.mutations, - ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - this.#queryCache.clear(); - this.#mutationCache.clear(); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClient -}); -//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map deleted file mode 100644 index 630bfe29e69fdae9e5d00dfa4a7e5368c6ec390c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DataTag,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching(filters?: QueryFilters): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating(filters?: MutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined\n getQueryData(queryKey: QueryKey) {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)?.state.data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const cachedData = this.getQueryData(options.queryKey)\n\n if (cachedData === undefined) return this.fetchQuery(options)\n else {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n }\n\n getQueriesData(\n filters: QueryFilters,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): TInferredQueryFnData | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData(\n filters: QueryFilters,\n updater: Updater,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)\n ?.state\n }\n\n removeQueries(filters?: QueryFilters): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise {\n const queryCache = this.#queryCache\n\n const refetchFilters: RefetchQueryFilters = {\n type: 'active',\n ...filters,\n }\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n cancelQueries(\n filters: QueryFilters = {},\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters: InvalidateQueryFilters = {},\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters.refetchType === 'none') {\n return Promise.resolve()\n }\n const refetchFilters: RefetchQueryFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? 'active',\n }\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n refetchQueries(\n filters: RefetchQueryFilters = {},\n options?: RefetchOptions,\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n let result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): MutationObserverOptions {\n const defaults = [...this.#mutationDefaults.values()]\n\n let result: MutationObserverOptions = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (\n defaultedOptions.enabled !== true &&\n defaultedOptions.queryFn === skipToken\n ) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts b/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts deleted file mode 100644 index b6bafe2bcce5392ffdd145afdee6d9f3f6f4cc98..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { b as QueryClient } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.js b/node_modules/@tanstack/query-core/build/modern/queryClient.js deleted file mode 100644 index 83a7de4c6ecf1c3072398bab361044bcb7cd9b93..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.js +++ /dev/null @@ -1,295 +0,0 @@ -// src/queryClient.ts -import { - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - noop, - partialMatchKey, - resolveStaleTime, - skipToken -} from "./utils.js"; -import { QueryCache } from "./queryCache.js"; -import { MutationCache } from "./mutationCache.js"; -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { notifyManager } from "./notifyManager.js"; -import { infiniteQueryBehavior } from "./infiniteQueryBehavior.js"; -var QueryClient = class { - #queryCache; - #mutationCache; - #defaultOptions; - #queryDefaults; - #mutationDefaults; - #mountCount; - #unsubscribeFocus; - #unsubscribeOnline; - constructor(config = {}) { - this.#queryCache = config.queryCache || new QueryCache(); - this.#mutationCache = config.mutationCache || new MutationCache(); - this.#defaultOptions = config.defaultOptions || {}; - this.#queryDefaults = /* @__PURE__ */ new Map(); - this.#mutationDefaults = /* @__PURE__ */ new Map(); - this.#mountCount = 0; - } - mount() { - this.#mountCount++; - if (this.#mountCount !== 1) - return; - this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - this.#queryCache.onFocus(); - } - }); - this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - this.#queryCache.onOnline(); - } - }); - } - unmount() { - this.#mountCount--; - if (this.#mountCount !== 0) - return; - this.#unsubscribeFocus?.(); - this.#unsubscribeFocus = void 0; - this.#unsubscribeOnline?.(); - this.#unsubscribeOnline = void 0; - } - isFetching(filters) { - return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; - } - getQueryData(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state.data; - } - ensureQueryData(options) { - const cachedData = this.getQueryData(options.queryKey); - if (cachedData === void 0) - return this.fetchQuery(options); - else { - const defaultedOptions = this.defaultQueryOptions(options); - const query = this.#queryCache.build(this, defaultedOptions); - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - } - getQueriesData(filters) { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = this.#queryCache.get( - defaultedOptions.queryHash - ); - const prevData = query?.state.data; - const data = functionalUpdate(updater, prevData); - if (data === void 0) { - return void 0; - } - return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return notifyManager.batch( - () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state; - } - removeQueries(filters) { - const queryCache = this.#queryCache; - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = this.#queryCache; - const refetchFilters = { - type: "active", - ...filters - }; - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries(refetchFilters, options); - }); - } - cancelQueries(filters = {}, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = notifyManager.batch( - () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(noop).catch(noop); - } - invalidateQueries(filters = {}, options = {}) { - return notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters.refetchType === "none") { - return Promise.resolve(); - } - const refetchFilters = { - ...filters, - type: filters.refetchType ?? filters.type ?? "active" - }; - return this.refetchQueries(refetchFilters, options); - }); - } - refetchQueries(filters = {}, options) { - const fetchOptions = { - ...options, - cancelRefetch: options?.cancelRefetch ?? true - }; - const promises = notifyManager.batch( - () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = this.#queryCache.build(this, defaultedOptions); - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(noop).catch(noop); - } - fetchInfiniteQuery(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(noop).catch(noop); - } - ensureInfiniteQueryData(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return this.#queryCache; - } - getMutationCache() { - return this.#mutationCache; - } - getDefaultOptions() { - return this.#defaultOptions; - } - setDefaultOptions(options) { - this.#defaultOptions = options; - } - setQueryDefaults(queryKey, options) { - this.#queryDefaults.set(hashKey(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...this.#queryDefaults.values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - this.#mutationDefaults.set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...this.#mutationDefaults.values()]; - let result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options?._defaulted) { - return options; - } - return { - ...this.#defaultOptions.mutations, - ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - this.#queryCache.clear(); - this.#mutationCache.clear(); - } -}; -export { - QueryClient -}; -//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.js.map b/node_modules/@tanstack/query-core/build/modern/queryClient.js.map deleted file mode 100644 index aff62042150d0dde6882dd79a3143c26b39421bf..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DataTag,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching(filters?: QueryFilters): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating(filters?: MutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined\n getQueryData(queryKey: QueryKey) {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)?.state.data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const cachedData = this.getQueryData(options.queryKey)\n\n if (cachedData === undefined) return this.fetchQuery(options)\n else {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n }\n\n getQueriesData(\n filters: QueryFilters,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): TInferredQueryFnData | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData(\n filters: QueryFilters,\n updater: Updater,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = TTaggedQueryKey extends DataTag<\n unknown,\n infer TaggedValue\n >\n ? TaggedValue\n : TQueryFnData,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(options.queryHash)\n ?.state\n }\n\n removeQueries(filters?: QueryFilters): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise {\n const queryCache = this.#queryCache\n\n const refetchFilters: RefetchQueryFilters = {\n type: 'active',\n ...filters,\n }\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n cancelQueries(\n filters: QueryFilters = {},\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters: InvalidateQueryFilters = {},\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters.refetchType === 'none') {\n return Promise.resolve()\n }\n const refetchFilters: RefetchQueryFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? 'active',\n }\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n refetchQueries(\n filters: RefetchQueryFilters = {},\n options?: RefetchOptions,\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n let result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): MutationObserverOptions {\n const defaults = [...this.#mutationDefaults.values()]\n\n let result: MutationObserverOptions = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions }\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (\n defaultedOptions.enabled !== true &&\n defaultedOptions.queryFn === skipToken\n ) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs deleted file mode 100644 index 10891c097565e4d417dfb9f81a2ec4d1a8b84810..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs +++ /dev/null @@ -1,496 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryObserver.ts -var queryObserver_exports = {}; -__export(queryObserver_exports, { - QueryObserver: () => QueryObserver -}); -module.exports = __toCommonJS(queryObserver_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_query = require("./query.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -var QueryObserver = class extends import_subscribable.Subscribable { - constructor(client, options) { - super(); - this.options = options; - this.#client = client; - this.#selectError = null; - this.#currentThenable = (0, import_thenable.pendingThenable)(); - if (!this.options.experimental_prefetchInRender) { - this.#currentThenable.reject( - new Error("experimental_prefetchInRender feature flag is not enabled") - ); - } - this.bindMethods(); - this.setOptions(options); - } - #client; - #currentQuery = void 0; - #currentQueryInitialState = void 0; - #currentResult = void 0; - #currentResultState; - #currentResultOptions; - #currentThenable; - #selectError; - #selectFn; - #selectResult; - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - #lastQueryWithDefinedData; - #staleTimeoutId; - #refetchIntervalId; - #currentRefetchInterval; - #trackedProps = /* @__PURE__ */ new Set(); - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#currentQuery.addObserver(this); - if (shouldFetchOnMount(this.#currentQuery, this.options)) { - this.#executeFetch(); - } else { - this.updateResult(); - } - this.#updateTimers(); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#clearStaleTimeout(); - this.#clearRefetchInterval(); - this.#currentQuery.removeObserver(this); - } - setOptions(options, notifyOptions) { - const prevOptions = this.options; - const prevQuery = this.#currentQuery; - this.options = this.#client.defaultQueryOptions(options); - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== "boolean") { - throw new Error( - "Expected enabled to be a boolean or a callback that returns a boolean" - ); - } - this.#updateQuery(); - this.#currentQuery.setOptions(this.options); - if (prevOptions._defaulted && !(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - this.#client.getQueryCache().notify({ - type: "observerOptionsUpdated", - query: this.#currentQuery, - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - this.#currentQuery, - prevQuery, - this.options, - prevOptions - )) { - this.#executeFetch(); - } - this.updateResult(notifyOptions); - if (mounted && (this.#currentQuery !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, this.#currentQuery) || (0, import_utils.resolveStaleTime)(this.options.staleTime, this.#currentQuery) !== (0, import_utils.resolveStaleTime)(prevOptions.staleTime, this.#currentQuery))) { - this.#updateStaleTimeout(); - } - const nextRefetchInterval = this.#computeRefetchInterval(); - if (mounted && (this.#currentQuery !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { - this.#updateRefetchInterval(nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = this.#client.getQueryCache().build(this.#client, options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - this.#currentResult = result; - this.#currentResultOptions = this.options; - this.#currentResultState = this.#currentQuery.state; - } - return result; - } - getCurrentResult() { - return this.#currentResult; - } - trackResult(result, onPropTracked) { - const trackedResult = {}; - Object.keys(result).forEach((key) => { - Object.defineProperty(trackedResult, key, { - configurable: false, - enumerable: true, - get: () => { - this.trackProp(key); - onPropTracked?.(key); - return result[key]; - } - }); - }); - return trackedResult; - } - trackProp(key) { - this.#trackedProps.add(key); - } - getCurrentQuery() { - return this.#currentQuery; - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return this.#executeFetch({ - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return this.#currentResult; - }); - } - #executeFetch(fetchOptions) { - this.#updateQuery(); - let promise = this.#currentQuery.fetch( - this.options, - fetchOptions - ); - if (!fetchOptions?.throwOnError) { - promise = promise.catch(import_utils.noop); - } - return promise; - } - #updateStaleTimeout() { - this.#clearStaleTimeout(); - const staleTime = (0, import_utils.resolveStaleTime)( - this.options.staleTime, - this.#currentQuery - ); - if (import_utils.isServer || this.#currentResult.isStale || !(0, import_utils.isValidTimeout)(staleTime)) { - return; - } - const time = (0, import_utils.timeUntilStale)(this.#currentResult.dataUpdatedAt, staleTime); - const timeout = time + 1; - this.#staleTimeoutId = setTimeout(() => { - if (!this.#currentResult.isStale) { - this.updateResult(); - } - }, timeout); - } - #computeRefetchInterval() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; - } - #updateRefetchInterval(nextInterval) { - this.#clearRefetchInterval(); - this.#currentRefetchInterval = nextInterval; - if (import_utils.isServer || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) === false || !(0, import_utils.isValidTimeout)(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { - return; - } - this.#refetchIntervalId = setInterval(() => { - if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { - this.#executeFetch(); - } - }, this.#currentRefetchInterval); - } - #updateTimers() { - this.#updateStaleTimeout(); - this.#updateRefetchInterval(this.#computeRefetchInterval()); - } - #clearStaleTimeout() { - if (this.#staleTimeoutId) { - clearTimeout(this.#staleTimeoutId); - this.#staleTimeoutId = void 0; - } - } - #clearRefetchInterval() { - if (this.#refetchIntervalId) { - clearInterval(this.#refetchIntervalId); - this.#refetchIntervalId = void 0; - } - } - createResult(query, options) { - const prevQuery = this.#currentQuery; - const prevOptions = this.options; - const prevResult = this.#currentResult; - const prevResultState = this.#currentResultState; - const prevResultOptions = this.#currentResultOptions; - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...(0, import_query.fetchState)(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - if (options.select && newState.data !== void 0) { - if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) { - data = this.#selectResult; - } else { - try { - this.#selectFn = options.select; - data = options.select(newState.data); - data = (0, import_utils.replaceData)(prevResult?.data, data, options); - this.#selectResult = data; - this.#selectError = null; - } catch (selectError) { - this.#selectError = selectError; - } - } - } else { - data = newState.data; - } - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { - placeholderData = prevResult.data; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - this.#lastQueryWithDefinedData?.state.data, - this.#lastQueryWithDefinedData - ) : options.placeholderData; - if (options.select && placeholderData !== void 0) { - try { - placeholderData = options.select(placeholderData); - this.#selectError = null; - } catch (selectError) { - this.#selectError = selectError; - } - } - } - if (placeholderData !== void 0) { - status = "success"; - data = (0, import_utils.replaceData)( - prevResult?.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (this.#selectError) { - error = this.#selectError; - data = this.#selectResult; - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: this.#currentThenable - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const finalizeThenableIfPossible = (thenable) => { - if (nextResult.status === "error") { - thenable.reject(nextResult.error); - } else if (nextResult.data !== void 0) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = this.#currentThenable = nextResult.promise = (0, import_thenable.pendingThenable)(); - finalizeThenableIfPossible(pending); - }; - const prevThenable = this.#currentThenable; - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (nextResult.status === "error" || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult(notifyOptions) { - const prevResult = this.#currentResult; - const nextResult = this.createResult(this.#currentQuery, this.options); - this.#currentResultState = this.#currentQuery.state; - this.#currentResultOptions = this.options; - if (this.#currentResultState.data !== void 0) { - this.#lastQueryWithDefinedData = this.#currentQuery; - } - if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { - return; - } - this.#currentResult = nextResult; - const defaultNotifyOptions = {}; - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? this.#trackedProps - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(this.#currentResult).some((key) => { - const typedKey = key; - const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - if (notifyOptions?.listeners !== false && shouldNotifyListeners()) { - defaultNotifyOptions.listeners = true; - } - this.#notify({ ...defaultNotifyOptions, ...notifyOptions }); - } - #updateQuery() { - const query = this.#client.getQueryCache().build(this.#client, this.options); - if (query === this.#currentQuery) { - return; - } - const prevQuery = this.#currentQuery; - this.#currentQuery = query; - this.#currentQueryInitialState = query.state; - if (this.hasListeners()) { - prevQuery?.removeObserver(this); - query.addObserver(this); - } - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - this.#updateTimers(); - } - } - #notify(notifyOptions) { - import_notifyManager.notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - } - this.#client.getQueryCache().notify({ - query: this.#currentQuery, - type: "observerResultsUpdated" - }); - }); - } -}; -function shouldLoadOnMount(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if ((0, import_utils.resolveEnabled)(options.enabled, query) !== false) { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || (0, import_utils.resolveEnabled)(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.isStaleByTime((0, import_utils.resolveStaleTime)(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryObserver -}); -//# sourceMappingURL=queryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map deleted file mode 100644 index 49fbfc041d05b12c29166c8a4b7375007dd5ad6e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n QueryOptions,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\nexport interface NotifyOptions {\n listeners?: boolean\n}\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ReturnType\n #refetchIntervalId?: ReturnType\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n if (!this.options.experimental_prefetchInRender) {\n this.#currentThenable.reject(\n new Error('experimental_prefetchInRender feature flag is not enabled'),\n )\n }\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n notifyOptions?: NotifyOptions,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult(notifyOptions)\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n const trackedResult = {} as QueryObserverResult\n\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n return result[key as keyof QueryObserverResult]\n },\n })\n })\n\n return trackedResult\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options as QueryOptions,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Select data if needed\n if (options.select && newState.data !== undefined) {\n // Memoize select result\n if (\n prevResult &&\n newState.data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(newState.data)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n // Use query data\n else {\n data = newState.data as unknown as TData\n }\n\n // Show placeholder data if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n } else {\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n if (options.select && placeholderData !== undefined) {\n try {\n placeholderData = options.select(placeholderData)\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError as any\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (nextResult.status === 'error') {\n thenable.reject(nextResult.error)\n } else if (nextResult.data !== undefined) {\n thenable.resolve(nextResult.data)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (\n nextResult.status === 'error' ||\n nextResult.data !== prevThenable.value\n ) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (\n nextResult.status !== 'error' ||\n nextResult.error !== prevThenable.reason\n ) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(notifyOptions?: NotifyOptions): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n // Determine which callbacks to trigger\n const defaultNotifyOptions: NotifyOptions = {}\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true\n }\n\n this.#notify({ ...defaultNotifyOptions, ...notifyOptions })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: NotifyOptions): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (resolveEnabled(options.enabled, query) !== false) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts deleted file mode 100644 index 919ac9c8b515827af0c763180dc667be6c507759..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { a_ as NotifyOptions, c as QueryObserver } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts deleted file mode 100644 index c8e840c3a83e51fc68c39a781d5208a2b574baac..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { a_ as NotifyOptions, c as QueryObserver } from './hydration-mKPlgzt9.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/removable.cjs b/node_modules/@tanstack/query-core/build/modern/removable.cjs deleted file mode 100644 index 58533b08a7c934708838d309b78cb8fb15b933a7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.cjs +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/removable.ts -var removable_exports = {}; -__export(removable_exports, { - Removable: () => Removable -}); -module.exports = __toCommonJS(removable_exports); -var import_utils = require("./utils.cjs"); -var Removable = class { - #gcTimeout; - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if ((0, import_utils.isValidTimeout)(this.gcTime)) { - this.#gcTimeout = setTimeout(() => { - this.optionalRemove(); - }, this.gcTime); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (this.#gcTimeout) { - clearTimeout(this.#gcTimeout); - this.#gcTimeout = void 0; - } - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Removable -}); -//# sourceMappingURL=removable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.cjs.map b/node_modules/@tanstack/query-core/build/modern/removable.cjs.map deleted file mode 100644 index 17276b296acbc528d8aeec4bdc938ad48f60b4a2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { isServer, isValidTimeout } from './utils'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ReturnType\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyC;AAElC,IAAe,YAAf,MAAyB;AAAA,EAE9B;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,YAAI,6BAAe,KAAK,MAAM,GAAG;AAC/B,WAAK,aAAa,WAAW,MAAM;AACjC,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,wBAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,KAAK,YAAY;AACnB,mBAAa,KAAK,UAAU;AAC5B,WAAK,aAAa;AAAA,IACpB;AAAA,EACF;AAGF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.d.ts b/node_modules/@tanstack/query-core/build/modern/removable.d.ts deleted file mode 100644 index 7b825258ea2753c461f842634e60a9c4ae0f6f1f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare abstract class Removable { - #private; - gcTime: number; - destroy(): void; - protected scheduleGc(): void; - protected updateGcTime(newGcTime: number | undefined): void; - protected clearGcTimeout(): void; - protected abstract optionalRemove(): void; -} - -export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/modern/removable.js b/node_modules/@tanstack/query-core/build/modern/removable.js deleted file mode 100644 index 4ff8bfcb74ed6d560c051f68233b3bb0c965dbbf..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.js +++ /dev/null @@ -1,32 +0,0 @@ -// src/removable.ts -import { isServer, isValidTimeout } from "./utils.js"; -var Removable = class { - #gcTimeout; - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if (isValidTimeout(this.gcTime)) { - this.#gcTimeout = setTimeout(() => { - this.optionalRemove(); - }, this.gcTime); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (this.#gcTimeout) { - clearTimeout(this.#gcTimeout); - this.#gcTimeout = void 0; - } - } -}; -export { - Removable -}; -//# sourceMappingURL=removable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.cjs b/node_modules/@tanstack/query-core/build/modern/retryer.cjs deleted file mode 100644 index 9dc1e311a071a28e1558c0c39a15c1453cc6ece0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.cjs +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/retryer.ts -var retryer_exports = {}; -__export(retryer_exports, { - CancelledError: () => CancelledError, - canFetch: () => canFetch, - createRetryer: () => createRetryer, - isCancelledError: () => isCancelledError -}); -module.exports = __toCommonJS(retryer_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options?.revert; - this.silent = options?.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let isResolved = false; - let continueFn; - const thenable = (0, import_thenable.pendingThenable)(); - const cancel = (cancelOptions) => { - if (!isResolved) { - reject(new CancelledError(cancelOptions)); - config.abort?.(); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => import_focusManager.focusManager.isFocused() && (config.networkMode === "always" || import_onlineManager.onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - if (!isResolved) { - isResolved = true; - config.onSuccess?.(value); - continueFn?.(); - thenable.resolve(value); - } - }; - const reject = (value) => { - if (!isResolved) { - isResolved = true; - config.onError?.(value); - continueFn?.(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - continueFn = (value) => { - if (isResolved || canContinue()) { - continueResolve(value); - } - }; - config.onPause?.(); - }).then(() => { - continueFn = void 0; - if (!isResolved) { - config.onContinue?.(); - } - }); - }; - const run = () => { - if (isResolved) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - if (isResolved) { - return; - } - const retry = config.retry ?? (import_utils.isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - config.onFail?.(failureCount, error); - (0, import_utils.sleep)(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - cancel, - continue: () => { - continueFn?.(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - canFetch, - createRetryer, - isCancelledError -}); -//# sourceMappingURL=retryer.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map b/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map deleted file mode 100644 index a4ae9581c8276eddfee6350d3d96c40f8a2bc28f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n abort?: () => void\n onError?: (error: TError) => void\n onSuccess?: (data: TData) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let isResolved = false\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions))\n\n config.abort?.()\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onSuccess?.(value)\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onError?.(value)\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.d.cts b/node_modules/@tanstack/query-core/build/modern/retryer.d.cts deleted file mode 100644 index 07176a6f1c2a92e528d536fb6ffd608f98ae2353..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { C as CancelledError, bs as RetryDelayValue, br as RetryValue, bq as Retryer, bt as canFetch, bu as createRetryer, l as isCancelledError } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.js.map b/node_modules/@tanstack/query-core/build/modern/retryer.js.map deleted file mode 100644 index 64f9993f0b5026f2b83e1aa2c38df31c4862a662..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n abort?: () => void\n onError?: (error: TError) => void\n onSuccess?: (data: TData) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let isResolved = false\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions))\n\n config.abort?.()\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onSuccess?.(value)\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved) {\n isResolved = true\n config.onError?.(value)\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs deleted file mode 100644 index c40260212a663cfe1429671865b8c9942db423ee..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/subscribable.ts -var subscribable_exports = {}; -__export(subscribable_exports, { - Subscribable: () => Subscribable -}); -module.exports = __toCommonJS(subscribable_exports); -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Subscribable -}); -//# sourceMappingURL=subscribable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map deleted file mode 100644 index 43f833686ac6b56783105e9e082b692fa09c5ed3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts b/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts deleted file mode 100644 index 5ac4d3d1d29a0dcca0fd226569f4e4996bda5f9d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare class Subscribable { - protected listeners: Set; - constructor(); - subscribe(listener: TListener): () => void; - hasListeners(): boolean; - protected onSubscribe(): void; - protected onUnsubscribe(): void; -} - -export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.js.map b/node_modules/@tanstack/query-core/build/modern/subscribable.js.map deleted file mode 100644 index 85f855bd115a238812f505469ed00e92bfefeb9c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.cjs b/node_modules/@tanstack/query-core/build/modern/thenable.cjs deleted file mode 100644 index ef17bd511b8a0e2f5df545913d846791ebdc4833..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.cjs +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/thenable.ts -var thenable_exports = {}; -__export(thenable_exports, { - pendingThenable: () => pendingThenable -}); -module.exports = __toCommonJS(thenable_exports); -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - pendingThenable -}); -//# sourceMappingURL=thenable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map b/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map deleted file mode 100644 index 5e0dd3fafcd754d752a9654ae2c8e9910150bf20..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCO,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.js b/node_modules/@tanstack/query-core/build/modern/thenable.js deleted file mode 100644 index 07d7dc7eb97acf1bf99979e1f269c4e1e099c0ce..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.js +++ /dev/null @@ -1,36 +0,0 @@ -// src/thenable.ts -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -export { - pendingThenable -}; -//# sourceMappingURL=thenable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.js.map b/node_modules/@tanstack/query-core/build/modern/thenable.js.map deleted file mode 100644 index 23ea0a44713f5feeb672259a2e0c521f6e22cd5f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n"],"mappings":";AAyCO,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.cjs b/node_modules/@tanstack/query-core/build/modern/types.cjs deleted file mode 100644 index d22152bc67861f6fd334ace0ed3fdd09464cc941..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/types.cjs +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.d.cts b/node_modules/@tanstack/query-core/build/modern/types.d.cts deleted file mode 100644 index 361fa747c732d1e4c8dbdcbd87d2aaa881fcf75f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/types.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { aV as CancelOptions, E as DataTag, z as DefaultError, aU as DefaultOptions, a9 as DefaultedInfiniteQueryObserverOptions, a7 as DefaultedQueryObserverOptions, aC as DefinedInfiniteQueryObserverResult, au as DefinedQueryObserverResult, I as Enabled, ac as EnsureInfiniteQueryDataOptions, ab as EnsureQueryDataOptions, ad as FetchInfiniteQueryOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, aa as FetchQueryOptions, an as FetchStatus, X as GetNextPageParamFunction, W as GetPreviousPageParamFunction, Y as InfiniteData, aw as InfiniteQueryObserverBaseResult, az as InfiniteQueryObserverLoadingErrorResult, ay as InfiniteQueryObserverLoadingResult, a8 as InfiniteQueryObserverOptions, ax as InfiniteQueryObserverPendingResult, aA as InfiniteQueryObserverRefetchErrorResult, aD as InfiniteQueryObserverResult, aB as InfiniteQueryObserverSuccessResult, a2 as InfiniteQueryPageParamsOptions, L as InitialDataFunction, a1 as InitialPageParam, ai as InvalidateOptions, ag as InvalidateQueryFilters, aM as MutateFunction, aL as MutateOptions, aI as MutationFunction, aE as MutationKey, aH as MutationMeta, aN as MutationObserverBaseResult, aQ as MutationObserverErrorResult, aO as MutationObserverIdleResult, aP as MutationObserverLoadingResult, aK as MutationObserverOptions, aS as MutationObserverResult, aR as MutationObserverSuccessResult, aJ as MutationOptions, aG as MutationScope, aF as MutationStatus, _ as NetworkMode, N as NoInfer, aY as NotifyEvent, aX as NotifyEventType, $ as NotifyOnChangeProps, O as OmitKeyof, a6 as Optional, y as Override, P as PlaceholderDataFunction, T as QueriesPlaceholderDataFunction, aT as QueryClientConfig, F as QueryFunction, K as QueryFunctionContext, A as QueryKey, V as QueryKeyHashFunction, Z as QueryMeta, ao as QueryObserverBaseResult, ar as QueryObserverLoadingErrorResult, aq as QueryObserverLoadingResult, a4 as QueryObserverOptions, ap as QueryObserverPendingResult, as as QueryObserverRefetchErrorResult, av as QueryObserverResult, at as QueryObserverSuccessResult, a0 as QueryOptions, J as QueryPersister, am as QueryStatus, af as RefetchOptions, ah as RefetchQueryFilters, R as Register, aj as ResetOptions, ae as ResultOptions, aW as SetDataOptions, G as StaleTime, a3 as ThrowOnError, a5 as WithRequired, B as dataTagSymbol } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/types.d.ts b/node_modules/@tanstack/query-core/build/modern/types.d.ts deleted file mode 100644 index 4c67f2e825f959281bd91c0d5e88deab161f8ffd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { aV as CancelOptions, E as DataTag, z as DefaultError, aU as DefaultOptions, a9 as DefaultedInfiniteQueryObserverOptions, a7 as DefaultedQueryObserverOptions, aC as DefinedInfiniteQueryObserverResult, au as DefinedQueryObserverResult, I as Enabled, ac as EnsureInfiniteQueryDataOptions, ab as EnsureQueryDataOptions, ad as FetchInfiniteQueryOptions, ak as FetchNextPageOptions, al as FetchPreviousPageOptions, aa as FetchQueryOptions, an as FetchStatus, X as GetNextPageParamFunction, W as GetPreviousPageParamFunction, Y as InfiniteData, aw as InfiniteQueryObserverBaseResult, az as InfiniteQueryObserverLoadingErrorResult, ay as InfiniteQueryObserverLoadingResult, a8 as InfiniteQueryObserverOptions, ax as InfiniteQueryObserverPendingResult, aA as InfiniteQueryObserverRefetchErrorResult, aD as InfiniteQueryObserverResult, aB as InfiniteQueryObserverSuccessResult, a2 as InfiniteQueryPageParamsOptions, L as InitialDataFunction, a1 as InitialPageParam, ai as InvalidateOptions, ag as InvalidateQueryFilters, aM as MutateFunction, aL as MutateOptions, aI as MutationFunction, aE as MutationKey, aH as MutationMeta, aN as MutationObserverBaseResult, aQ as MutationObserverErrorResult, aO as MutationObserverIdleResult, aP as MutationObserverLoadingResult, aK as MutationObserverOptions, aS as MutationObserverResult, aR as MutationObserverSuccessResult, aJ as MutationOptions, aG as MutationScope, aF as MutationStatus, _ as NetworkMode, N as NoInfer, aY as NotifyEvent, aX as NotifyEventType, $ as NotifyOnChangeProps, O as OmitKeyof, a6 as Optional, y as Override, P as PlaceholderDataFunction, T as QueriesPlaceholderDataFunction, aT as QueryClientConfig, F as QueryFunction, K as QueryFunctionContext, A as QueryKey, V as QueryKeyHashFunction, Z as QueryMeta, ao as QueryObserverBaseResult, ar as QueryObserverLoadingErrorResult, aq as QueryObserverLoadingResult, a4 as QueryObserverOptions, ap as QueryObserverPendingResult, as as QueryObserverRefetchErrorResult, av as QueryObserverResult, at as QueryObserverSuccessResult, a0 as QueryOptions, J as QueryPersister, am as QueryStatus, af as RefetchOptions, ah as RefetchQueryFilters, R as Register, aj as ResetOptions, ae as ResultOptions, aW as SetDataOptions, G as StaleTime, a3 as ThrowOnError, a5 as WithRequired, B as dataTagSymbol } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/types.js b/node_modules/@tanstack/query-core/build/modern/types.js deleted file mode 100644 index 5b2306a4c52321a5316142318d15fa56711ec12d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/types.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.js.map b/node_modules/@tanstack/query-core/build/modern/types.js.map deleted file mode 100644 index 84c51b288c478ac0d18748007ccfb8cddc797f3a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.cjs b/node_modules/@tanstack/query-core/build/modern/utils.cjs deleted file mode 100644 index ca0661a54a0606735f2c89bab91f80c7c55452ae..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.cjs +++ /dev/null @@ -1,293 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - addToEnd: () => addToEnd, - addToStart: () => addToStart, - ensureQueryFn: () => ensureQueryFn, - functionalUpdate: () => functionalUpdate, - hashKey: () => hashKey, - hashQueryKeyByOptions: () => hashQueryKeyByOptions, - isPlainArray: () => isPlainArray, - isPlainObject: () => isPlainObject, - isServer: () => isServer, - isValidTimeout: () => isValidTimeout, - keepPreviousData: () => keepPreviousData, - matchMutation: () => matchMutation, - matchQuery: () => matchQuery, - noop: () => noop, - partialMatchKey: () => partialMatchKey, - replaceData: () => replaceData, - replaceEqualDeep: () => replaceEqualDeep, - resolveEnabled: () => resolveEnabled, - resolveStaleTime: () => resolveStaleTime, - shallowEqualObjects: () => shallowEqualObjects, - skipToken: () => skipToken, - sleep: () => sleep, - timeUntilStale: () => timeUntilStale -}); -module.exports = __toCommonJS(utils_exports); -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { - return void 0; -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = options?.queryKeyHashFn || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key])); - } - return false; -} -function replaceEqualDeep(a, b) { - if (a === b) { - return a; - } - const array = isPlainArray(a) && isPlainArray(b); - if (array || isPlainObject(a) && isPlainObject(b)) { - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? [] : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) { - copy[key] = void 0; - equalItems++; - } else { - copy[key] = replaceEqualDeep(a[key], b[key]); - if (copy[key] === a[key] && a[key] !== void 0) { - equalItems++; - } - } - } - return aSize === bSize && equalItems === aSize ? a : copy; - } - return b; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `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}` - ); - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - skipToken, - sleep, - timeUntilStale -}); -//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.cjs.map b/node_modules/@tanstack/query-core/build/modern/utils.cjs.map deleted file mode 100644 index 647ca41b61f40d813f2a1f5d06655942ebd63bfd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: QueryKey\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (mutation: Mutation) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: MutationKey\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): undefined {\n return undefined\n}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime: undefined | StaleTime,\n query: Query,\n): number | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T): T\nexport function replaceEqualDeep(a: any, b: any): any {\n if (a === b) {\n return a\n }\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (array || (isPlainObject(a) && isPlainObject(b))) {\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? [] : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i]\n if (\n ((!array && aItems.includes(key)) || array) &&\n a[key] === undefined &&\n b[key] === undefined\n ) {\n copy[key] = undefined\n equalItems++\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key])\n if (copy[key] === a[key] && a[key] !== undefined) {\n equalItems++\n }\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n }\n\n return b\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown) {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nexport function isPlainObject(o: any): o is Object {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `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}`,\n )\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoEO,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAE5D,SAAS,OAAkB;AAChC,SAAO;AACT;AAEO,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WACA,OACoB;AACpB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,UAAU;AACZ,QAAI,OAAO;AACT,UAAI,MAAM,cAAc,sBAAsB,UAAU,MAAM,OAAO,GAAG;AACtE,eAAO;AAAA,MACT;AAAA,IACF,WAAW,CAAC,gBAAgB,MAAM,UAAU,QAAQ,GAAG;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,SAAS,OAAO;AAClB,UAAM,WAAW,MAAM,SAAS;AAChC,QAAI,SAAS,YAAY,CAAC,UAAU;AAClC,aAAO;AAAA,IACT;AACA,QAAI,SAAS,cAAc,UAAU;AACnC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,OAAO,UAAU,aAAa,MAAM,QAAQ,MAAM,OAAO;AAC3D,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,gBAAgB,MAAM,MAAM,aAAa;AAC1D,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,CAAC,UAAU,KAAK,GAAG;AAClC,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAEO,SAAS,cACd,SACA,UACS;AACT,QAAM,EAAE,OAAO,QAAQ,WAAW,YAAY,IAAI;AAClD,MAAI,aAAa;AACf,QAAI,CAAC,SAAS,QAAQ,aAAa;AACjC,aAAO;AAAA,IACT;AACA,QAAI,OAAO;AACT,UAAI,QAAQ,SAAS,QAAQ,WAAW,MAAM,QAAQ,WAAW,GAAG;AAClE,eAAO;AAAA,MACT;AAAA,IACF,WAAW,CAAC,gBAAgB,SAAS,QAAQ,aAAa,WAAW,GAAG;AACtE,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,UAAU,SAAS,MAAM,WAAW,QAAQ;AAC9C,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,CAAC,UAAU,QAAQ,GAAG;AACrC,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAEO,SAAS,sBACd,UACA,SACQ;AACR,QAAM,SAAS,SAAS,kBAAkB;AAC1C,SAAO,OAAO,QAAQ;AACxB;AAMO,SAAS,QAAQ,UAA0C;AAChE,SAAO,KAAK;AAAA,IAAU;AAAA,IAAU,CAAC,GAAG,QAClC,cAAc,GAAG,IACb,OAAO,KAAK,GAAG,EACZ,KAAK,EACL,OAAO,CAAC,QAAQ,QAAQ;AACvB,aAAO,GAAG,IAAI,IAAI,GAAG;AACrB,aAAO;AAAA,IACT,GAAG,CAAC,CAAQ,IACd;AAAA,EACN;AACF;AAMO,SAAS,gBAAgB,GAAQ,GAAiB;AACvD,MAAI,MAAM,GAAG;AACX,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,MAAM,OAAO,GAAG;AACzB,WAAO;AAAA,EACT;AAEA,MAAI,KAAK,KAAK,OAAO,MAAM,YAAY,OAAO,MAAM,UAAU;AAC5D,WAAO,CAAC,OAAO,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;AAAA,EACvE;AAEA,SAAO;AACT;AAQO,SAAS,iBAAiB,GAAQ,GAAa;AACpD,MAAI,MAAM,GAAG;AACX,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,aAAa,CAAC,KAAK,aAAa,CAAC;AAE/C,MAAI,SAAU,cAAc,CAAC,KAAK,cAAc,CAAC,GAAI;AACnD,UAAM,SAAS,QAAQ,IAAI,OAAO,KAAK,CAAC;AACxC,UAAM,QAAQ,OAAO;AACrB,UAAM,SAAS,QAAQ,IAAI,OAAO,KAAK,CAAC;AACxC,UAAM,QAAQ,OAAO;AACrB,UAAM,OAAY,QAAQ,CAAC,IAAI,CAAC;AAEhC,QAAI,aAAa;AAEjB,aAAS,IAAI,GAAG,IAAI,OAAO,KAAK;AAC9B,YAAM,MAAM,QAAQ,IAAI,OAAO,CAAC;AAChC,WACI,CAAC,SAAS,OAAO,SAAS,GAAG,KAAM,UACrC,EAAE,GAAG,MAAM,UACX,EAAE,GAAG,MAAM,QACX;AACA,aAAK,GAAG,IAAI;AACZ;AAAA,MACF,OAAO;AACL,aAAK,GAAG,IAAI,iBAAiB,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC;AAC3C,YAAI,KAAK,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,QAAW;AAChD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,WAAO,UAAU,SAAS,eAAe,QAAQ,IAAI;AAAA,EACvD;AAEA,SAAO;AACT;AAKO,SAAS,oBACd,GACA,GACS;AACT,MAAI,CAAC,KAAK,OAAO,KAAK,CAAC,EAAE,WAAW,OAAO,KAAK,CAAC,EAAE,QAAQ;AACzD,WAAO;AAAA,EACT;AAEA,aAAW,OAAO,GAAG;AACnB,QAAI,EAAE,GAAG,MAAM,EAAE,GAAG,GAAG;AACrB,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,aAAa,OAAgB;AAC3C,SAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,OAAO,KAAK,KAAK,EAAE;AACrE;AAIO,SAAS,cAAc,GAAqB;AACjD,MAAI,CAAC,mBAAmB,CAAC,GAAG;AAC1B,WAAO;AAAA,EACT;AAGA,QAAM,OAAO,EAAE;AACf,MAAI,SAAS,QAAW;AACtB,WAAO;AAAA,EACT;AAGA,QAAM,OAAO,KAAK;AAClB,MAAI,CAAC,mBAAmB,IAAI,GAAG;AAC7B,WAAO;AAAA,EACT;AAGA,MAAI,CAAC,KAAK,eAAe,eAAe,GAAG;AACzC,WAAO;AAAA,EACT;AAGA,MAAI,OAAO,eAAe,CAAC,MAAM,OAAO,WAAW;AACjD,WAAO;AAAA,EACT;AAGA,SAAO;AACT;AAEA,SAAS,mBAAmB,GAAiB;AAC3C,SAAO,OAAO,UAAU,SAAS,KAAK,CAAC,MAAM;AAC/C;AAEO,SAAS,MAAM,SAAgC;AACpD,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,eAAW,SAAS,OAAO;AAAA,EAC7B,CAAC;AACH;AAEO,SAAS,YAGd,UAA6B,MAAa,SAA0B;AACpE,MAAI,OAAO,QAAQ,sBAAsB,YAAY;AACnD,WAAO,QAAQ,kBAAkB,UAAU,IAAI;AAAA,EACjD,WAAW,QAAQ,sBAAsB,OAAO;AAC9C,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI;AACF,eAAO,iBAAiB,UAAU,IAAI;AAAA,MACxC,SAAS,OAAO;AACd,gBAAQ;AAAA,UACN,0JAA0J,QAAQ,SAAS,MAAM,KAAK;AAAA,QACxL;AAAA,MACF;AAAA,IACF;AAEA,WAAO,iBAAiB,UAAU,IAAI;AAAA,EACxC;AACA,SAAO;AACT;AAEO,SAAS,iBACd,cACe;AACf,SAAO;AACT;AAEO,SAAS,SAAY,OAAiB,MAAS,MAAM,GAAa;AACvE,QAAM,WAAW,CAAC,GAAG,OAAO,IAAI;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,CAAC,IAAI;AAC5D;AAEO,SAAS,WAAc,OAAiB,MAAS,MAAM,GAAa;AACzE,QAAM,WAAW,CAAC,MAAM,GAAG,KAAK;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;AAChE;AAEO,IAAM,YAAY,OAAO;AAGzB,SAAS,cAId,SAIA,cACwC;AACxC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,QAAQ,YAAY,WAAW;AACjC,cAAQ;AAAA,QACN,yGAAyG,QAAQ,SAAS;AAAA,MAC5H;AAAA,IACF;AAAA,EACF;AAKA,MAAI,CAAC,QAAQ,WAAW,cAAc,gBAAgB;AACpD,WAAO,MAAM,aAAa;AAAA,EAC5B;AAEA,MAAI,CAAC,QAAQ,WAAW,QAAQ,YAAY,WAAW;AACrD,WAAO,MACL,QAAQ,OAAO,IAAI,MAAM,qBAAqB,QAAQ,SAAS,GAAG,CAAC;AAAA,EACvE;AAEA,SAAO,QAAQ;AACjB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.d.cts b/node_modules/@tanstack/query-core/build/modern/utils.d.cts deleted file mode 100644 index ab045722d40d71db1922676b22524e1d3ff95d6d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as MutationFilters, j as QueryFilters, b6 as QueryTypeFilter, S as SkipToken, U as Updater, bk as addToEnd, bl as addToStart, bm as ensureQueryFn, b8 as functionalUpdate, h as hashKey, bd as hashQueryKeyByOptions, bg as isPlainArray, bh as isPlainObject, i as isServer, b9 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b7 as noop, be as partialMatchKey, bj as replaceData, r as replaceEqualDeep, bc as resolveEnabled, bb as resolveStaleTime, bf as shallowEqualObjects, s as skipToken, bi as sleep, ba as timeUntilStale } from './hydration-BXpkOXt5.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/utils.d.ts b/node_modules/@tanstack/query-core/build/modern/utils.d.ts deleted file mode 100644 index 3095a8c40d5e14227f214239de6735945fcacafb..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as MutationFilters, j as QueryFilters, b6 as QueryTypeFilter, S as SkipToken, U as Updater, bk as addToEnd, bl as addToStart, bm as ensureQueryFn, b8 as functionalUpdate, h as hashKey, bd as hashQueryKeyByOptions, bg as isPlainArray, bh as isPlainObject, i as isServer, b9 as isValidTimeout, k as keepPreviousData, f as matchMutation, m as matchQuery, b7 as noop, be as partialMatchKey, bj as replaceData, r as replaceEqualDeep, bc as resolveEnabled, bb as resolveStaleTime, bf as shallowEqualObjects, s as skipToken, bi as sleep, ba as timeUntilStale } from './hydration-mKPlgzt9.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/package.json b/node_modules/@tanstack/query-core/package.json deleted file mode 100644 index e1c19aed2df37788451ee6cad6ab15e44df3c2ea..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@tanstack/query-core", - "version": "5.60.5", - "description": "The framework agnostic core that powers TanStack Query", - "author": "tannerlinsley", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/TanStack/query.git", - "directory": "packages/query-core" - }, - "homepage": "https://tanstack.com/query", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "type": "module", - "types": "build/legacy/index.d.ts", - "main": "build/legacy/index.cjs", - "module": "build/legacy/index.js", - "exports": { - ".": { - "import": { - "types": "./build/modern/index.d.ts", - "default": "./build/modern/index.js" - }, - "require": { - "types": "./build/modern/index.d.cts", - "default": "./build/modern/index.cjs" - } - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "build", - "src", - "!src/__tests__" - ], - "scripts": {} -} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/src/focusManager.ts b/node_modules/@tanstack/query-core/src/focusManager.ts deleted file mode 100644 index cb0d8598713f072f0792bbe035cb8b68bca24d75..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/focusManager.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Subscribable } from './subscribable' -import { isServer } from './utils' - -type Listener = (focused: boolean) => void - -type SetupFn = ( - setFocused: (focused?: boolean) => void, -) => (() => void) | undefined - -export class FocusManager extends Subscribable { - #focused?: boolean - #cleanup?: () => void - - #setup: SetupFn - - constructor() { - super() - this.#setup = (onFocus) => { - // addEventListener does not exist in React Native, but window does - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!isServer && window.addEventListener) { - const listener = () => onFocus() - // Listen to visibilitychange - window.addEventListener('visibilitychange', listener, false) - - return () => { - // Be sure to unsubscribe if a new handler is set - window.removeEventListener('visibilitychange', listener) - } - } - return - } - } - - protected onSubscribe(): void { - if (!this.#cleanup) { - this.setEventListener(this.#setup) - } - } - - protected onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.() - this.#cleanup = undefined - } - } - - setEventListener(setup: SetupFn): void { - this.#setup = setup - this.#cleanup?.() - this.#cleanup = setup((focused) => { - if (typeof focused === 'boolean') { - this.setFocused(focused) - } else { - this.onFocus() - } - }) - } - - setFocused(focused?: boolean): void { - const changed = this.#focused !== focused - if (changed) { - this.#focused = focused - this.onFocus() - } - } - - onFocus(): void { - const isFocused = this.isFocused() - this.listeners.forEach((listener) => { - listener(isFocused) - }) - } - - isFocused(): boolean { - if (typeof this.#focused === 'boolean') { - return this.#focused - } - - // document global can be unavailable in react native - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return globalThis.document?.visibilityState !== 'hidden' - } -} - -export const focusManager = new FocusManager() diff --git a/node_modules/@tanstack/query-core/src/hydration.ts b/node_modules/@tanstack/query-core/src/hydration.ts deleted file mode 100644 index a3dfd0e482957102f0cc48c3a608520c3a85fc76..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/hydration.ts +++ /dev/null @@ -1,222 +0,0 @@ -import type { - DefaultError, - MutationKey, - MutationMeta, - MutationOptions, - MutationScope, - QueryKey, - QueryMeta, - QueryOptions, -} from './types' -import type { QueryClient } from './queryClient' -import type { Query, QueryState } from './query' -import type { Mutation, MutationState } from './mutation' - -// TYPES -type TransformerFn = (data: any) => any -function defaultTransformerFn(data: any): any { - return data -} - -export interface DehydrateOptions { - serializeData?: TransformerFn - shouldDehydrateMutation?: (mutation: Mutation) => boolean - shouldDehydrateQuery?: (query: Query) => boolean -} - -export interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn - queries?: QueryOptions - mutations?: MutationOptions - } -} - -interface DehydratedMutation { - mutationKey?: MutationKey - state: MutationState - meta?: MutationMeta - scope?: MutationScope -} - -interface DehydratedQuery { - queryHash: string - queryKey: QueryKey - state: QueryState - promise?: Promise - meta?: QueryMeta -} - -export interface DehydratedState { - mutations: Array - queries: Array -} - -// FUNCTIONS - -function dehydrateMutation(mutation: Mutation): DehydratedMutation { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...(mutation.options.scope && { scope: mutation.options.scope }), - ...(mutation.meta && { meta: mutation.meta }), - } -} - -// Most config is not dehydrated but instead meant to configure again when -// consuming the de/rehydrated data, typically with useQuery on the client. -// Sometimes it might make sense to prefetch data on the server and include -// in the html-payload, but not consume it on the initial render. -function dehydrateQuery( - query: Query, - serializeData: TransformerFn, -): DehydratedQuery { - return { - state: { - ...query.state, - ...(query.state.data !== undefined && { - data: serializeData(query.state.data), - }), - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...(query.state.status === 'pending' && { - promise: query.promise?.then(serializeData).catch((error) => { - if (process.env.NODE_ENV !== 'production') { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`, - ) - } - return Promise.reject(new Error('redacted')) - }), - }), - ...(query.meta && { meta: query.meta }), - } -} - -export function defaultShouldDehydrateMutation(mutation: Mutation) { - return mutation.state.isPaused -} - -export function defaultShouldDehydrateQuery(query: Query) { - return query.state.status === 'success' -} - -export function dehydrate( - client: QueryClient, - options: DehydrateOptions = {}, -): DehydratedState { - const filterMutation = - options.shouldDehydrateMutation ?? - client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? - defaultShouldDehydrateMutation - - const mutations = client - .getMutationCache() - .getAll() - .flatMap((mutation) => - filterMutation(mutation) ? [dehydrateMutation(mutation)] : [], - ) - - const filterQuery = - options.shouldDehydrateQuery ?? - client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? - defaultShouldDehydrateQuery - - const serializeData = - options.serializeData ?? - client.getDefaultOptions().dehydrate?.serializeData ?? - defaultTransformerFn - - const queries = client - .getQueryCache() - .getAll() - .flatMap((query) => - filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [], - ) - - return { mutations, queries } -} - -export function hydrate( - client: QueryClient, - dehydratedState: unknown, - options?: HydrateOptions, -): void { - if (typeof dehydratedState !== 'object' || dehydratedState === null) { - return - } - - const mutationCache = client.getMutationCache() - const queryCache = client.getQueryCache() - const deserializeData = - options?.defaultOptions?.deserializeData ?? - client.getDefaultOptions().hydrate?.deserializeData ?? - defaultTransformerFn - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const mutations = (dehydratedState as DehydratedState).mutations || [] - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const queries = (dehydratedState as DehydratedState).queries || [] - - mutations.forEach(({ state, ...mutationOptions }) => { - mutationCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.mutations, - ...options?.defaultOptions?.mutations, - ...mutationOptions, - }, - state, - ) - }) - - queries.forEach(({ queryKey, state, queryHash, meta, promise }) => { - let query = queryCache.get(queryHash) - - const data = - state.data === undefined ? state.data : deserializeData(state.data) - - // Do not hydrate if an existing query exists with newer data - if (query) { - if (query.state.dataUpdatedAt < state.dataUpdatedAt) { - // omit fetchStatus from dehydrated state - // so that query stays in its current fetchStatus - const { fetchStatus: _ignored, ...serializedState } = state - query.setState({ - ...serializedState, - data, - }) - } - } else { - // Restore query - query = queryCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.queries, - ...options?.defaultOptions?.queries, - queryKey, - queryHash, - meta, - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: 'idle', - }, - ) - } - - if (promise) { - // Note: `Promise.resolve` required cause - // RSC transformed promises are not thenable - const initialPromise = Promise.resolve(promise).then(deserializeData) - - // this doesn't actually fetch - it just creates a retryer - // which will re-use the passed `initialPromise` - void query.fetch(undefined, { initialPromise }) - } - }) -} diff --git a/node_modules/@tanstack/query-core/src/index.ts b/node_modules/@tanstack/query-core/src/index.ts deleted file mode 100644 index 684256b572f7349cf7755932089acf52a73e9633..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* istanbul ignore file */ - -export { CancelledError } from './retryer' -export { QueryCache } from './queryCache' -export type { QueryCacheNotifyEvent } from './queryCache' -export { QueryClient } from './queryClient' -export { QueryObserver } from './queryObserver' -export { QueriesObserver } from './queriesObserver' -export { InfiniteQueryObserver } from './infiniteQueryObserver' -export { MutationCache } from './mutationCache' -export type { MutationCacheNotifyEvent } from './mutationCache' -export { MutationObserver } from './mutationObserver' -export { notifyManager } from './notifyManager' -export { focusManager } from './focusManager' -export { onlineManager } from './onlineManager' -export { - hashKey, - replaceEqualDeep, - isServer, - matchQuery, - matchMutation, - keepPreviousData, - skipToken, -} from './utils' -export type { MutationFilters, QueryFilters, Updater, SkipToken } from './utils' -export { isCancelledError } from './retryer' -export { - dehydrate, - hydrate, - defaultShouldDehydrateQuery, - defaultShouldDehydrateMutation, -} from './hydration' - -// Types -export * from './types' -export type { QueryState } from './query' -export { Query } from './query' -export type { MutationState } from './mutation' -export { Mutation } from './mutation' -export type { - DehydrateOptions, - DehydratedState, - HydrateOptions, -} from './hydration' -export type { QueriesObserverOptions } from './queriesObserver' diff --git a/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts b/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts deleted file mode 100644 index 9dc28f230e8d90ec50eb9a3fd7a289b46cce3e2d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { addToEnd, addToStart, ensureQueryFn } from './utils' -import type { QueryBehavior } from './query' -import type { - InfiniteData, - InfiniteQueryPageParamsOptions, - OmitKeyof, - QueryFunctionContext, - QueryKey, -} from './types' - -export function infiniteQueryBehavior( - pages?: number, -): QueryBehavior> { - return { - onFetch: (context, query) => { - const options = context.options as InfiniteQueryPageParamsOptions - const direction = context.fetchOptions?.meta?.fetchMore?.direction - const oldPages = context.state.data?.pages || [] - const oldPageParams = context.state.data?.pageParams || [] - let result: InfiniteData = { pages: [], pageParams: [] } - let currentPage = 0 - - const fetchFn = async () => { - let cancelled = false - const addSignalProperty = (object: unknown) => { - Object.defineProperty(object, 'signal', { - enumerable: true, - get: () => { - if (context.signal.aborted) { - cancelled = true - } else { - context.signal.addEventListener('abort', () => { - cancelled = true - }) - } - return context.signal - }, - }) - } - - const queryFn = ensureQueryFn(context.options, context.fetchOptions) - - // Create function to fetch a page - const fetchPage = async ( - data: InfiniteData, - param: unknown, - previous?: boolean, - ): Promise> => { - if (cancelled) { - return Promise.reject() - } - - if (param == null && data.pages.length) { - return Promise.resolve(data) - } - - const queryFnContext: OmitKeyof< - QueryFunctionContext, - 'signal' - > = { - queryKey: context.queryKey, - pageParam: param, - direction: previous ? 'backward' : 'forward', - meta: context.options.meta, - } - - addSignalProperty(queryFnContext) - - const page = await queryFn( - queryFnContext as QueryFunctionContext, - ) - - const { maxPages } = context.options - const addTo = previous ? addToStart : addToEnd - - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages), - } - } - - // fetch next / previous page? - if (direction && oldPages.length) { - const previous = direction === 'backward' - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam - const oldData = { - pages: oldPages, - pageParams: oldPageParams, - } - const param = pageParamFn(options, oldData) - - result = await fetchPage(oldData, param, previous) - } else { - const remainingPages = pages ?? oldPages.length - - // Fetch all pages - do { - const param = - currentPage === 0 - ? (oldPageParams[0] ?? options.initialPageParam) - : getNextPageParam(options, result) - if (currentPage > 0 && param == null) { - break - } - result = await fetchPage(result, param) - currentPage++ - } while (currentPage < remainingPages) - } - - return result - } - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn as any, - { - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal, - }, - query, - ) - } - } else { - context.fetchFn = fetchFn - } - }, - } -} - -function getNextPageParam( - options: InfiniteQueryPageParamsOptions, - { pages, pageParams }: InfiniteData, -): unknown | undefined { - const lastIndex = pages.length - 1 - return pages.length > 0 - ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams, - ) - : undefined -} - -function getPreviousPageParam( - options: InfiniteQueryPageParamsOptions, - { pages, pageParams }: InfiniteData, -): unknown | undefined { - return pages.length > 0 - ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) - : undefined -} - -/** - * Checks if there is a next page. - */ -export function hasNextPage( - options: InfiniteQueryPageParamsOptions, - data?: InfiniteData, -): boolean { - if (!data) return false - return getNextPageParam(options, data) != null -} - -/** - * Checks if there is a previous page. - */ -export function hasPreviousPage( - options: InfiniteQueryPageParamsOptions, - data?: InfiniteData, -): boolean { - if (!data || !options.getPreviousPageParam) return false - return getPreviousPageParam(options, data) != null -} diff --git a/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts b/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts deleted file mode 100644 index b1c18ac01c1bfe18ecc0aafe2da3408b63ade72a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { QueryObserver } from './queryObserver' -import { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior, -} from './infiniteQueryBehavior' -import type { Subscribable } from './subscribable' -import type { - DefaultError, - DefaultedInfiniteQueryObserverOptions, - FetchNextPageOptions, - FetchPreviousPageOptions, - InfiniteData, - InfiniteQueryObserverBaseResult, - InfiniteQueryObserverOptions, - InfiniteQueryObserverResult, - QueryKey, -} from './types' -import type { QueryClient } from './queryClient' -import type { NotifyOptions } from './queryObserver' -import type { Query } from './query' - -type InfiniteQueryObserverListener = ( - result: InfiniteQueryObserverResult, -) => void - -export class InfiniteQueryObserver< - TQueryFnData = unknown, - TError = DefaultError, - TData = InfiniteData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends QueryObserver< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey -> { - // Type override - subscribe!: Subscribable< - InfiniteQueryObserverListener - >['subscribe'] - - // Type override - getCurrentResult!: ReplaceReturnType< - QueryObserver< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey - >['getCurrentResult'], - InfiniteQueryObserverResult - > - - // Type override - protected fetch!: ReplaceReturnType< - QueryObserver< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey - >['fetch'], - Promise> - > - - constructor( - client: QueryClient, - options: InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - ) { - super(client, options) - } - - protected bindMethods(): void { - super.bindMethods() - this.fetchNextPage = this.fetchNextPage.bind(this) - this.fetchPreviousPage = this.fetchPreviousPage.bind(this) - } - - setOptions( - options: InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - notifyOptions?: NotifyOptions, - ): void { - super.setOptions( - { - ...options, - behavior: infiniteQueryBehavior(), - }, - notifyOptions, - ) - } - - getOptimisticResult( - options: DefaultedInfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - ): InfiniteQueryObserverResult { - options.behavior = infiniteQueryBehavior() - return super.getOptimisticResult(options) as InfiniteQueryObserverResult< - TData, - TError - > - } - - fetchNextPage( - options?: FetchNextPageOptions, - ): Promise> { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: 'forward' }, - }, - }) - } - - fetchPreviousPage( - options?: FetchPreviousPageOptions, - ): Promise> { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: 'backward' }, - }, - }) - } - - protected createResult( - query: Query< - TQueryFnData, - TError, - InfiniteData, - TQueryKey - >, - options: InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - ): InfiniteQueryObserverResult { - const { state } = query - const parentResult = super.createResult(query, options) - - const { isFetching, isRefetching, isError, isRefetchError } = parentResult - const fetchDirection = state.fetchMeta?.fetchMore?.direction - - const isFetchNextPageError = isError && fetchDirection === 'forward' - const isFetchingNextPage = isFetching && fetchDirection === 'forward' - - const isFetchPreviousPageError = isError && fetchDirection === 'backward' - const isFetchingPreviousPage = isFetching && fetchDirection === 'backward' - - const result: InfiniteQueryObserverBaseResult = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: - isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: - isRefetching && !isFetchingNextPage && !isFetchingPreviousPage, - } - - return result as InfiniteQueryObserverResult - } -} - -type ReplaceReturnType< - TFunction extends (...args: Array) => unknown, - TReturn, -> = (...args: Parameters) => TReturn diff --git a/node_modules/@tanstack/query-core/src/mutation.ts b/node_modules/@tanstack/query-core/src/mutation.ts deleted file mode 100644 index e2e2afd600ff5501ba32fe19b5d62714a4d74607..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/mutation.ts +++ /dev/null @@ -1,361 +0,0 @@ -import { notifyManager } from './notifyManager' -import { Removable } from './removable' -import { createRetryer } from './retryer' -import type { - DefaultError, - MutationMeta, - MutationOptions, - MutationStatus, -} from './types' -import type { MutationCache } from './mutationCache' -import type { MutationObserver } from './mutationObserver' -import type { Retryer } from './retryer' - -// TYPES - -interface MutationConfig { - mutationId: number - mutationCache: MutationCache - options: MutationOptions - state?: MutationState -} - -export interface MutationState< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TContext = unknown, -> { - context: TContext | undefined - data: TData | undefined - error: TError | null - failureCount: number - failureReason: TError | null - isPaused: boolean - status: MutationStatus - variables: TVariables | undefined - submittedAt: number -} - -interface FailedAction { - type: 'failed' - failureCount: number - error: TError | null -} - -interface PendingAction { - type: 'pending' - isPaused: boolean - variables?: TVariables - context?: TContext -} - -interface SuccessAction { - type: 'success' - data: TData -} - -interface ErrorAction { - type: 'error' - error: TError -} - -interface PauseAction { - type: 'pause' -} - -interface ContinueAction { - type: 'continue' -} - -export type Action = - | ContinueAction - | ErrorAction - | FailedAction - | PendingAction - | PauseAction - | SuccessAction - -// CLASS - -export class Mutation< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TContext = unknown, -> extends Removable { - state: MutationState - options!: MutationOptions - readonly mutationId: number - - #observers: Array> - #mutationCache: MutationCache - #retryer?: Retryer - - constructor(config: MutationConfig) { - super() - - this.mutationId = config.mutationId - this.#mutationCache = config.mutationCache - this.#observers = [] - this.state = config.state || getDefaultState() - - this.setOptions(config.options) - this.scheduleGc() - } - - setOptions( - options: MutationOptions, - ): void { - this.options = options - - this.updateGcTime(this.options.gcTime) - } - - get meta(): MutationMeta | undefined { - return this.options.meta - } - - addObserver(observer: MutationObserver): void { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer) - - // Stop the mutation from being garbage collected - this.clearGcTimeout() - - this.#mutationCache.notify({ - type: 'observerAdded', - mutation: this, - observer, - }) - } - } - - removeObserver(observer: MutationObserver): void { - this.#observers = this.#observers.filter((x) => x !== observer) - - this.scheduleGc() - - this.#mutationCache.notify({ - type: 'observerRemoved', - mutation: this, - observer, - }) - } - - protected optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === 'pending') { - this.scheduleGc() - } else { - this.#mutationCache.remove(this) - } - } - } - - continue(): Promise { - return ( - this.#retryer?.continue() ?? - // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables!) - ) - } - - async execute(variables: TVariables): Promise { - this.#retryer = createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error('No mutationFn found')) - } - return this.options.mutationFn(variables) - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: 'failed', failureCount, error }) - }, - onPause: () => { - this.#dispatch({ type: 'pause' }) - }, - onContinue: () => { - this.#dispatch({ type: 'continue' }) - }, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this), - }) - - const restored = this.state.status === 'pending' - const isPaused = !this.#retryer.canStart() - - try { - if (!restored) { - this.#dispatch({ type: 'pending', variables, isPaused }) - // Notify cache callback - await this.#mutationCache.config.onMutate?.( - variables, - this as Mutation, - ) - const context = await this.options.onMutate?.(variables) - if (context !== this.state.context) { - this.#dispatch({ - type: 'pending', - context, - variables, - isPaused, - }) - } - } - const data = await this.#retryer.start() - - // Notify cache callback - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this as Mutation, - ) - - await this.options.onSuccess?.(data, variables, this.state.context!) - - // Notify cache callback - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this as Mutation, - ) - - await this.options.onSettled?.(data, null, variables, this.state.context) - - this.#dispatch({ type: 'success', data }) - return data - } catch (error) { - try { - // Notify cache callback - await this.#mutationCache.config.onError?.( - error as any, - variables, - this.state.context, - this as Mutation, - ) - - await this.options.onError?.( - error as TError, - variables, - this.state.context, - ) - - // Notify cache callback - await this.#mutationCache.config.onSettled?.( - undefined, - error as any, - this.state.variables, - this.state.context, - this as Mutation, - ) - - await this.options.onSettled?.( - undefined, - error as TError, - variables, - this.state.context, - ) - throw error - } finally { - this.#dispatch({ type: 'error', error: error as TError }) - } - } finally { - this.#mutationCache.runNext(this) - } - } - - #dispatch(action: Action): void { - const reducer = ( - state: MutationState, - ): MutationState => { - switch (action.type) { - case 'failed': - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error, - } - case 'pause': - return { - ...state, - isPaused: true, - } - case 'continue': - return { - ...state, - isPaused: false, - } - case 'pending': - return { - ...state, - context: action.context, - data: undefined, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: 'pending', - variables: action.variables, - submittedAt: Date.now(), - } - case 'success': - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: 'success', - isPaused: false, - } - case 'error': - return { - ...state, - data: undefined, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: 'error', - } - } - } - this.state = reducer(this.state) - - notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action) - }) - this.#mutationCache.notify({ - mutation: this, - type: 'updated', - action, - }) - }) - } -} - -export function getDefaultState< - TData, - TError, - TVariables, - TContext, ->(): MutationState { - return { - context: undefined, - data: undefined, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: 'idle', - variables: undefined, - submittedAt: 0, - } -} diff --git a/node_modules/@tanstack/query-core/src/mutationCache.ts b/node_modules/@tanstack/query-core/src/mutationCache.ts deleted file mode 100644 index 1663b50cef3053a6143c529f21cef378c8493dc7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/mutationCache.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { notifyManager } from './notifyManager' -import { Mutation } from './mutation' -import { matchMutation, noop } from './utils' -import { Subscribable } from './subscribable' -import type { MutationObserver } from './mutationObserver' -import type { DefaultError, MutationOptions, NotifyEvent } from './types' -import type { QueryClient } from './queryClient' -import type { Action, MutationState } from './mutation' -import type { MutationFilters } from './utils' - -// TYPES - -interface MutationCacheConfig { - onError?: ( - error: DefaultError, - variables: unknown, - context: unknown, - mutation: Mutation, - ) => Promise | unknown - onSuccess?: ( - data: unknown, - variables: unknown, - context: unknown, - mutation: Mutation, - ) => Promise | unknown - onMutate?: ( - variables: unknown, - mutation: Mutation, - ) => Promise | unknown - onSettled?: ( - data: unknown | undefined, - error: DefaultError | null, - variables: unknown, - context: unknown, - mutation: Mutation, - ) => Promise | unknown -} - -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added' - mutation: Mutation -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed' - mutation: Mutation -} - -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded' - mutation: Mutation - observer: MutationObserver -} - -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved' - mutation: Mutation - observer: MutationObserver -} - -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated' - mutation?: Mutation - observer: MutationObserver -} - -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated' - mutation: Mutation - action: Action -} - -export type MutationCacheNotifyEvent = - | NotifyEventMutationAdded - | NotifyEventMutationRemoved - | NotifyEventMutationObserverAdded - | NotifyEventMutationObserverRemoved - | NotifyEventMutationObserverOptionsUpdated - | NotifyEventMutationUpdated - -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void - -// CLASS - -export class MutationCache extends Subscribable { - #mutations: Map>> - #mutationId: number - - constructor(public config: MutationCacheConfig = {}) { - super() - this.#mutations = new Map() - this.#mutationId = Date.now() - } - - build( - client: QueryClient, - options: MutationOptions, - state?: MutationState, - ): Mutation { - const mutation = new Mutation({ - mutationCache: this, - mutationId: ++this.#mutationId, - options: client.defaultMutationOptions(options), - state, - }) - - this.add(mutation) - - return mutation - } - - add(mutation: Mutation): void { - const scope = scopeFor(mutation) - const mutations = this.#mutations.get(scope) ?? [] - mutations.push(mutation) - this.#mutations.set(scope, mutations) - this.notify({ type: 'added', mutation }) - } - - remove(mutation: Mutation): void { - const scope = scopeFor(mutation) - if (this.#mutations.has(scope)) { - const mutations = this.#mutations - .get(scope) - ?.filter((x) => x !== mutation) - if (mutations) { - if (mutations.length === 0) { - this.#mutations.delete(scope) - } else { - this.#mutations.set(scope, mutations) - } - } - } - - this.notify({ type: 'removed', mutation }) - } - - canRun(mutation: Mutation): boolean { - const firstPendingMutation = this.#mutations - .get(scopeFor(mutation)) - ?.find((m) => m.state.status === 'pending') - - // we can run if there is no current pending mutation (start use-case) - // or if WE are the first pending mutation (continue use-case) - return !firstPendingMutation || firstPendingMutation === mutation - } - - runNext(mutation: Mutation): Promise { - const foundMutation = this.#mutations - .get(scopeFor(mutation)) - ?.find((m) => m !== mutation && m.state.isPaused) - - return foundMutation?.continue() ?? Promise.resolve() - } - - clear(): void { - notifyManager.batch(() => { - this.getAll().forEach((mutation) => { - this.remove(mutation) - }) - }) - } - - getAll(): Array { - return [...this.#mutations.values()].flat() - } - - find< - TData = unknown, - TError = DefaultError, - TVariables = any, - TContext = unknown, - >( - filters: MutationFilters, - ): Mutation | undefined { - const defaultedFilters = { exact: true, ...filters } - - return this.getAll().find((mutation) => - matchMutation(defaultedFilters, mutation), - ) as Mutation | undefined - } - - findAll(filters: MutationFilters = {}): Array { - return this.getAll().filter((mutation) => matchMutation(filters, mutation)) - } - - notify(event: MutationCacheNotifyEvent) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event) - }) - }) - } - - resumePausedMutations(): Promise { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused) - - return notifyManager.batch(() => - Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(noop)), - ), - ) - } -} - -function scopeFor(mutation: Mutation) { - return mutation.options.scope?.id ?? String(mutation.mutationId) -} diff --git a/node_modules/@tanstack/query-core/src/mutationObserver.ts b/node_modules/@tanstack/query-core/src/mutationObserver.ts deleted file mode 100644 index 1178bbdf75135517f051b7adb60b09f340ae3d02..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/mutationObserver.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { getDefaultState } from './mutation' -import { notifyManager } from './notifyManager' -import { Subscribable } from './subscribable' -import { hashKey, shallowEqualObjects } from './utils' -import type { QueryClient } from './queryClient' -import type { - DefaultError, - MutateOptions, - MutationObserverOptions, - MutationObserverResult, -} from './types' -import type { Action, Mutation } from './mutation' - -// TYPES - -type MutationObserverListener = ( - result: MutationObserverResult, -) => void - -// CLASS - -export class MutationObserver< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends Subscribable< - MutationObserverListener -> { - options!: MutationObserverOptions - - #client: QueryClient - #currentResult: MutationObserverResult = - undefined! - #currentMutation?: Mutation - #mutateOptions?: MutateOptions - - constructor( - client: QueryClient, - options: MutationObserverOptions, - ) { - super() - - this.#client = client - this.setOptions(options) - this.bindMethods() - this.#updateResult() - } - - protected bindMethods(): void { - this.mutate = this.mutate.bind(this) - this.reset = this.reset.bind(this) - } - - setOptions( - options: MutationObserverOptions, - ) { - const prevOptions = this.options as - | MutationObserverOptions - | undefined - this.options = this.#client.defaultMutationOptions(options) - if (!shallowEqualObjects(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: 'observerOptionsUpdated', - mutation: this.#currentMutation, - observer: this, - }) - } - - if ( - prevOptions?.mutationKey && - this.options.mutationKey && - hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey) - ) { - this.reset() - } else if (this.#currentMutation?.state.status === 'pending') { - this.#currentMutation.setOptions(this.options) - } - } - - protected onUnsubscribe(): void { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this) - } - } - - onMutationUpdate(action: Action): void { - this.#updateResult() - - this.#notify(action) - } - - getCurrentResult(): MutationObserverResult< - TData, - TError, - TVariables, - TContext - > { - return this.#currentResult - } - - reset(): void { - // reset needs to remove the observer from the mutation because there is no way to "get it back" - // another mutate call will yield a new mutation! - this.#currentMutation?.removeObserver(this) - this.#currentMutation = undefined - this.#updateResult() - this.#notify() - } - - mutate( - variables: TVariables, - options?: MutateOptions, - ): Promise { - this.#mutateOptions = options - - this.#currentMutation?.removeObserver(this) - - this.#currentMutation = this.#client - .getMutationCache() - .build(this.#client, this.options) - - this.#currentMutation.addObserver(this) - - return this.#currentMutation.execute(variables) - } - - #updateResult(): void { - const state = - this.#currentMutation?.state ?? - getDefaultState() - - this.#currentResult = { - ...state, - isPending: state.status === 'pending', - isSuccess: state.status === 'success', - isError: state.status === 'error', - isIdle: state.status === 'idle', - mutate: this.mutate, - reset: this.reset, - } as MutationObserverResult - } - - #notify(action?: Action): void { - notifyManager.batch(() => { - // First trigger the mutate callbacks - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables! - const context = this.#currentResult.context - - if (action?.type === 'success') { - this.#mutateOptions.onSuccess?.(action.data, variables, context!) - this.#mutateOptions.onSettled?.(action.data, null, variables, context) - } else if (action?.type === 'error') { - this.#mutateOptions.onError?.(action.error, variables, context) - this.#mutateOptions.onSettled?.( - undefined, - action.error, - variables, - context, - ) - } - } - - // Then trigger the listeners - this.listeners.forEach((listener) => { - listener(this.#currentResult) - }) - }) - } -} diff --git a/node_modules/@tanstack/query-core/src/notifyManager.ts b/node_modules/@tanstack/query-core/src/notifyManager.ts deleted file mode 100644 index 3315c6164601d7384a8ff9794728fe4e1784cf14..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/notifyManager.ts +++ /dev/null @@ -1,95 +0,0 @@ -// TYPES - -type NotifyCallback = () => void - -type NotifyFunction = (callback: () => void) => void - -type BatchNotifyFunction = (callback: () => void) => void - -type BatchCallsCallback> = (...args: T) => void - -type ScheduleFunction = (callback: () => void) => void - -export function createNotifyManager() { - let queue: Array = [] - let transactions = 0 - let notifyFn: NotifyFunction = (callback) => { - callback() - } - let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => { - callback() - } - let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0) - - const schedule = (callback: NotifyCallback): void => { - if (transactions) { - queue.push(callback) - } else { - scheduleFn(() => { - notifyFn(callback) - }) - } - } - const flush = (): void => { - const originalQueue = queue - queue = [] - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback) - }) - }) - }) - } - } - - return { - batch: (callback: () => T): T => { - let result - transactions++ - try { - result = callback() - } finally { - transactions-- - if (!transactions) { - flush() - } - } - return result - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: >( - callback: BatchCallsCallback, - ): BatchCallsCallback => { - return (...args) => { - schedule(() => { - callback(...args) - }) - } - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn: NotifyFunction) => { - notifyFn = fn - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn: BatchNotifyFunction) => { - batchNotifyFn = fn - }, - setScheduler: (fn: ScheduleFunction) => { - scheduleFn = fn - }, - } as const -} - -// SINGLETON -export const notifyManager = createNotifyManager() diff --git a/node_modules/@tanstack/query-core/src/onlineManager.ts b/node_modules/@tanstack/query-core/src/onlineManager.ts deleted file mode 100644 index daf77d5a4c288d5597e49c35420bddb75bba1b13..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/onlineManager.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Subscribable } from './subscribable' -import { isServer } from './utils' - -type Listener = (online: boolean) => void -type SetupFn = (setOnline: Listener) => (() => void) | undefined - -export class OnlineManager extends Subscribable { - #online = true - #cleanup?: () => void - - #setup: SetupFn - - constructor() { - super() - this.#setup = (onOnline) => { - // addEventListener does not exist in React Native, but window does - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true) - const offlineListener = () => onOnline(false) - // Listen to online - window.addEventListener('online', onlineListener, false) - window.addEventListener('offline', offlineListener, false) - - return () => { - // Be sure to unsubscribe if a new handler is set - window.removeEventListener('online', onlineListener) - window.removeEventListener('offline', offlineListener) - } - } - - return - } - } - - protected onSubscribe(): void { - if (!this.#cleanup) { - this.setEventListener(this.#setup) - } - } - - protected onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.() - this.#cleanup = undefined - } - } - - setEventListener(setup: SetupFn): void { - this.#setup = setup - this.#cleanup?.() - this.#cleanup = setup(this.setOnline.bind(this)) - } - - setOnline(online: boolean): void { - const changed = this.#online !== online - - if (changed) { - this.#online = online - this.listeners.forEach((listener) => { - listener(online) - }) - } - } - - isOnline(): boolean { - return this.#online - } -} - -export const onlineManager = new OnlineManager() diff --git a/node_modules/@tanstack/query-core/src/queriesObserver.ts b/node_modules/@tanstack/query-core/src/queriesObserver.ts deleted file mode 100644 index 600317ec29a4063ad5c00e34fa44d8c1041afbee..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/queriesObserver.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { notifyManager } from './notifyManager' -import { QueryObserver } from './queryObserver' -import { Subscribable } from './subscribable' -import { replaceEqualDeep } from './utils' -import type { - DefaultedQueryObserverOptions, - QueryObserverOptions, - QueryObserverResult, -} from './types' -import type { QueryClient } from './queryClient' -import type { NotifyOptions } from './queryObserver' - -function difference(array1: Array, array2: Array): Array { - return array1.filter((x) => !array2.includes(x)) -} - -function replaceAt(array: Array, index: number, value: T): Array { - const copy = array.slice(0) - copy[index] = value - return copy -} - -type QueriesObserverListener = (result: Array) => void - -type CombineFn = ( - result: Array, -) => TCombinedResult - -export interface QueriesObserverOptions< - TCombinedResult = Array, -> { - combine?: CombineFn -} - -export class QueriesObserver< - TCombinedResult = Array, -> extends Subscribable { - #client: QueryClient - #result!: Array - #queries: Array - #options?: QueriesObserverOptions - #observers: Array - #combinedResult?: TCombinedResult - #lastCombine?: CombineFn - #lastResult?: Array - - constructor( - client: QueryClient, - queries: Array>, - options?: QueriesObserverOptions, - ) { - super() - - this.#client = client - this.#options = options - this.#queries = [] - this.#observers = [] - this.#result = [] - - this.setQueries(queries) - } - - protected onSubscribe(): void { - if (this.listeners.size === 1) { - this.#observers.forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result) - }) - }) - } - } - - protected onUnsubscribe(): void { - if (!this.listeners.size) { - this.destroy() - } - } - - destroy(): void { - this.listeners = new Set() - this.#observers.forEach((observer) => { - observer.destroy() - }) - } - - setQueries( - queries: Array, - options?: QueriesObserverOptions, - notifyOptions?: NotifyOptions, - ): void { - this.#queries = queries - this.#options = options - - if (process.env.NODE_ENV !== 'production') { - const queryHashes = queries.map((query) => query.queryHash) - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.', - ) - } - } - - notifyManager.batch(() => { - const prevObservers = this.#observers - - const newObserverMatches = this.#findMatchingObservers(this.#queries) - - // set options for the new observers to notify of changes - newObserverMatches.forEach((match) => - match.observer.setOptions(match.defaultedQueryOptions, notifyOptions), - ) - - const newObservers = newObserverMatches.map((match) => match.observer) - const newResult = newObservers.map((observer) => - observer.getCurrentResult(), - ) - - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index], - ) - - if (prevObservers.length === newObservers.length && !hasIndexChange) { - return - } - - this.#observers = newObservers - this.#result = newResult - - if (!this.hasListeners()) { - return - } - - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy() - }) - - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result) - }) - }) - - this.#notify() - }) - } - - getCurrentResult(): Array { - return this.#result - } - - getQueries() { - return this.#observers.map((observer) => observer.getCurrentQuery()) - } - - getObservers() { - return this.#observers - } - - getOptimisticResult( - queries: Array, - combine: CombineFn | undefined, - ): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array, - ] { - const matches = this.#findMatchingObservers(queries) - const result = matches.map((match) => - match.observer.getOptimisticResult(match.defaultedQueryOptions), - ) - - return [ - result, - (r?: Array) => { - return this.#combineResult(r ?? result, combine) - }, - () => { - return this.#trackResult(result, queries) - }, - ] - } - - #trackResult( - result: Array, - queries: Array, - ) { - const matches = this.#findMatchingObservers(queries) - - return matches.map((match, index) => { - const observerResult = result[index]! - return !match.defaultedQueryOptions.notifyOnChangeProps - ? match.observer.trackResult(observerResult, (accessedProp) => { - // track property on all observers to ensure proper (synchronized) tracking (#7000) - matches.forEach((m) => { - m.observer.trackProp(accessedProp) - }) - }) - : observerResult - }) - } - - #combineResult( - input: Array, - combine: CombineFn | undefined, - ): TCombinedResult { - if (combine) { - if ( - !this.#combinedResult || - this.#result !== this.#lastResult || - combine !== this.#lastCombine - ) { - this.#lastCombine = combine - this.#lastResult = this.#result - this.#combinedResult = replaceEqualDeep( - this.#combinedResult, - combine(input), - ) - } - - return this.#combinedResult - } - return input as any - } - - #findMatchingObservers( - queries: Array, - ): Array { - const prevObserversMap = new Map( - this.#observers.map((observer) => [observer.options.queryHash, observer]), - ) - - const observers: Array = [] - - queries.forEach((options) => { - const defaultedOptions = this.#client.defaultQueryOptions(options) - const match = prevObserversMap.get(defaultedOptions.queryHash) - if (match) { - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer: match, - }) - } else { - const existingObserver = this.#observers.find( - (o) => o.options.queryHash === defaultedOptions.queryHash, - ) - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer: - existingObserver ?? - new QueryObserver(this.#client, defaultedOptions), - }) - } - }) - - return observers.sort((a, b) => { - return ( - queries.findIndex( - (q) => q.queryHash === a.defaultedQueryOptions.queryHash, - ) - - queries.findIndex( - (q) => q.queryHash === b.defaultedQueryOptions.queryHash, - ) - ) - }) - } - - #onUpdate(observer: QueryObserver, result: QueryObserverResult): void { - const index = this.#observers.indexOf(observer) - if (index !== -1) { - this.#result = replaceAt(this.#result, index, result) - this.#notify() - } - } - - #notify(): void { - if (this.hasListeners()) { - const previousResult = this.#combinedResult - const newResult = this.#combineResult( - this.#trackResult(this.#result, this.#queries), - this.#options?.combine, - ) - - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(this.#result) - }) - }) - } - } - } -} - -type QueryObserverMatch = { - defaultedQueryOptions: DefaultedQueryObserverOptions - observer: QueryObserver -} diff --git a/node_modules/@tanstack/query-core/src/query.ts b/node_modules/@tanstack/query-core/src/query.ts deleted file mode 100644 index 3485d8ce28bb512ab091a9bca941ca9a2116ef61..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/query.ts +++ /dev/null @@ -1,683 +0,0 @@ -import { - ensureQueryFn, - noop, - replaceData, - resolveEnabled, - skipToken, - timeUntilStale, -} from './utils' -import { notifyManager } from './notifyManager' -import { canFetch, createRetryer, isCancelledError } from './retryer' -import { Removable } from './removable' -import type { - CancelOptions, - DefaultError, - FetchStatus, - InitialDataFunction, - OmitKeyof, - QueryFunction, - QueryFunctionContext, - QueryKey, - QueryMeta, - QueryOptions, - QueryStatus, - SetDataOptions, -} from './types' -import type { QueryCache } from './queryCache' -import type { QueryObserver } from './queryObserver' -import type { Retryer } from './retryer' - -// TYPES - -interface QueryConfig< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey = QueryKey, -> { - cache: QueryCache - queryKey: TQueryKey - queryHash: string - options?: QueryOptions - defaultOptions?: QueryOptions - state?: QueryState -} - -export interface QueryState { - data: TData | undefined - dataUpdateCount: number - dataUpdatedAt: number - error: TError | null - errorUpdateCount: number - errorUpdatedAt: number - fetchFailureCount: number - fetchFailureReason: TError | null - fetchMeta: FetchMeta | null - isInvalidated: boolean - status: QueryStatus - fetchStatus: FetchStatus -} - -export interface FetchContext< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey = QueryKey, -> { - fetchFn: () => unknown | Promise - fetchOptions?: FetchOptions - signal: AbortSignal - options: QueryOptions - queryKey: TQueryKey - state: QueryState -} - -export interface QueryBehavior< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> { - onFetch: ( - context: FetchContext, - query: Query, - ) => void -} - -export type FetchDirection = 'forward' | 'backward' - -export interface FetchMeta { - fetchMore?: { direction: FetchDirection } -} - -export interface FetchOptions { - cancelRefetch?: boolean - meta?: FetchMeta - initialPromise?: Promise -} - -interface FailedAction { - type: 'failed' - failureCount: number - error: TError -} - -interface FetchAction { - type: 'fetch' - meta?: FetchMeta -} - -interface SuccessAction { - data: TData | undefined - type: 'success' - dataUpdatedAt?: number - manual?: boolean -} - -interface ErrorAction { - type: 'error' - error: TError -} - -interface InvalidateAction { - type: 'invalidate' -} - -interface PauseAction { - type: 'pause' -} - -interface ContinueAction { - type: 'continue' -} - -interface SetStateAction { - type: 'setState' - state: Partial> - setStateOptions?: SetStateOptions -} - -export type Action = - | ContinueAction - | ErrorAction - | FailedAction - | FetchAction - | InvalidateAction - | PauseAction - | SetStateAction - | SuccessAction - -export interface SetStateOptions { - meta?: any -} - -// CLASS - -export class Query< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends Removable { - queryKey: TQueryKey - queryHash: string - options!: QueryOptions - state: QueryState - - #initialState: QueryState - #revertState?: QueryState - #cache: QueryCache - #retryer?: Retryer - observers: Array> - #defaultOptions?: QueryOptions - #abortSignalConsumed: boolean - - constructor(config: QueryConfig) { - super() - - this.#abortSignalConsumed = false - this.#defaultOptions = config.defaultOptions - this.setOptions(config.options) - this.observers = [] - this.#cache = config.cache - this.queryKey = config.queryKey - this.queryHash = config.queryHash - this.#initialState = getDefaultState(this.options) - this.state = config.state ?? this.#initialState - this.scheduleGc() - } - get meta(): QueryMeta | undefined { - return this.options.meta - } - - get promise(): Promise | undefined { - return this.#retryer?.promise - } - - setOptions( - options?: QueryOptions, - ): void { - this.options = { ...this.#defaultOptions, ...options } - - this.updateGcTime(this.options.gcTime) - } - - protected optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === 'idle') { - this.#cache.remove(this) - } - } - - setData( - newData: TData, - options?: SetDataOptions & { manual: boolean }, - ): TData { - const data = replaceData(this.state.data, newData, this.options) - - // Set data and mark it as cached - this.#dispatch({ - data, - type: 'success', - dataUpdatedAt: options?.updatedAt, - manual: options?.manual, - }) - - return data - } - - setState( - state: Partial>, - setStateOptions?: SetStateOptions, - ): void { - this.#dispatch({ type: 'setState', state, setStateOptions }) - } - - cancel(options?: CancelOptions): Promise { - const promise = this.#retryer?.promise - this.#retryer?.cancel(options) - return promise ? promise.then(noop).catch(noop) : Promise.resolve() - } - - destroy(): void { - super.destroy() - - this.cancel({ silent: true }) - } - - reset(): void { - this.destroy() - this.setState(this.#initialState) - } - - isActive(): boolean { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false, - ) - } - - isDisabled(): boolean { - if (this.getObserversCount() > 0) { - return !this.isActive() - } - // if a query has no observers, it should still be considered disabled if it never attempted a fetch - return ( - this.options.queryFn === skipToken || - this.state.dataUpdateCount + this.state.errorUpdateCount === 0 - ) - } - - isStale(): boolean { - if (this.state.isInvalidated) { - return true - } - - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale, - ) - } - - return this.state.data === undefined - } - - isStaleByTime(staleTime = 0): boolean { - return ( - this.state.isInvalidated || - this.state.data === undefined || - !timeUntilStale(this.state.dataUpdatedAt, staleTime) - ) - } - - onFocus(): void { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()) - - observer?.refetch({ cancelRefetch: false }) - - // Continue fetch if currently paused - this.#retryer?.continue() - } - - onOnline(): void { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()) - - observer?.refetch({ cancelRefetch: false }) - - // Continue fetch if currently paused - this.#retryer?.continue() - } - - addObserver(observer: QueryObserver): void { - if (!this.observers.includes(observer)) { - this.observers.push(observer) - - // Stop the query from being garbage collected - this.clearGcTimeout() - - this.#cache.notify({ type: 'observerAdded', query: this, observer }) - } - } - - removeObserver(observer: QueryObserver): void { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer) - - if (!this.observers.length) { - // If the transport layer does not support cancellation - // we'll let the query continue so the result can be cached - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }) - } else { - this.#retryer.cancelRetry() - } - } - - this.scheduleGc() - } - - this.#cache.notify({ type: 'observerRemoved', query: this, observer }) - } - } - - getObserversCount(): number { - return this.observers.length - } - - invalidate(): void { - if (!this.state.isInvalidated) { - this.#dispatch({ type: 'invalidate' }) - } - } - - fetch( - options?: QueryOptions, - fetchOptions?: FetchOptions, - ): Promise { - if (this.state.fetchStatus !== 'idle') { - if (this.state.data !== undefined && fetchOptions?.cancelRefetch) { - // Silently cancel current fetch if the user wants to cancel refetch - this.cancel({ silent: true }) - } else if (this.#retryer) { - // make sure that retries that were potentially cancelled due to unmounts can continue - this.#retryer.continueRetry() - // Return current promise if we are already fetching - return this.#retryer.promise - } - } - - // Update config if passed, otherwise the config from the last execution is used - if (options) { - this.setOptions(options) - } - - // Use the options from the first observer with a query function if no function is found. - // This can happen when the query is hydrated or created with setQueryData. - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn) - if (observer) { - this.setOptions(observer.options) - } - } - - if (process.env.NODE_ENV !== 'production') { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`, - ) - } - } - - const abortController = new AbortController() - - // Adds an enumerable signal property to the object that - // which sets abortSignalConsumed to true when the signal - // is read. - const addSignalProperty = (object: unknown) => { - Object.defineProperty(object, 'signal', { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true - return abortController.signal - }, - }) - } - - // Create fetch function - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions) - - // Create query function context - const queryFnContext: OmitKeyof< - QueryFunctionContext, - 'signal' - > = { - queryKey: this.queryKey, - meta: this.meta, - } - - addSignalProperty(queryFnContext) - - this.#abortSignalConsumed = false - if (this.options.persister) { - return this.options.persister( - queryFn as QueryFunction, - queryFnContext as QueryFunctionContext, - this as unknown as Query, - ) - } - - return queryFn(queryFnContext as QueryFunctionContext) - } - - // Trigger behavior hook - const context: OmitKeyof< - FetchContext, - 'signal' - > = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - state: this.state, - fetchFn, - } - - addSignalProperty(context) - - this.options.behavior?.onFetch( - context as FetchContext, - this as unknown as Query, - ) - - // Store state in case the current fetch needs to be reverted - this.#revertState = this.state - - // Set to fetching state if not already in it - if ( - this.state.fetchStatus === 'idle' || - this.state.fetchMeta !== context.fetchOptions?.meta - ) { - this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta }) - } - - const onError = (error: TError | { silent?: boolean }) => { - // Optimistically update state if needed - if (!(isCancelledError(error) && error.silent)) { - this.#dispatch({ - type: 'error', - error: error as TError, - }) - } - - if (!isCancelledError(error)) { - // Notify cache callback - this.#cache.config.onError?.( - error as any, - this as Query, - ) - this.#cache.config.onSettled?.( - this.state.data, - error as any, - this as Query, - ) - } - - // Schedule query gc after fetching - this.scheduleGc() - } - - // Try to fetch the data - this.#retryer = createRetryer({ - initialPromise: fetchOptions?.initialPromise as - | Promise - | undefined, - fn: context.fetchFn as () => Promise, - abort: abortController.abort.bind(abortController), - onSuccess: (data) => { - if (data === undefined) { - if (process.env.NODE_ENV !== 'production') { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`, - ) - } - onError(new Error(`${this.queryHash} data is undefined`) as any) - return - } - - try { - this.setData(data) - } catch (error) { - onError(error as TError) - return - } - - // Notify cache callback - this.#cache.config.onSuccess?.(data, this as Query) - this.#cache.config.onSettled?.( - data, - this.state.error as any, - this as Query, - ) - - // Schedule query gc after fetching - this.scheduleGc() - }, - onError, - onFail: (failureCount, error) => { - this.#dispatch({ type: 'failed', failureCount, error }) - }, - onPause: () => { - this.#dispatch({ type: 'pause' }) - }, - onContinue: () => { - this.#dispatch({ type: 'continue' }) - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true, - }) - - return this.#retryer.start() - } - - #dispatch(action: Action): void { - const reducer = ( - state: QueryState, - ): QueryState => { - switch (action.type) { - case 'failed': - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error, - } - case 'pause': - return { - ...state, - fetchStatus: 'paused', - } - case 'continue': - return { - ...state, - fetchStatus: 'fetching', - } - case 'fetch': - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null, - } - case 'success': - return { - ...state, - data: action.data, - dataUpdateCount: state.dataUpdateCount + 1, - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: 'success', - ...(!action.manual && { - fetchStatus: 'idle', - fetchFailureCount: 0, - fetchFailureReason: null, - }), - } - case 'error': - const error = action.error - - if (isCancelledError(error) && error.revert && this.#revertState) { - return { ...this.#revertState, fetchStatus: 'idle' } - } - - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: 'idle', - status: 'error', - } - case 'invalidate': - return { - ...state, - isInvalidated: true, - } - case 'setState': - return { - ...state, - ...action.state, - } - } - } - - this.state = reducer(this.state) - - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate() - }) - - this.#cache.notify({ query: this, type: 'updated', action }) - }) - } -} - -export function fetchState< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey, ->( - data: TData | undefined, - options: QueryOptions, -) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused', - ...(data === undefined && - ({ - error: null, - status: 'pending', - } as const)), - } as const -} - -function getDefaultState< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey, ->( - options: QueryOptions, -): QueryState { - const data = - typeof options.initialData === 'function' - ? (options.initialData as InitialDataFunction)() - : options.initialData - - const hasData = data !== undefined - - const initialDataUpdatedAt = hasData - ? typeof options.initialDataUpdatedAt === 'function' - ? (options.initialDataUpdatedAt as () => number | undefined)() - : options.initialDataUpdatedAt - : 0 - - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? 'success' : 'pending', - fetchStatus: 'idle', - } -} diff --git a/node_modules/@tanstack/query-core/src/queryCache.ts b/node_modules/@tanstack/query-core/src/queryCache.ts deleted file mode 100644 index 8f637e0a39f6f1e8b5aecb30cf6c70a3d6b3d2a9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/queryCache.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { hashQueryKeyByOptions, matchQuery } from './utils' -import { Query } from './query' -import { notifyManager } from './notifyManager' -import { Subscribable } from './subscribable' -import type { QueryFilters } from './utils' -import type { Action, QueryState } from './query' -import type { - DefaultError, - NotifyEvent, - QueryKey, - QueryOptions, - WithRequired, -} from './types' -import type { QueryClient } from './queryClient' -import type { QueryObserver } from './queryObserver' - -// TYPES - -interface QueryCacheConfig { - onError?: ( - error: DefaultError, - query: Query, - ) => void - onSuccess?: (data: unknown, query: Query) => void - onSettled?: ( - data: unknown | undefined, - error: DefaultError | null, - query: Query, - ) => void -} - -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added' - query: Query -} - -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed' - query: Query -} - -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated' - query: Query - action: Action -} - -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded' - query: Query - observer: QueryObserver -} - -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved' - query: Query - observer: QueryObserver -} - -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated' - query: Query -} - -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated' - query: Query - observer: QueryObserver -} - -export type QueryCacheNotifyEvent = - | NotifyEventQueryAdded - | NotifyEventQueryRemoved - | NotifyEventQueryUpdated - | NotifyEventQueryObserverAdded - | NotifyEventQueryObserverRemoved - | NotifyEventQueryObserverResultsUpdated - | NotifyEventQueryObserverOptionsUpdated - -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void - -export interface QueryStore { - has: (queryHash: string) => boolean - set: (queryHash: string, query: Query) => void - get: (queryHash: string) => Query | undefined - delete: (queryHash: string) => void - values: () => IterableIterator -} - -// CLASS - -export class QueryCache extends Subscribable { - #queries: QueryStore - - constructor(public config: QueryCacheConfig = {}) { - super() - this.#queries = new Map() - } - - build< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - client: QueryClient, - options: WithRequired< - QueryOptions, - 'queryKey' - >, - state?: QueryState, - ): Query { - const queryKey = options.queryKey - const queryHash = - options.queryHash ?? hashQueryKeyByOptions(queryKey, options) - let query = this.get(queryHash) - - if (!query) { - query = new Query({ - cache: this, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey), - }) - this.add(query) - } - - return query - } - - add(query: Query): void { - if (!this.#queries.has(query.queryHash)) { - this.#queries.set(query.queryHash, query) - - this.notify({ - type: 'added', - query, - }) - } - } - - remove(query: Query): void { - const queryInMap = this.#queries.get(query.queryHash) - - if (queryInMap) { - query.destroy() - - if (queryInMap === query) { - this.#queries.delete(query.queryHash) - } - - this.notify({ type: 'removed', query }) - } - } - - clear(): void { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query) - }) - }) - } - - get< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - queryHash: string, - ): Query | undefined { - return this.#queries.get(queryHash) as - | Query - | undefined - } - - getAll(): Array { - return [...this.#queries.values()] - } - - find( - filters: WithRequired, - ): Query | undefined { - const defaultedFilters = { exact: true, ...filters } - - return this.getAll().find((query) => - matchQuery(defaultedFilters, query), - ) as Query | undefined - } - - findAll(filters: QueryFilters = {}): Array { - const queries = this.getAll() - return Object.keys(filters).length > 0 - ? queries.filter((query) => matchQuery(filters, query)) - : queries - } - - notify(event: QueryCacheNotifyEvent): void { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event) - }) - }) - } - - onFocus(): void { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus() - }) - }) - } - - onOnline(): void { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline() - }) - }) - } -} diff --git a/node_modules/@tanstack/query-core/src/queryClient.ts b/node_modules/@tanstack/query-core/src/queryClient.ts deleted file mode 100644 index 49032a88025b4ee9f724c7bb2e3dc6d00f28d780..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/queryClient.ts +++ /dev/null @@ -1,633 +0,0 @@ -import { - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - noop, - partialMatchKey, - resolveStaleTime, - skipToken, -} from './utils' -import { QueryCache } from './queryCache' -import { MutationCache } from './mutationCache' -import { focusManager } from './focusManager' -import { onlineManager } from './onlineManager' -import { notifyManager } from './notifyManager' -import { infiniteQueryBehavior } from './infiniteQueryBehavior' -import type { - CancelOptions, - DataTag, - DefaultError, - DefaultOptions, - DefaultedQueryObserverOptions, - EnsureInfiniteQueryDataOptions, - EnsureQueryDataOptions, - FetchInfiniteQueryOptions, - FetchQueryOptions, - InfiniteData, - InvalidateOptions, - InvalidateQueryFilters, - MutationKey, - MutationObserverOptions, - MutationOptions, - NoInfer, - OmitKeyof, - QueryClientConfig, - QueryKey, - QueryObserverOptions, - QueryOptions, - RefetchOptions, - RefetchQueryFilters, - ResetOptions, - SetDataOptions, -} from './types' -import type { QueryState } from './query' -import type { MutationFilters, QueryFilters, Updater } from './utils' - -// TYPES - -interface QueryDefaults { - queryKey: QueryKey - defaultOptions: OmitKeyof, 'queryKey'> -} - -interface MutationDefaults { - mutationKey: MutationKey - defaultOptions: MutationOptions -} - -// CLASS - -export class QueryClient { - #queryCache: QueryCache - #mutationCache: MutationCache - #defaultOptions: DefaultOptions - #queryDefaults: Map - #mutationDefaults: Map - #mountCount: number - #unsubscribeFocus?: () => void - #unsubscribeOnline?: () => void - - constructor(config: QueryClientConfig = {}) { - this.#queryCache = config.queryCache || new QueryCache() - this.#mutationCache = config.mutationCache || new MutationCache() - this.#defaultOptions = config.defaultOptions || {} - this.#queryDefaults = new Map() - this.#mutationDefaults = new Map() - this.#mountCount = 0 - } - - mount(): void { - this.#mountCount++ - if (this.#mountCount !== 1) return - - this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations() - this.#queryCache.onFocus() - } - }) - this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations() - this.#queryCache.onOnline() - } - }) - } - - unmount(): void { - this.#mountCount-- - if (this.#mountCount !== 0) return - - this.#unsubscribeFocus?.() - this.#unsubscribeFocus = undefined - - this.#unsubscribeOnline?.() - this.#unsubscribeOnline = undefined - } - - isFetching(filters?: QueryFilters): number { - return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' }) - .length - } - - isMutating(filters?: MutationFilters): number { - return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length - } - - getQueryData< - TQueryFnData = unknown, - TTaggedQueryKey extends QueryKey = QueryKey, - TInferredQueryFnData = TTaggedQueryKey extends DataTag< - unknown, - infer TaggedValue - > - ? TaggedValue - : TQueryFnData, - >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined - getQueryData(queryKey: QueryKey) { - const options = this.defaultQueryOptions({ queryKey }) - return this.#queryCache.get(options.queryHash)?.state.data - } - - ensureQueryData< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - options: EnsureQueryDataOptions, - ): Promise { - const cachedData = this.getQueryData(options.queryKey) - - if (cachedData === undefined) return this.fetchQuery(options) - else { - const defaultedOptions = this.defaultQueryOptions(options) - const query = this.#queryCache.build(this, defaultedOptions) - - if ( - options.revalidateIfStale && - query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query)) - ) { - void this.prefetchQuery(defaultedOptions) - } - - return Promise.resolve(cachedData) - } - } - - getQueriesData( - filters: QueryFilters, - ): Array<[QueryKey, TQueryFnData | undefined]> { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data as TQueryFnData | undefined - return [queryKey, data] - }) - } - - setQueryData< - TQueryFnData = unknown, - TTaggedQueryKey extends QueryKey = QueryKey, - TInferredQueryFnData = TTaggedQueryKey extends DataTag< - unknown, - infer TaggedValue - > - ? TaggedValue - : TQueryFnData, - >( - queryKey: TTaggedQueryKey, - updater: Updater< - NoInfer | undefined, - NoInfer | undefined - >, - options?: SetDataOptions, - ): TInferredQueryFnData | undefined { - const defaultedOptions = this.defaultQueryOptions< - any, - any, - unknown, - any, - QueryKey - >({ queryKey }) - - const query = this.#queryCache.get( - defaultedOptions.queryHash, - ) - const prevData = query?.state.data - const data = functionalUpdate(updater, prevData) - - if (data === undefined) { - return undefined - } - - return this.#queryCache - .build(this, defaultedOptions) - .setData(data, { ...options, manual: true }) - } - - setQueriesData( - filters: QueryFilters, - updater: Updater, - options?: SetDataOptions, - ): Array<[QueryKey, TQueryFnData | undefined]> { - return notifyManager.batch(() => - this.#queryCache - .findAll(filters) - .map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options), - ]), - ) - } - - getQueryState< - TQueryFnData = unknown, - TError = DefaultError, - TTaggedQueryKey extends QueryKey = QueryKey, - TInferredQueryFnData = TTaggedQueryKey extends DataTag< - unknown, - infer TaggedValue - > - ? TaggedValue - : TQueryFnData, - >( - queryKey: TTaggedQueryKey, - ): QueryState | undefined { - const options = this.defaultQueryOptions({ queryKey }) - return this.#queryCache.get(options.queryHash) - ?.state - } - - removeQueries(filters?: QueryFilters): void { - const queryCache = this.#queryCache - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query) - }) - }) - } - - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise { - const queryCache = this.#queryCache - - const refetchFilters: RefetchQueryFilters = { - type: 'active', - ...filters, - } - - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset() - }) - return this.refetchQueries(refetchFilters, options) - }) - } - - cancelQueries( - filters: QueryFilters = {}, - cancelOptions: CancelOptions = {}, - ): Promise { - const defaultedCancelOptions = { revert: true, ...cancelOptions } - - const promises = notifyManager.batch(() => - this.#queryCache - .findAll(filters) - .map((query) => query.cancel(defaultedCancelOptions)), - ) - - return Promise.all(promises).then(noop).catch(noop) - } - - invalidateQueries( - filters: InvalidateQueryFilters = {}, - options: InvalidateOptions = {}, - ): Promise { - return notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate() - }) - - if (filters.refetchType === 'none') { - return Promise.resolve() - } - const refetchFilters: RefetchQueryFilters = { - ...filters, - type: filters.refetchType ?? filters.type ?? 'active', - } - return this.refetchQueries(refetchFilters, options) - }) - } - - refetchQueries( - filters: RefetchQueryFilters = {}, - options?: RefetchOptions, - ): Promise { - const fetchOptions = { - ...options, - cancelRefetch: options?.cancelRefetch ?? true, - } - const promises = notifyManager.batch(() => - this.#queryCache - .findAll(filters) - .filter((query) => !query.isDisabled()) - .map((query) => { - let promise = query.fetch(undefined, fetchOptions) - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop) - } - return query.state.fetchStatus === 'paused' - ? Promise.resolve() - : promise - }), - ) - - return Promise.all(promises).then(noop) - } - - fetchQuery< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, - >( - options: FetchQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise { - const defaultedOptions = this.defaultQueryOptions(options) - - // https://github.com/tannerlinsley/react-query/issues/652 - if (defaultedOptions.retry === undefined) { - defaultedOptions.retry = false - } - - const query = this.#queryCache.build(this, defaultedOptions) - - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query), - ) - ? query.fetch(defaultedOptions) - : Promise.resolve(query.state.data as TData) - } - - prefetchQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - options: FetchQueryOptions, - ): Promise { - return this.fetchQuery(options).then(noop).catch(noop) - } - - fetchInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, - >( - options: FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise> { - options.behavior = infiniteQueryBehavior< - TQueryFnData, - TError, - TData, - TPageParam - >(options.pages) - return this.fetchQuery(options as any) - } - - prefetchInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, - >( - options: FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise { - return this.fetchInfiniteQuery(options).then(noop).catch(noop) - } - - ensureInfiniteQueryData< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, - >( - options: EnsureInfiniteQueryDataOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise> { - options.behavior = infiniteQueryBehavior< - TQueryFnData, - TError, - TData, - TPageParam - >(options.pages) - - return this.ensureQueryData(options as any) - } - - resumePausedMutations(): Promise { - if (onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations() - } - return Promise.resolve() - } - - getQueryCache(): QueryCache { - return this.#queryCache - } - - getMutationCache(): MutationCache { - return this.#mutationCache - } - - getDefaultOptions(): DefaultOptions { - return this.#defaultOptions - } - - setDefaultOptions(options: DefaultOptions): void { - this.#defaultOptions = options - } - - setQueryDefaults< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - >( - queryKey: QueryKey, - options: Partial< - OmitKeyof< - QueryObserverOptions, - 'queryKey' - > - >, - ): void { - this.#queryDefaults.set(hashKey(queryKey), { - queryKey, - defaultOptions: options, - }) - } - - getQueryDefaults( - queryKey: QueryKey, - ): OmitKeyof, 'queryKey'> { - const defaults = [...this.#queryDefaults.values()] - - let result: OmitKeyof< - QueryObserverOptions, - 'queryKey' - > = {} - - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - result = { ...result, ...queryDefault.defaultOptions } - } - }) - return result - } - - setMutationDefaults< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, - >( - mutationKey: MutationKey, - options: OmitKeyof< - MutationObserverOptions, - 'mutationKey' - >, - ): void { - this.#mutationDefaults.set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options, - }) - } - - getMutationDefaults( - mutationKey: MutationKey, - ): MutationObserverOptions { - const defaults = [...this.#mutationDefaults.values()] - - let result: MutationObserverOptions = {} - - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - result = { ...result, ...queryDefault.defaultOptions } - } - }) - - return result - } - - defaultQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, - >( - options: - | QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - > - | DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > { - if (options._defaulted) { - return options as DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > - } - - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true, - } - - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions, - ) - } - - // dependent default values - if (defaultedOptions.refetchOnReconnect === undefined) { - defaultedOptions.refetchOnReconnect = - defaultedOptions.networkMode !== 'always' - } - if (defaultedOptions.throwOnError === undefined) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense - } - - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = 'offlineFirst' - } - - if ( - defaultedOptions.enabled !== true && - defaultedOptions.queryFn === skipToken - ) { - defaultedOptions.enabled = false - } - - return defaultedOptions as DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > - } - - defaultMutationOptions>( - options?: T, - ): T { - if (options?._defaulted) { - return options - } - return { - ...this.#defaultOptions.mutations, - ...(options?.mutationKey && - this.getMutationDefaults(options.mutationKey)), - ...options, - _defaulted: true, - } as T - } - - clear(): void { - this.#queryCache.clear() - this.#mutationCache.clear() - } -} diff --git a/node_modules/@tanstack/query-core/src/queryObserver.ts b/node_modules/@tanstack/query-core/src/queryObserver.ts deleted file mode 100644 index 3dc751f5cde235cf23a886b1f624caba98a38f16..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/queryObserver.ts +++ /dev/null @@ -1,842 +0,0 @@ -import { focusManager } from './focusManager' -import { notifyManager } from './notifyManager' -import { fetchState } from './query' -import { Subscribable } from './subscribable' -import { pendingThenable } from './thenable' -import { - isServer, - isValidTimeout, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - timeUntilStale, -} from './utils' -import type { FetchOptions, Query, QueryState } from './query' -import type { QueryClient } from './queryClient' -import type { PendingThenable, Thenable } from './thenable' -import type { - DefaultError, - DefaultedQueryObserverOptions, - PlaceholderDataFunction, - QueryKey, - QueryObserverBaseResult, - QueryObserverOptions, - QueryObserverResult, - QueryOptions, - RefetchOptions, -} from './types' - -type QueryObserverListener = ( - result: QueryObserverResult, -) => void - -export interface NotifyOptions { - listeners?: boolean -} - -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean -} - -export class QueryObserver< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends Subscribable> { - #client: QueryClient - #currentQuery: Query = undefined! - #currentQueryInitialState: QueryState = undefined! - #currentResult: QueryObserverResult = undefined! - #currentResultState?: QueryState - #currentResultOptions?: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > - #currentThenable: Thenable - #selectError: TError | null - #selectFn?: (data: TQueryData) => TData - #selectResult?: TData - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - #lastQueryWithDefinedData?: Query - #staleTimeoutId?: ReturnType - #refetchIntervalId?: ReturnType - #currentRefetchInterval?: number | false - #trackedProps = new Set() - - constructor( - client: QueryClient, - public options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ) { - super() - - this.#client = client - this.#selectError = null - this.#currentThenable = pendingThenable() - if (!this.options.experimental_prefetchInRender) { - this.#currentThenable.reject( - new Error('experimental_prefetchInRender feature flag is not enabled'), - ) - } - - this.bindMethods() - this.setOptions(options) - } - - protected bindMethods(): void { - this.refetch = this.refetch.bind(this) - } - - protected onSubscribe(): void { - if (this.listeners.size === 1) { - this.#currentQuery.addObserver(this) - - if (shouldFetchOnMount(this.#currentQuery, this.options)) { - this.#executeFetch() - } else { - this.updateResult() - } - - this.#updateTimers() - } - } - - protected onUnsubscribe(): void { - if (!this.hasListeners()) { - this.destroy() - } - } - - shouldFetchOnReconnect(): boolean { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnReconnect, - ) - } - - shouldFetchOnWindowFocus(): boolean { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnWindowFocus, - ) - } - - destroy(): void { - this.listeners = new Set() - this.#clearStaleTimeout() - this.#clearRefetchInterval() - this.#currentQuery.removeObserver(this) - } - - setOptions( - options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - notifyOptions?: NotifyOptions, - ): void { - const prevOptions = this.options - const prevQuery = this.#currentQuery - - this.options = this.#client.defaultQueryOptions(options) - - if ( - this.options.enabled !== undefined && - typeof this.options.enabled !== 'boolean' && - typeof this.options.enabled !== 'function' && - typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== - 'boolean' - ) { - throw new Error( - 'Expected enabled to be a boolean or a callback that returns a boolean', - ) - } - - this.#updateQuery() - this.#currentQuery.setOptions(this.options) - - if ( - prevOptions._defaulted && - !shallowEqualObjects(this.options, prevOptions) - ) { - this.#client.getQueryCache().notify({ - type: 'observerOptionsUpdated', - query: this.#currentQuery, - observer: this, - }) - } - - const mounted = this.hasListeners() - - // Fetch if there are subscribers - if ( - mounted && - shouldFetchOptionally( - this.#currentQuery, - prevQuery, - this.options, - prevOptions, - ) - ) { - this.#executeFetch() - } - - // Update result - this.updateResult(notifyOptions) - - // Update stale interval if needed - if ( - mounted && - (this.#currentQuery !== prevQuery || - resolveEnabled(this.options.enabled, this.#currentQuery) !== - resolveEnabled(prevOptions.enabled, this.#currentQuery) || - resolveStaleTime(this.options.staleTime, this.#currentQuery) !== - resolveStaleTime(prevOptions.staleTime, this.#currentQuery)) - ) { - this.#updateStaleTimeout() - } - - const nextRefetchInterval = this.#computeRefetchInterval() - - // Update refetch interval if needed - if ( - mounted && - (this.#currentQuery !== prevQuery || - resolveEnabled(this.options.enabled, this.#currentQuery) !== - resolveEnabled(prevOptions.enabled, this.#currentQuery) || - nextRefetchInterval !== this.#currentRefetchInterval) - ) { - this.#updateRefetchInterval(nextRefetchInterval) - } - } - - getOptimisticResult( - options: DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): QueryObserverResult { - const query = this.#client.getQueryCache().build(this.#client, options) - - const result = this.createResult(query, options) - - if (shouldAssignObserverCurrentProperties(this, result)) { - // this assigns the optimistic result to the current Observer - // because if the query function changes, useQuery will be performing - // an effect where it would fetch again. - // When the fetch finishes, we perform a deep data cloning in order - // to reuse objects references. This deep data clone is performed against - // the `observer.currentResult.data` property - // When QueryKey changes, we refresh the query and get new `optimistic` - // result, while we leave the `observer.currentResult`, so when new data - // arrives, it finds the old `observer.currentResult` which is related - // to the old QueryKey. Which means that currentResult and selectData are - // out of sync already. - // To solve this, we move the cursor of the currentResult every time - // an observer reads an optimistic value. - - // When keeping the previous data, the result doesn't change until new - // data arrives. - this.#currentResult = result - this.#currentResultOptions = this.options - this.#currentResultState = this.#currentQuery.state - } - return result - } - - getCurrentResult(): QueryObserverResult { - return this.#currentResult - } - - trackResult( - result: QueryObserverResult, - onPropTracked?: (key: keyof QueryObserverResult) => void, - ): QueryObserverResult { - const trackedResult = {} as QueryObserverResult - - Object.keys(result).forEach((key) => { - Object.defineProperty(trackedResult, key, { - configurable: false, - enumerable: true, - get: () => { - this.trackProp(key as keyof QueryObserverResult) - onPropTracked?.(key as keyof QueryObserverResult) - return result[key as keyof QueryObserverResult] - }, - }) - }) - - return trackedResult - } - - trackProp(key: keyof QueryObserverResult) { - this.#trackedProps.add(key) - } - - getCurrentQuery(): Query { - return this.#currentQuery - } - - refetch({ ...options }: RefetchOptions = {}): Promise< - QueryObserverResult - > { - return this.fetch({ - ...options, - }) - } - - fetchOptimistic( - options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): Promise> { - const defaultedOptions = this.#client.defaultQueryOptions(options) - - const query = this.#client - .getQueryCache() - .build(this.#client, defaultedOptions) - - return query.fetch().then(() => this.createResult(query, defaultedOptions)) - } - - protected fetch( - fetchOptions: ObserverFetchOptions, - ): Promise> { - return this.#executeFetch({ - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true, - }).then(() => { - this.updateResult() - return this.#currentResult - }) - } - - #executeFetch( - fetchOptions?: Omit, - ): Promise { - // Make sure we reference the latest query as the current one might have been removed - this.#updateQuery() - - // Fetch - let promise: Promise = this.#currentQuery.fetch( - this.options as QueryOptions, - fetchOptions, - ) - - if (!fetchOptions?.throwOnError) { - promise = promise.catch(noop) - } - - return promise - } - - #updateStaleTimeout(): void { - this.#clearStaleTimeout() - const staleTime = resolveStaleTime( - this.options.staleTime, - this.#currentQuery, - ) - - if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { - return - } - - const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) - - // The timeout is sometimes triggered 1 ms before the stale time expiration. - // To mitigate this issue we always add 1 ms to the timeout. - const timeout = time + 1 - - this.#staleTimeoutId = setTimeout(() => { - if (!this.#currentResult.isStale) { - this.updateResult() - } - }, timeout) - } - - #computeRefetchInterval() { - return ( - (typeof this.options.refetchInterval === 'function' - ? this.options.refetchInterval(this.#currentQuery) - : this.options.refetchInterval) ?? false - ) - } - - #updateRefetchInterval(nextInterval: number | false): void { - this.#clearRefetchInterval() - - this.#currentRefetchInterval = nextInterval - - if ( - isServer || - resolveEnabled(this.options.enabled, this.#currentQuery) === false || - !isValidTimeout(this.#currentRefetchInterval) || - this.#currentRefetchInterval === 0 - ) { - return - } - - this.#refetchIntervalId = setInterval(() => { - if ( - this.options.refetchIntervalInBackground || - focusManager.isFocused() - ) { - this.#executeFetch() - } - }, this.#currentRefetchInterval) - } - - #updateTimers(): void { - this.#updateStaleTimeout() - this.#updateRefetchInterval(this.#computeRefetchInterval()) - } - - #clearStaleTimeout(): void { - if (this.#staleTimeoutId) { - clearTimeout(this.#staleTimeoutId) - this.#staleTimeoutId = undefined - } - } - - #clearRefetchInterval(): void { - if (this.#refetchIntervalId) { - clearInterval(this.#refetchIntervalId) - this.#refetchIntervalId = undefined - } - } - - protected createResult( - query: Query, - options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): QueryObserverResult { - const prevQuery = this.#currentQuery - const prevOptions = this.options - const prevResult = this.#currentResult as - | QueryObserverResult - | undefined - const prevResultState = this.#currentResultState - const prevResultOptions = this.#currentResultOptions - const queryChange = query !== prevQuery - const queryInitialState = queryChange - ? query.state - : this.#currentQueryInitialState - - const { state } = query - let newState = { ...state } - let isPlaceholderData = false - let data: TData | undefined - - // Optimistically set result in fetching state if needed - if (options._optimisticResults) { - const mounted = this.hasListeners() - - const fetchOnMount = !mounted && shouldFetchOnMount(query, options) - - const fetchOptionally = - mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions) - - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...fetchState(state.data, query.options), - } - } - if (options._optimisticResults === 'isRestoring') { - newState.fetchStatus = 'idle' - } - } - - let { error, errorUpdatedAt, status } = newState - - // Select data if needed - if (options.select && newState.data !== undefined) { - // Memoize select result - if ( - prevResult && - newState.data === prevResultState?.data && - options.select === this.#selectFn - ) { - data = this.#selectResult - } else { - try { - this.#selectFn = options.select - data = options.select(newState.data) - data = replaceData(prevResult?.data, data, options) - this.#selectResult = data - this.#selectError = null - } catch (selectError) { - this.#selectError = selectError as TError - } - } - } - // Use query data - else { - data = newState.data as unknown as TData - } - - // Show placeholder data if needed - if ( - options.placeholderData !== undefined && - data === undefined && - status === 'pending' - ) { - let placeholderData - - // Memoize placeholder data - if ( - prevResult?.isPlaceholderData && - options.placeholderData === prevResultOptions?.placeholderData - ) { - placeholderData = prevResult.data - } else { - placeholderData = - typeof options.placeholderData === 'function' - ? ( - options.placeholderData as unknown as PlaceholderDataFunction - )( - this.#lastQueryWithDefinedData?.state.data, - this.#lastQueryWithDefinedData as any, - ) - : options.placeholderData - if (options.select && placeholderData !== undefined) { - try { - placeholderData = options.select(placeholderData) - this.#selectError = null - } catch (selectError) { - this.#selectError = selectError as TError - } - } - } - - if (placeholderData !== undefined) { - status = 'success' - data = replaceData( - prevResult?.data, - placeholderData as unknown, - options, - ) as TData - isPlaceholderData = true - } - } - - if (this.#selectError) { - error = this.#selectError as any - data = this.#selectResult - errorUpdatedAt = Date.now() - status = 'error' - } - - const isFetching = newState.fetchStatus === 'fetching' - const isPending = status === 'pending' - const isError = status === 'error' - - const isLoading = isPending && isFetching - const hasData = data !== undefined - - const result: QueryObserverBaseResult = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === 'success', - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: - newState.dataUpdateCount > queryInitialState.dataUpdateCount || - newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === 'paused', - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: this.#currentThenable, - } - - const nextResult = result as QueryObserverResult - - if (this.options.experimental_prefetchInRender) { - const finalizeThenableIfPossible = (thenable: PendingThenable) => { - if (nextResult.status === 'error') { - thenable.reject(nextResult.error) - } else if (nextResult.data !== undefined) { - thenable.resolve(nextResult.data) - } - } - - /** - * Create a new thenable and result promise when the results have changed - */ - const recreateThenable = () => { - const pending = - (this.#currentThenable = - nextResult.promise = - pendingThenable()) - - finalizeThenableIfPossible(pending) - } - - const prevThenable = this.#currentThenable - switch (prevThenable.status) { - case 'pending': - // Finalize the previous thenable if it was pending - // and we are still observing the same query - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable) - } - break - case 'fulfilled': - if ( - nextResult.status === 'error' || - nextResult.data !== prevThenable.value - ) { - recreateThenable() - } - break - case 'rejected': - if ( - nextResult.status !== 'error' || - nextResult.error !== prevThenable.reason - ) { - recreateThenable() - } - break - } - } - - return nextResult - } - - updateResult(notifyOptions?: NotifyOptions): void { - const prevResult = this.#currentResult as - | QueryObserverResult - | undefined - - const nextResult = this.createResult(this.#currentQuery, this.options) - - this.#currentResultState = this.#currentQuery.state - this.#currentResultOptions = this.options - - if (this.#currentResultState.data !== undefined) { - this.#lastQueryWithDefinedData = this.#currentQuery - } - - // Only notify and update result if something has changed - if (shallowEqualObjects(nextResult, prevResult)) { - return - } - - this.#currentResult = nextResult - - // Determine which callbacks to trigger - const defaultNotifyOptions: NotifyOptions = {} - - const shouldNotifyListeners = (): boolean => { - if (!prevResult) { - return true - } - - const { notifyOnChangeProps } = this.options - const notifyOnChangePropsValue = - typeof notifyOnChangeProps === 'function' - ? notifyOnChangeProps() - : notifyOnChangeProps - - if ( - notifyOnChangePropsValue === 'all' || - (!notifyOnChangePropsValue && !this.#trackedProps.size) - ) { - return true - } - - const includedProps = new Set( - notifyOnChangePropsValue ?? this.#trackedProps, - ) - - if (this.options.throwOnError) { - includedProps.add('error') - } - - return Object.keys(this.#currentResult).some((key) => { - const typedKey = key as keyof QueryObserverResult - const changed = this.#currentResult[typedKey] !== prevResult[typedKey] - - return changed && includedProps.has(typedKey) - }) - } - - if (notifyOptions?.listeners !== false && shouldNotifyListeners()) { - defaultNotifyOptions.listeners = true - } - - this.#notify({ ...defaultNotifyOptions, ...notifyOptions }) - } - - #updateQuery(): void { - const query = this.#client.getQueryCache().build(this.#client, this.options) - - if (query === this.#currentQuery) { - return - } - - const prevQuery = this.#currentQuery as - | Query - | undefined - this.#currentQuery = query - this.#currentQueryInitialState = query.state - - if (this.hasListeners()) { - prevQuery?.removeObserver(this) - query.addObserver(this) - } - } - - onQueryUpdate(): void { - this.updateResult() - - if (this.hasListeners()) { - this.#updateTimers() - } - } - - #notify(notifyOptions: NotifyOptions): void { - notifyManager.batch(() => { - // First, trigger the listeners - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(this.#currentResult) - }) - } - - // Then the cache listeners - this.#client.getQueryCache().notify({ - query: this.#currentQuery, - type: 'observerResultsUpdated', - }) - }) - } -} - -function shouldLoadOnMount( - query: Query, - options: QueryObserverOptions, -): boolean { - return ( - resolveEnabled(options.enabled, query) !== false && - query.state.data === undefined && - !(query.state.status === 'error' && options.retryOnMount === false) - ) -} - -function shouldFetchOnMount( - query: Query, - options: QueryObserverOptions, -): boolean { - return ( - shouldLoadOnMount(query, options) || - (query.state.data !== undefined && - shouldFetchOn(query, options, options.refetchOnMount)) - ) -} - -function shouldFetchOn( - query: Query, - options: QueryObserverOptions, - field: (typeof options)['refetchOnMount'] & - (typeof options)['refetchOnWindowFocus'] & - (typeof options)['refetchOnReconnect'], -) { - if (resolveEnabled(options.enabled, query) !== false) { - const value = typeof field === 'function' ? field(query) : field - - return value === 'always' || (value !== false && isStale(query, options)) - } - return false -} - -function shouldFetchOptionally( - query: Query, - prevQuery: Query, - options: QueryObserverOptions, - prevOptions: QueryObserverOptions, -): boolean { - return ( - (query !== prevQuery || - resolveEnabled(prevOptions.enabled, query) === false) && - (!options.suspense || query.state.status !== 'error') && - isStale(query, options) - ) -} - -function isStale( - query: Query, - options: QueryObserverOptions, -): boolean { - return ( - resolveEnabled(options.enabled, query) !== false && - query.isStaleByTime(resolveStaleTime(options.staleTime, query)) - ) -} - -// this function would decide if we will update the observer's 'current' -// properties after an optimistic reading via getOptimisticResult -function shouldAssignObserverCurrentProperties< - TQueryFnData = unknown, - TError = unknown, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - observer: QueryObserver, - optimisticResult: QueryObserverResult, -) { - // if the newly created result isn't what the observer is holding as current, - // then we'll need to update the properties as well - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { - return true - } - - // basically, just keep previous properties if nothing changed - return false -} diff --git a/node_modules/@tanstack/query-core/src/removable.ts b/node_modules/@tanstack/query-core/src/removable.ts deleted file mode 100644 index bf353266caa95257592f27d5485904b09f6d1aca..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/removable.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { isServer, isValidTimeout } from './utils' - -export abstract class Removable { - gcTime!: number - #gcTimeout?: ReturnType - - destroy(): void { - this.clearGcTimeout() - } - - protected scheduleGc(): void { - this.clearGcTimeout() - - if (isValidTimeout(this.gcTime)) { - this.#gcTimeout = setTimeout(() => { - this.optionalRemove() - }, this.gcTime) - } - } - - protected updateGcTime(newGcTime: number | undefined): void { - // Default to 5 minutes (Infinity for server-side) if no gcTime is set - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000), - ) - } - - protected clearGcTimeout() { - if (this.#gcTimeout) { - clearTimeout(this.#gcTimeout) - this.#gcTimeout = undefined - } - } - - protected abstract optionalRemove(): void -} diff --git a/node_modules/@tanstack/query-core/src/retryer.ts b/node_modules/@tanstack/query-core/src/retryer.ts deleted file mode 100644 index baa93aa5b4cfaa5a00b1b78b3a65b9f50a327b54..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/retryer.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { focusManager } from './focusManager' -import { onlineManager } from './onlineManager' -import { pendingThenable } from './thenable' -import { isServer, sleep } from './utils' -import type { CancelOptions, DefaultError, NetworkMode } from './types' - -// TYPES - -interface RetryerConfig { - fn: () => TData | Promise - initialPromise?: Promise - abort?: () => void - onError?: (error: TError) => void - onSuccess?: (data: TData) => void - onFail?: (failureCount: number, error: TError) => void - onPause?: () => void - onContinue?: () => void - retry?: RetryValue - retryDelay?: RetryDelayValue - networkMode: NetworkMode | undefined - canRun: () => boolean -} - -export interface Retryer { - promise: Promise - cancel: (cancelOptions?: CancelOptions) => void - continue: () => Promise - cancelRetry: () => void - continueRetry: () => void - canStart: () => boolean - start: () => Promise -} - -export type RetryValue = boolean | number | ShouldRetryFunction - -type ShouldRetryFunction = ( - failureCount: number, - error: TError, -) => boolean - -export type RetryDelayValue = number | RetryDelayFunction - -type RetryDelayFunction = ( - failureCount: number, - error: TError, -) => number - -function defaultRetryDelay(failureCount: number) { - return Math.min(1000 * 2 ** failureCount, 30000) -} - -export function canFetch(networkMode: NetworkMode | undefined): boolean { - return (networkMode ?? 'online') === 'online' - ? onlineManager.isOnline() - : true -} - -export class CancelledError extends Error { - revert?: boolean - silent?: boolean - constructor(options?: CancelOptions) { - super('CancelledError') - this.revert = options?.revert - this.silent = options?.silent - } -} - -export function isCancelledError(value: any): value is CancelledError { - return value instanceof CancelledError -} - -export function createRetryer( - config: RetryerConfig, -): Retryer { - let isRetryCancelled = false - let failureCount = 0 - let isResolved = false - let continueFn: ((value?: unknown) => void) | undefined - - const thenable = pendingThenable() - - const cancel = (cancelOptions?: CancelOptions): void => { - if (!isResolved) { - reject(new CancelledError(cancelOptions)) - - config.abort?.() - } - } - const cancelRetry = () => { - isRetryCancelled = true - } - - const continueRetry = () => { - isRetryCancelled = false - } - - const canContinue = () => - focusManager.isFocused() && - (config.networkMode === 'always' || onlineManager.isOnline()) && - config.canRun() - - const canStart = () => canFetch(config.networkMode) && config.canRun() - - const resolve = (value: any) => { - if (!isResolved) { - isResolved = true - config.onSuccess?.(value) - continueFn?.() - thenable.resolve(value) - } - } - - const reject = (value: any) => { - if (!isResolved) { - isResolved = true - config.onError?.(value) - continueFn?.() - thenable.reject(value) - } - } - - const pause = () => { - return new Promise((continueResolve) => { - continueFn = (value) => { - if (isResolved || canContinue()) { - continueResolve(value) - } - } - config.onPause?.() - }).then(() => { - continueFn = undefined - if (!isResolved) { - config.onContinue?.() - } - }) - } - - // Create loop function - const run = () => { - // Do nothing if already resolved - if (isResolved) { - return - } - - let promiseOrValue: any - - // we can re-use config.initialPromise on the first call of run() - const initialPromise = - failureCount === 0 ? config.initialPromise : undefined - - // Execute query - try { - promiseOrValue = initialPromise ?? config.fn() - } catch (error) { - promiseOrValue = Promise.reject(error) - } - - Promise.resolve(promiseOrValue) - .then(resolve) - .catch((error) => { - // Stop if the fetch is already resolved - if (isResolved) { - return - } - - // Do we need to retry the request? - const retry = config.retry ?? (isServer ? 0 : 3) - const retryDelay = config.retryDelay ?? defaultRetryDelay - const delay = - typeof retryDelay === 'function' - ? retryDelay(failureCount, error) - : retryDelay - const shouldRetry = - retry === true || - (typeof retry === 'number' && failureCount < retry) || - (typeof retry === 'function' && retry(failureCount, error)) - - if (isRetryCancelled || !shouldRetry) { - // We are done if the query does not need to be retried - reject(error) - return - } - - failureCount++ - - // Notify on fail - config.onFail?.(failureCount, error) - - // Delay - sleep(delay) - // Pause if the document is not visible or when the device is offline - .then(() => { - return canContinue() ? undefined : pause() - }) - .then(() => { - if (isRetryCancelled) { - reject(error) - } else { - run() - } - }) - }) - } - - return { - promise: thenable, - cancel, - continue: () => { - continueFn?.() - return thenable - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - // Start loop - if (canStart()) { - run() - } else { - pause().then(run) - } - return thenable - }, - } -} diff --git a/node_modules/@tanstack/query-core/src/subscribable.ts b/node_modules/@tanstack/query-core/src/subscribable.ts deleted file mode 100644 index 044efe6472059714231a4a713b41e916f8e72b5b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/subscribable.ts +++ /dev/null @@ -1,30 +0,0 @@ -export class Subscribable { - protected listeners = new Set() - - constructor() { - this.subscribe = this.subscribe.bind(this) - } - - subscribe(listener: TListener): () => void { - this.listeners.add(listener) - - this.onSubscribe() - - return () => { - this.listeners.delete(listener) - this.onUnsubscribe() - } - } - - hasListeners(): boolean { - return this.listeners.size > 0 - } - - protected onSubscribe(): void { - // Do nothing - } - - protected onUnsubscribe(): void { - // Do nothing - } -} diff --git a/node_modules/@tanstack/query-core/src/thenable.ts b/node_modules/@tanstack/query-core/src/thenable.ts deleted file mode 100644 index 56717f459d6a9be264b07e076becd0b4fddbd0e7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/thenable.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Thenable types which matches React's types for promises - * - * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises - * - * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 - * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 - */ - -interface Fulfilled { - status: 'fulfilled' - value: T -} -interface Rejected { - status: 'rejected' - reason: unknown -} -interface Pending { - status: 'pending' - - /** - * Resolve the promise with a value. - * Will remove the `resolve` and `reject` properties from the promise. - */ - resolve: (value: T) => void - /** - * Reject the promise with a reason. - * Will remove the `resolve` and `reject` properties from the promise. - */ - reject: (reason: unknown) => void -} - -export type FulfilledThenable = Promise & Fulfilled -export type RejectedThenable = Promise & Rejected -export type PendingThenable = Promise & Pending - -export type Thenable = - | FulfilledThenable - | RejectedThenable - | PendingThenable - -export function pendingThenable(): PendingThenable { - let resolve: Pending['resolve'] - let reject: Pending['reject'] - // this could use `Promise.withResolvers()` in the future - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve - reject = _reject - }) as PendingThenable - - thenable.status = 'pending' - thenable.catch(() => { - // prevent unhandled rejection errors - }) - - function finalize(data: Fulfilled | Rejected) { - Object.assign(thenable, data) - - // clear pending props props to avoid calling them twice - delete (thenable as Partial>).resolve - delete (thenable as Partial>).reject - } - - thenable.resolve = (value) => { - finalize({ - status: 'fulfilled', - value, - }) - - resolve(value) - } - thenable.reject = (reason) => { - finalize({ - status: 'rejected', - reason, - }) - - reject(reason) - } - - return thenable -} diff --git a/node_modules/@tanstack/query-core/src/types.ts b/node_modules/@tanstack/query-core/src/types.ts deleted file mode 100644 index b13e52d16cfa64ec81f25136975176c119cb6487..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/types.ts +++ /dev/null @@ -1,1244 +0,0 @@ -/* istanbul ignore file */ - -import type { DehydrateOptions, HydrateOptions } from './hydration' -import type { MutationState } from './mutation' -import type { FetchDirection, Query, QueryBehavior } from './query' -import type { RetryDelayValue, RetryValue } from './retryer' -import type { QueryFilters, QueryTypeFilter, SkipToken } from './utils' -import type { QueryCache } from './queryCache' -import type { MutationCache } from './mutationCache' - -export type OmitKeyof< - TObject, - TKey extends TStrictly extends 'safely' - ? - | keyof TObject - | (string & Record) - | (number & Record) - | (symbol & Record) - : keyof TObject, - TStrictly extends 'strictly' | 'safely' = 'strictly', -> = Omit - -export type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB - ? TTargetB[AKey] - : TTargetA[AKey] -} - -export type NoInfer = [T][T extends any ? 0 : never] - -export interface Register { - // defaultError: Error - // queryMeta: Record - // mutationMeta: Record -} - -export type DefaultError = Register extends { - defaultError: infer TError -} - ? TError - : Error - -export type QueryKey = ReadonlyArray - -export declare const dataTagSymbol: unique symbol -export type DataTag = TType & { - [dataTagSymbol]: TValue -} - -export type QueryFunction< - T = unknown, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> = (context: QueryFunctionContext) => T | Promise - -export type StaleTime< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = number | ((query: Query) => number) - -export type Enabled< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = - | boolean - | ((query: Query) => boolean) - -export type QueryPersister< - T = unknown, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> = [TPageParam] extends [never] - ? ( - queryFn: QueryFunction, - context: QueryFunctionContext, - query: Query, - ) => T | Promise - : ( - queryFn: QueryFunction, - context: QueryFunctionContext, - query: Query, - ) => T | Promise - -export type QueryFunctionContext< - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> = [TPageParam] extends [never] - ? { - queryKey: TQueryKey - signal: AbortSignal - meta: QueryMeta | undefined - pageParam?: unknown - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown - } - : { - queryKey: TQueryKey - signal: AbortSignal - pageParam: TPageParam - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection - meta: QueryMeta | undefined - } - -export type InitialDataFunction = () => T | undefined - -type NonFunctionGuard = T extends Function ? never : T - -export type PlaceholderDataFunction< - TQueryFnData = unknown, - TError = DefaultError, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = ( - previousData: TQueryData | undefined, - previousQuery: Query | undefined, -) => TQueryData | undefined - -export type QueriesPlaceholderDataFunction = ( - previousData: undefined, - previousQuery: undefined, -) => TQueryData | undefined - -export type QueryKeyHashFunction = ( - queryKey: TQueryKey, -) => string - -export type GetPreviousPageParamFunction = ( - firstPage: TQueryFnData, - allPages: Array, - firstPageParam: TPageParam, - allPageParams: Array, -) => TPageParam | undefined | null - -export type GetNextPageParamFunction = ( - lastPage: TQueryFnData, - allPages: Array, - lastPageParam: TPageParam, - allPageParams: Array, -) => TPageParam | undefined | null - -export interface InfiniteData { - pages: Array - pageParams: Array -} - -export type QueryMeta = Register extends { - queryMeta: infer TQueryMeta -} - ? TQueryMeta extends Record - ? TQueryMeta - : Record - : Record - -export type NetworkMode = 'online' | 'always' | 'offlineFirst' - -export type NotifyOnChangeProps = - | Array - | 'all' - | undefined - | (() => Array | 'all' | undefined) - -export interface QueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue - retryDelay?: RetryDelayValue - networkMode?: NetworkMode - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number - queryFn?: QueryFunction | SkipToken - persister?: QueryPersister< - NoInfer, - NoInfer, - NoInfer - > - queryHash?: string - queryKey?: TQueryKey - queryKeyHashFn?: QueryKeyHashFunction - initialData?: TData | InitialDataFunction - initialDataUpdatedAt?: number | (() => number | undefined) - behavior?: QueryBehavior - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: - | boolean - | ((oldData: unknown | undefined, newData: unknown) => unknown) - _defaulted?: boolean - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number -} - -export interface InitialPageParam { - initialPageParam: TPageParam -} - -export interface InfiniteQueryPageParamsOptions< - TQueryFnData = unknown, - TPageParam = unknown, -> extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction -} - -export type ThrowOnError< - TQueryFnData, - TError, - TQueryData, - TQueryKey extends QueryKey, -> = - | boolean - | (( - error: TError, - query: Query, - ) => boolean) - -export interface QueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> extends WithRequired< - QueryOptions, - 'queryKey' - > { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - */ - staleTime?: StaleTime - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: - | number - | false - | (( - query: Query, - ) => number | false | undefined) - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: - | boolean - | 'always' - | (( - query: Query, - ) => boolean | 'always') - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: - | boolean - | 'always' - | (( - query: Query, - ) => boolean | 'always') - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: - | boolean - | 'always' - | (( - query: Query, - ) => boolean | 'always') - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: - | NonFunctionGuard - | PlaceholderDataFunction< - NonFunctionGuard, - TError, - NonFunctionGuard, - TQueryKey - > - - _optimisticResults?: 'optimistic' | 'isRestoring' - - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean -} - -export type WithRequired = TTarget & { - [_ in TKey]: {} -} -export type Optional = Pick< - Partial, - TKey -> & - OmitKeyof - -export type DefaultedQueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = WithRequired< - QueryObserverOptions, - 'throwOnError' | 'refetchOnReconnect' | 'queryHash' -> - -export interface InfiniteQueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends QueryObserverOptions< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey, - TPageParam - >, - InfiniteQueryPageParamsOptions {} - -export type DefaultedInfiniteQueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = WithRequired< - InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - 'throwOnError' | 'refetchOnReconnect' | 'queryHash' -> - -export interface FetchQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> extends WithRequired< - QueryOptions, - 'queryKey' - > { - initialPageParam?: never - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTime -} - -export interface EnsureQueryDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> extends FetchQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - > { - revalidateIfStale?: boolean -} - -export type EnsureInfiniteQueryDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - revalidateIfStale?: boolean -} - -type FetchInfiniteQueryPages = - | { pages?: never } - | { - pages: number - getNextPageParam: GetNextPageParamFunction - } - -export type FetchInfiniteQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = Omit< - FetchQueryOptions< - TQueryFnData, - TError, - InfiniteData, - TQueryKey, - TPageParam - >, - 'initialPageParam' -> & - InitialPageParam & - FetchInfiniteQueryPages - -export interface ResultOptions { - throwOnError?: boolean -} - -export interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean -} - -export interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none' -} - -export interface RefetchQueryFilters extends QueryFilters {} - -export interface InvalidateOptions extends RefetchOptions {} -export interface ResetOptions extends RefetchOptions {} - -export interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean -} - -export interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean -} - -export type QueryStatus = 'pending' | 'error' | 'success' -export type FetchStatus = 'fetching' | 'paused' | 'idle' - -export interface QueryObserverBaseResult< - TData = unknown, - TError = DefaultError, -> { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null - /** - * The sum of all errors. - */ - errorUpdateCount: number - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean - /** - * A function to manually refetch the query. - */ - refetch: ( - options?: RefetchOptions, - ) => Promise> - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise -} - -export interface QueryObserverPendingResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoadingError: false - isRefetchError: false - isSuccess: false - status: 'pending' -} - -export interface QueryObserverLoadingResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoading: true - isLoadingError: false - isRefetchError: false - isSuccess: false - status: 'pending' -} - -export interface QueryObserverLoadingErrorResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: undefined - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: true - isRefetchError: false - isSuccess: false - status: 'error' -} - -export interface QueryObserverRefetchErrorResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: TData - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: true - isSuccess: false - status: 'error' -} - -export interface QueryObserverSuccessResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: TData - error: null - isError: false - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: false - isSuccess: true - status: 'success' -} - -export type DefinedQueryObserverResult< - TData = unknown, - TError = DefaultError, -> = - | QueryObserverRefetchErrorResult - | QueryObserverSuccessResult - -export type QueryObserverResult = - | DefinedQueryObserverResult - | QueryObserverLoadingErrorResult - | QueryObserverLoadingResult - | QueryObserverPendingResult - -export interface InfiniteQueryObserverBaseResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: ( - options?: FetchNextPageOptions, - ) => Promise> - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: ( - options?: FetchPreviousPageOptions, - ) => Promise> - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean -} - -export interface InfiniteQueryObserverPendingResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoadingError: false - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: false - status: 'pending' -} - -export interface InfiniteQueryObserverLoadingResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoading: true - isLoadingError: false - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: false - status: 'pending' -} - -export interface InfiniteQueryObserverLoadingErrorResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: undefined - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: true - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: false - status: 'error' -} - -export interface InfiniteQueryObserverRefetchErrorResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: TData - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: true - isSuccess: false - status: 'error' -} - -export interface InfiniteQueryObserverSuccessResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: TData - error: null - isError: false - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: true - status: 'success' -} - -export type DefinedInfiniteQueryObserverResult< - TData = unknown, - TError = DefaultError, -> = - | InfiniteQueryObserverRefetchErrorResult - | InfiniteQueryObserverSuccessResult - -export type InfiniteQueryObserverResult< - TData = unknown, - TError = DefaultError, -> = - | DefinedInfiniteQueryObserverResult - | InfiniteQueryObserverLoadingErrorResult - | InfiniteQueryObserverLoadingResult - | InfiniteQueryObserverPendingResult - -export type MutationKey = ReadonlyArray - -export type MutationStatus = 'idle' | 'pending' | 'success' | 'error' - -export type MutationScope = { - id: string -} - -export type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta -} - ? TMutationMeta extends Record - ? TMutationMeta - : Record - : Record - -export type MutationFunction = ( - variables: TVariables, -) => Promise - -export interface MutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> { - mutationFn?: MutationFunction - mutationKey?: MutationKey - onMutate?: ( - variables: TVariables, - ) => Promise | TContext | undefined - onSuccess?: ( - data: TData, - variables: TVariables, - context: TContext, - ) => Promise | unknown - onError?: ( - error: TError, - variables: TVariables, - context: TContext | undefined, - ) => Promise | unknown - onSettled?: ( - data: TData | undefined, - error: TError | null, - variables: TVariables, - context: TContext | undefined, - ) => Promise | unknown - retry?: RetryValue - retryDelay?: RetryDelayValue - networkMode?: NetworkMode - gcTime?: number - _defaulted?: boolean - meta?: MutationMeta - scope?: MutationScope -} - -export interface MutationObserverOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean) -} - -export interface MutateOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> { - onSuccess?: (data: TData, variables: TVariables, context: TContext) => void - onError?: ( - error: TError, - variables: TVariables, - context: TContext | undefined, - ) => void - onSettled?: ( - data: TData | undefined, - error: TError | null, - variables: TVariables, - context: TContext | undefined, - ) => void -} - -export type MutateFunction< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> = ( - variables: TVariables, - options?: MutateOptions, -) => Promise - -export interface MutationObserverBaseResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void -} - -export interface MutationObserverIdleResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends MutationObserverBaseResult { - data: undefined - variables: undefined - error: null - isError: false - isIdle: true - isPending: false - isSuccess: false - status: 'idle' -} - -export interface MutationObserverLoadingResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends MutationObserverBaseResult { - data: undefined - variables: TVariables - error: null - isError: false - isIdle: false - isPending: true - isSuccess: false - status: 'pending' -} - -export interface MutationObserverErrorResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends MutationObserverBaseResult { - data: undefined - error: TError - variables: TVariables - isError: true - isIdle: false - isPending: false - isSuccess: false - status: 'error' -} - -export interface MutationObserverSuccessResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends MutationObserverBaseResult { - data: TData - error: null - variables: TVariables - isError: false - isIdle: false - isPending: false - isSuccess: true - status: 'success' -} - -export type MutationObserverResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> = - | MutationObserverIdleResult - | MutationObserverLoadingResult - | MutationObserverErrorResult - | MutationObserverSuccessResult - -export interface QueryClientConfig { - queryCache?: QueryCache - mutationCache?: MutationCache - defaultOptions?: DefaultOptions -} - -export interface DefaultOptions { - queries?: OmitKeyof< - QueryObserverOptions, - 'suspense' | 'queryKey' - > - mutations?: MutationObserverOptions - hydrate?: HydrateOptions['defaultOptions'] - dehydrate?: DehydrateOptions -} - -export interface CancelOptions { - revert?: boolean - silent?: boolean -} - -export interface SetDataOptions { - updatedAt?: number -} - -export type NotifyEventType = - | 'added' - | 'removed' - | 'updated' - | 'observerAdded' - | 'observerRemoved' - | 'observerResultsUpdated' - | 'observerOptionsUpdated' - -export interface NotifyEvent { - type: NotifyEventType -} diff --git a/node_modules/@tanstack/query-core/src/utils.ts b/node_modules/@tanstack/query-core/src/utils.ts deleted file mode 100644 index d5137806400f6071bb91c95384c89774229a8db7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/query-core/src/utils.ts +++ /dev/null @@ -1,422 +0,0 @@ -import type { - DefaultError, - Enabled, - FetchStatus, - MutationKey, - MutationStatus, - QueryFunction, - QueryKey, - QueryOptions, - StaleTime, -} from './types' -import type { Mutation } from './mutation' -import type { FetchOptions, Query } from './query' - -// TYPES - -export interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter - /** - * Match query key exactly - */ - exact?: boolean - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean - /** - * Include queries matching this query key - */ - queryKey?: QueryKey - /** - * Include or exclude stale queries - */ - stale?: boolean - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus -} - -export interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean - /** - * Include mutations matching this mutation key - */ - mutationKey?: MutationKey - /** - * Filter by mutation status - */ - status?: MutationStatus -} - -export type Updater = TOutput | ((input: TInput) => TOutput) - -export type QueryTypeFilter = 'all' | 'active' | 'inactive' - -// UTILS - -export const isServer = typeof window === 'undefined' || 'Deno' in globalThis - -export function noop(): undefined { - return undefined -} - -export function functionalUpdate( - updater: Updater, - input: TInput, -): TOutput { - return typeof updater === 'function' - ? (updater as (_: TInput) => TOutput)(input) - : updater -} - -export function isValidTimeout(value: unknown): value is number { - return typeof value === 'number' && value >= 0 && value !== Infinity -} - -export function timeUntilStale(updatedAt: number, staleTime?: number): number { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0) -} - -export function resolveStaleTime< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - staleTime: undefined | StaleTime, - query: Query, -): number | undefined { - return typeof staleTime === 'function' ? staleTime(query) : staleTime -} - -export function resolveEnabled< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - enabled: undefined | Enabled, - query: Query, -): boolean | undefined { - return typeof enabled === 'function' ? enabled(query) : enabled -} - -export function matchQuery( - filters: QueryFilters, - query: Query, -): boolean { - const { - type = 'all', - exact, - fetchStatus, - predicate, - queryKey, - stale, - } = filters - - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false - } - } - - if (type !== 'all') { - const isActive = query.isActive() - if (type === 'active' && !isActive) { - return false - } - if (type === 'inactive' && isActive) { - return false - } - } - - if (typeof stale === 'boolean' && query.isStale() !== stale) { - return false - } - - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false - } - - if (predicate && !predicate(query)) { - return false - } - - return true -} - -export function matchMutation( - filters: MutationFilters, - mutation: Mutation, -): boolean { - const { exact, status, predicate, mutationKey } = filters - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false - } - } - - if (status && mutation.state.status !== status) { - return false - } - - if (predicate && !predicate(mutation)) { - return false - } - - return true -} - -export function hashQueryKeyByOptions( - queryKey: TQueryKey, - options?: Pick, 'queryKeyHashFn'>, -): string { - const hashFn = options?.queryKeyHashFn || hashKey - return hashFn(queryKey) -} - -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -export function hashKey(queryKey: QueryKey | MutationKey): string { - return JSON.stringify(queryKey, (_, val) => - isPlainObject(val) - ? Object.keys(val) - .sort() - .reduce((result, key) => { - result[key] = val[key] - return result - }, {} as any) - : val, - ) -} - -/** - * Checks if key `b` partially matches with key `a`. - */ -export function partialMatchKey(a: QueryKey, b: QueryKey): boolean -export function partialMatchKey(a: any, b: any): boolean { - if (a === b) { - return true - } - - if (typeof a !== typeof b) { - return false - } - - if (a && b && typeof a === 'object' && typeof b === 'object') { - return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key])) - } - - return false -} - -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -export function replaceEqualDeep(a: unknown, b: T): T -export function replaceEqualDeep(a: any, b: any): any { - if (a === b) { - return a - } - - const array = isPlainArray(a) && isPlainArray(b) - - if (array || (isPlainObject(a) && isPlainObject(b))) { - const aItems = array ? a : Object.keys(a) - const aSize = aItems.length - const bItems = array ? b : Object.keys(b) - const bSize = bItems.length - const copy: any = array ? [] : {} - - let equalItems = 0 - - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i] - if ( - ((!array && aItems.includes(key)) || array) && - a[key] === undefined && - b[key] === undefined - ) { - copy[key] = undefined - equalItems++ - } else { - copy[key] = replaceEqualDeep(a[key], b[key]) - if (copy[key] === a[key] && a[key] !== undefined) { - equalItems++ - } - } - } - - return aSize === bSize && equalItems === aSize ? a : copy - } - - return b -} - -/** - * Shallow compare objects. - */ -export function shallowEqualObjects>( - a: T, - b: T | undefined, -): boolean { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false - } - - for (const key in a) { - if (a[key] !== b[key]) { - return false - } - } - - return true -} - -export function isPlainArray(value: unknown) { - return Array.isArray(value) && value.length === Object.keys(value).length -} - -// Copied from: https://github.com/jonschlinkert/is-plain-object -// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types -export function isPlainObject(o: any): o is Object { - if (!hasObjectPrototype(o)) { - return false - } - - // If has no constructor - const ctor = o.constructor - if (ctor === undefined) { - return true - } - - // If has modified prototype - const prot = ctor.prototype - if (!hasObjectPrototype(prot)) { - return false - } - - // If constructor does not have an Object-specific method - if (!prot.hasOwnProperty('isPrototypeOf')) { - return false - } - - // Handles Objects created by Object.create() - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false - } - - // Most likely a plain Object - return true -} - -function hasObjectPrototype(o: any): boolean { - return Object.prototype.toString.call(o) === '[object Object]' -} - -export function sleep(timeout: number): Promise { - return new Promise((resolve) => { - setTimeout(resolve, timeout) - }) -} - -export function replaceData< - TData, - TOptions extends QueryOptions, ->(prevData: TData | undefined, data: TData, options: TOptions): TData { - if (typeof options.structuralSharing === 'function') { - return options.structuralSharing(prevData, data) as TData - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== 'production') { - try { - return replaceEqualDeep(prevData, data) - } catch (error) { - console.error( - `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}`, - ) - } - } - // Structurally share data between prev and new data if needed - return replaceEqualDeep(prevData, data) - } - return data -} - -export function keepPreviousData( - previousData: T | undefined, -): T | undefined { - return previousData -} - -export function addToEnd(items: Array, item: T, max = 0): Array { - const newItems = [...items, item] - return max && newItems.length > max ? newItems.slice(1) : newItems -} - -export function addToStart(items: Array, item: T, max = 0): Array { - const newItems = [item, ...items] - return max && newItems.length > max ? newItems.slice(0, -1) : newItems -} - -export const skipToken = Symbol() -export type SkipToken = typeof skipToken - -export function ensureQueryFn< - TQueryFnData = unknown, - TQueryKey extends QueryKey = QueryKey, ->( - options: { - queryFn?: QueryFunction | SkipToken - queryHash?: string - }, - fetchOptions?: FetchOptions, -): QueryFunction { - if (process.env.NODE_ENV !== 'production') { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`, - ) - } - } - - // if we attempt to retry a fetch that was triggered from an initialPromise - // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise - // if an observer has already mounted, we will be able to retry with that queryFn - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise! - } - - if (!options.queryFn || options.queryFn === skipToken) { - return () => - Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)) - } - - return options.queryFn -} diff --git a/node_modules/@tanstack/react-query/LICENSE b/node_modules/@tanstack/react-query/LICENSE deleted file mode 100644 index 1869e21fc3c80b3010c3e60c5ab6dda077ce1f22..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021-present Tanner Linsley - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@tanstack/react-query/README.md b/node_modules/@tanstack/react-query/README.md deleted file mode 100644 index 96bffea2f5d170db119d68181b2150774cad5fe2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/README.md +++ /dev/null @@ -1,48 +0,0 @@ - - -![TanStack Query Header](https://github.com/TanStack/query/raw/main/media/repo-header.png) - -Hooks for fetching, caching and updating asynchronous data in React - - - #TanStack - - - - - - - - - - semantic-release - - Join the discussion on Github -Best of JS - - - - - Gitpod Ready-to-Code - - -Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger) - -## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more! - -## Quick Features - -- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!) -- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime) -- Parallel + Dependent Queries -- Mutations + Reactive Query Refetching -- Multi-layer Cache + Automatic Garbage Collection -- Paginated + Cursor-based Queries -- Load-More + Infinite Scroll Queries w/ Scroll Recovery -- Request Cancellation -- [React Suspense](https://react.dev/reference/react/Suspense) + Fetch-As-You-Render Query Prefetching -- Dedicated Devtools - -### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/) - - diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs deleted file mode 100644 index a652e23b0cf93a781fdf888adbee64cbc75849f7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs +++ /dev/null @@ -1,208 +0,0 @@ -module.exports = ({ root, jscodeshift }) => { - const findImportIdentifierOf = (importSpecifiers, identifier) => { - const specifier = importSpecifiers - .filter((node) => node.value.imported.name === identifier) - .paths() - - if (specifier.length > 0) { - return specifier[0].value.local - } - - return jscodeshift.identifier(identifier) - } - - const findImportSpecifiers = (packageName) => - root - .find(jscodeshift.ImportDeclaration, { - source: { - value: packageName, - }, - }) - .find(jscodeshift.ImportSpecifier, {}) - - const locateImports = ( - identifiers, - packageName = '@tanstack/react-query', - ) => { - const findNamespaceImportIdentifier = () => { - const specifier = root - .find(jscodeshift.ImportDeclaration, { - source: { - value: packageName, - }, - }) - .find(jscodeshift.ImportNamespaceSpecifier) - .paths() - - return specifier.length > 0 ? specifier[0].value.local : null - } - - /** - * First, we search for the namespace import identifier because if we have any, we assume the consumer uses - * namespace imports. In this case, we won't search for named imports at all. - */ - const namespaceImportIdentifier = findNamespaceImportIdentifier() - - if (namespaceImportIdentifier) { - const identifierMap = {} - - for (const identifier of identifiers) { - identifierMap[identifier] = jscodeshift.identifier(identifier) - } - - return { - namespace: namespaceImportIdentifier, - ...identifierMap, - } - } - - const importSpecifiers = findImportSpecifiers(packageName) - const identifierMap = {} - - for (const identifier of identifiers) { - identifierMap[identifier] = findImportIdentifierOf( - importSpecifiers, - identifier, - ) - } - - return { - namespace: null, - ...identifierMap, - } - } - - const findAllMethodCalls = () => - root - // First, we need to find all method calls. - .find(jscodeshift.CallExpression, { - callee: { - type: jscodeshift.MemberExpression.name, - property: { - type: jscodeshift.Identifier.name, - }, - }, - }) - - const findQueryClientIdentifiers = (importIdentifiers) => - root - .find(jscodeshift.VariableDeclarator, {}) - .filter((node) => { - if (node.value.init) { - const initializer = node.value.init - - return ( - isClassInstantiationOf( - initializer, - getSelectorByImports(importIdentifiers, 'QueryClient'), - ) || - isFunctionCallOf( - initializer, - getSelectorByImports(importIdentifiers, 'useQueryClient'), - ) - ) - } - - return false - }) - .paths() - .map((node) => node.value.id.name) - - const isCallExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.CallExpression.name }) - - const isIdentifier = (node) => - jscodeshift.match(node, { type: jscodeshift.Identifier.name }) - - const isMemberExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.MemberExpression.name }) - - const isNewExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.NewExpression.name }) - - const isArrayExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.ArrayExpression.name }) - - const isObjectExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.ObjectExpression.name }) - - const isObjectProperty = (node) => - jscodeshift.match(node, { type: jscodeshift.ObjectProperty.name }) - - const isSpreadElement = (node) => - jscodeshift.match(node, { type: jscodeshift.SpreadElement.name }) - - /** - * @param {import('jscodeshift').Node} node - * @returns {boolean} - */ - const isFunctionDefinition = (node) => { - const isArrowFunctionExpression = jscodeshift.match(node, { - type: jscodeshift.ArrowFunctionExpression.name, - }) - const isFunctionExpression = jscodeshift.match(node, { - type: jscodeshift.FunctionExpression.name, - }) - - return isArrowFunctionExpression || isFunctionExpression - } - - const warn = (message) => { - if (process.env.NODE_ENV !== 'test') { - console.warn(message) - } - } - - const isClassInstantiationOf = (node, selector) => { - if (!isNewExpression(node)) { - return false - } - - const parts = selector.split('.') - - return parts.length === 1 - ? isIdentifier(node.callee) && node.callee.name === parts[0] - : isMemberExpression(node.callee) && - node.callee.object.name === parts[0] && - node.callee.property.name === parts[1] - } - - const isFunctionCallOf = (node, selector) => { - if (!isCallExpression(node)) { - return false - } - - const parts = selector.split('.') - - return parts.length === 1 - ? isIdentifier(node.callee) && node.callee.name === parts[0] - : isMemberExpression(node.callee) && - node.callee.object.name === parts[0] && - node.callee.property.name === parts[1] - } - - const getSelectorByImports = (imports, path) => - imports.namespace - ? `${imports.namespace.name}.${imports[path].name}` - : imports[path].name - - return { - findAllMethodCalls, - getSelectorByImports, - isCallExpression, - isClassInstantiationOf, - isFunctionCallOf, - isIdentifier, - isMemberExpression, - isArrayExpression, - isObjectExpression, - isObjectProperty, - isSpreadElement, - isFunctionDefinition, - locateImports, - warn, - queryClient: { - findQueryClientIdentifiers, - }, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs deleted file mode 100644 index e20bc01fa743c316921c04ffa71eeb0441101f76..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs +++ /dev/null @@ -1,124 +0,0 @@ -module.exports = ({ - jscodeshift, - utils, - root, - packageName = '@tanstack/react-query', -}) => { - const isGetQueryCacheMethodCall = ( - initializer, - importIdentifiers, - knownQueryClientIds, - ) => { - const isKnownQueryClient = (node) => - utils.isIdentifier(node) && knownQueryClientIds.includes(node.name) - - const isGetQueryCacheIdentifier = (node) => - utils.isIdentifier(node) && node.name === 'getQueryCache' - - const isValidInitializer = (node) => - utils.isCallExpression(node) && utils.isMemberExpression(node.callee) - - if (isValidInitializer(initializer)) { - const instance = initializer.callee.object - - return ( - isGetQueryCacheIdentifier(initializer.callee.property) && - (isKnownQueryClient(instance) || - utils.isFunctionCallOf( - instance, - utils.getSelectorByImports(importIdentifiers, 'useQueryClient'), - )) - ) - } - - return false - } - - const findQueryCacheInstantiations = ( - importIdentifiers, - knownQueryClientIds, - ) => - root.find(jscodeshift.VariableDeclarator, {}).filter((node) => { - if (node.value.init) { - const initializer = node.value.init - - return ( - utils.isClassInstantiationOf( - initializer, - utils.getSelectorByImports(importIdentifiers, 'QueryCache'), - ) || - isGetQueryCacheMethodCall( - initializer, - importIdentifiers, - knownQueryClientIds, - ) - ) - } - - return false - }) - - const filterQueryCacheMethodCalls = (node) => - utils.isIdentifier(node) && ['find', 'findAll'].includes(node.name) - - const findQueryCacheMethodCalls = (importIdentifiers) => { - /** - * Here we collect all query client instantiations. We have to make aware of them because the query cache can be - * accessed by the query client as well. - */ - const queryClientIdentifiers = - utils.queryClient.findQueryClientIdentifiers(importIdentifiers) - /** - * Here we collect all query cache instantiations. The reason is simple: the methods can be called on query cache - * instances, to locate the possible usages we need to be aware of the identifier names. - */ - const queryCacheIdentifiers = findQueryCacheInstantiations( - importIdentifiers, - queryClientIdentifiers, - ) - .paths() - .map((node) => node.value.id.name) - - return ( - utils - // First, we need to find all method calls. - .findAllMethodCalls() - // Then we narrow the collection to all `fetch` and `fetchAll` methods. - .filter((node) => - filterQueryCacheMethodCalls(node.value.callee.property), - ) - .filter((node) => { - const object = node.value.callee.object - - // If the method is called on a `QueryCache` instance, we keep it in the collection. - if (utils.isIdentifier(object)) { - return queryCacheIdentifiers.includes(object.name) - } - - // If the method is called on a `QueryClient` instance, we keep it in the collection. - if (utils.isCallExpression(object)) { - return isGetQueryCacheMethodCall( - object, - importIdentifiers, - queryClientIdentifiers, - ) - } - - return false - }) - ) - } - - const execute = (replacer) => { - findQueryCacheMethodCalls( - utils.locateImports( - ['QueryCache', 'QueryClient', 'useQueryClient'], - packageName, - ), - ).replaceWith(replacer) - } - - return { - execute, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs deleted file mode 100644 index 8282940da694e572b4227d0593b60dbcbb319b50..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs +++ /dev/null @@ -1,53 +0,0 @@ -module.exports = ({ - jscodeshift, - utils, - root, - packageName = '@tanstack/react-query', -}) => { - const filterQueryClientMethodCalls = (node, methods) => - utils.isIdentifier(node) && methods.includes(node.name) - - const findQueryClientMethodCalls = (importIdentifiers, methods) => { - /** - * Here we collect all query client instantiations. We have to make aware of them because some method calls might - * be invoked on these instances. - */ - const queryClientIdentifiers = - utils.queryClient.findQueryClientIdentifiers(importIdentifiers) - - return ( - utils - // First, we need to find all method calls. - .findAllMethodCalls() - // Then we narrow the collection to `QueryClient` methods. - .filter((node) => - filterQueryClientMethodCalls(node.value.callee.property, methods), - ) - .filter((node) => { - const object = node.value.callee.object - - // If the method is called on a `QueryClient` instance, we keep it in the collection. - if (utils.isIdentifier(object)) { - return queryClientIdentifiers.includes(object.name) - } - - // If the method is called on the return value of `useQueryClient` hook, we keep it in the collection. - return utils.isFunctionCallOf( - object, - utils.getSelectorByImports(importIdentifiers, 'useQueryClient'), - ) - }) - ) - } - - const execute = (methods, replacer) => { - findQueryClientMethodCalls( - utils.locateImports(['QueryClient', 'useQueryClient'], packageName), - methods, - ).replaceWith(replacer) - } - - return { - execute, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs deleted file mode 100644 index e364ae0bdc247db9f8c0e57ab45215cab1398dd7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = ({ - jscodeshift, - utils, - root, - packageName = '@tanstack/react-query', -}) => { - const filterUseQueryLikeHookCalls = (node, importIdentifiers, hooks) => { - for (const hook of hooks) { - const selector = utils.getSelectorByImports(importIdentifiers, hook) - - if (utils.isFunctionCallOf(node, selector)) { - return true - } - } - - return false - } - - const findUseQueryLikeHookCalls = (importIdentifiers, hooks) => - root - // First, we need to find all call expressions. - .find(jscodeshift.CallExpression, {}) - // Then we narrow the collection to the `useQuery` like hook calls. - .filter((node) => - filterUseQueryLikeHookCalls(node.value, importIdentifiers, hooks), - ) - - const execute = (hooks, replacer) => { - findUseQueryLikeHookCalls( - utils.locateImports(hooks, packageName), - hooks, - ).replaceWith(replacer) - } - - return { - execute, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs deleted file mode 100644 index ad62c084a5fc304ef422134d931b88046bc69421..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs +++ /dev/null @@ -1,181 +0,0 @@ -const createUtilsObject = require('../utils/index.cjs') -const createKeyReplacer = require('./utils/replacers/key-replacer.cjs') -const createUseQueryLikeTransformer = require('../utils/transformers/use-query-like-transformer.cjs') -const createQueryClientTransformer = require('../utils/transformers/query-client-transformer.cjs') -const createQueryCacheTransformer = require('../utils/transformers/query-cache-transformer.cjs') - -const transformQueryClientUsages = ({ - jscodeshift, - utils, - root, - filePath, - packageName, -}) => { - const transformer = createQueryClientTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - const replacer = createKeyReplacer({ jscodeshift, root, filePath }) - - transformer.execute( - [ - // Not object syntax-aware methods. - 'getMutationDefaults', - 'getQueriesData', - 'getQueryData', - 'getQueryDefaults', - 'getQueryState', - 'isFetching', - 'setMutationDefaults', - 'setQueriesData', - 'setQueryData', - 'setQueryDefaults', - // Object syntax-aware methods. - 'cancelQueries', - 'fetchInfiniteQuery', - 'fetchQuery', - 'invalidateQueries', - 'prefetchInfiniteQuery', - 'prefetchQuery', - 'refetchQueries', - 'removeQueries', - 'resetQueries', - ], - replacer, - ) -} - -const transformUseQueriesUsages = ({ - jscodeshift, - utils, - root, - packageName, -}) => { - const transformer = createUseQueryLikeTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - const replacer = ({ node }) => { - /** - * When the node doesn't have the 'original' property, that means the codemod has been already applied, - * so we don't need to do any changes. - */ - if (!node.original) { - return node - } - - const newCallExpression = jscodeshift.callExpression(node.original.callee, [ - jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier('queries'), - node.original.arguments[0], - ), - ]), - ]) - - // TODO: This should be part of one function! - if (node.typeParameters) { - newCallExpression.typeArguments = node.typeParameters - } - - return newCallExpression - } - - transformer.execute(['useQueries'], replacer) -} - -const transformUseQueryLikeUsages = ({ - jscodeshift, - utils, - root, - filePath, - packageName, -}) => { - const transformer = createUseQueryLikeTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - - transformer.execute( - ['useQuery', 'useInfiniteQuery', 'useIsFetching', 'useIsMutating'], - createKeyReplacer({ - jscodeshift, - root, - filePath, - keyName: 'queryKey', - }), - ) - transformer.execute( - ['useMutation'], - createKeyReplacer({ - jscodeshift, - root, - filePath, - keyName: 'mutationKey', - }), - ) -} - -const transformQueryCacheUsages = ({ - jscodeshift, - utils, - root, - filePath, - packageName, -}) => { - const transformer = createQueryCacheTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - const replacer = createKeyReplacer({ jscodeshift, root, filePath }) - - transformer.execute(replacer) -} - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - // TODO: Execute the transformers only when it contains a `react-query` import! - - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - const packageName = 'react-query' - - // This function transforms usages like `useQuery` and `useMutation`. - transformUseQueryLikeUsages({ - jscodeshift, - utils, - root, - filePath, - packageName, - }) - // This function transforms usages of `useQueries`. - transformUseQueriesUsages({ - jscodeshift, - utils, - root, - packageName, - }) - // This function transforms usages of `QueryClient`. - transformQueryClientUsages({ - jscodeshift, - utils, - root, - filePath, - packageName, - }) - // This function transforms usages of `QueryCache`. - transformQueryCacheUsages({ jscodeshift, utils, root, filePath, packageName }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs deleted file mode 100644 index 754e2f7bd5060aaebcb66b134c72ae17e0464e21..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - const replacements = [ - { from: 'react-query', to: '@tanstack/react-query' }, - { from: 'react-query/devtools', to: '@tanstack/react-query-devtools' }, - ] - - replacements.forEach(({ from, to }) => { - root - .find(jscodeshift.ImportDeclaration, { - source: { - value: from, - }, - }) - .replaceWith(({ node }) => { - node.source.value = to - - return node - }) - }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs deleted file mode 100644 index 1bd62984e67e8ae08185baded5d219fc6ff8eb39..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs +++ /dev/null @@ -1,164 +0,0 @@ -class UnprocessableKeyError extends Error { - constructor(message) { - super(message) - this.name = 'UnprocessableKeyError' - } -} - -module.exports = ({ jscodeshift, root, filePath, keyName = 'queryKey' }) => { - const isArrayExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.ArrayExpression.name }) - - const isStringLiteral = (node) => - jscodeshift.match(node, { type: jscodeshift.StringLiteral.name }) || - jscodeshift.match(node, { type: jscodeshift.Literal.name }) - - const isTemplateLiteral = (node) => - jscodeshift.match(node, { type: jscodeshift.TemplateLiteral.name }) - - const findVariableDeclaration = (node) => { - const declarations = root - .find(jscodeshift.VariableDeclarator, { - id: { - type: jscodeshift.Identifier.name, - name: node.name, - }, - }) - .paths() - - return declarations.length > 0 ? declarations[0] : null - } - - const createKeyValue = (node) => { - // When the node is a string literal we convert it into an array of strings. - if (isStringLiteral(node)) { - return jscodeshift.arrayExpression([ - jscodeshift.stringLiteral(node.value), - ]) - } - - // When the node is a template literal we convert it into an array of template literals. - if (isTemplateLiteral(node)) { - return jscodeshift.arrayExpression([ - jscodeshift.templateLiteral(node.quasis, node.expressions), - ]) - } - - if (jscodeshift.match(node, { type: jscodeshift.Identifier.name })) { - // When the node is an identifier at first, we try to find its declaration, because we will try - // to guess its type. - const variableDeclaration = findVariableDeclaration(node) - - if (!variableDeclaration) { - throw new UnprocessableKeyError( - `In file ${filePath} at line ${node.loc.start.line} the type of identifier \`${node.name}\` couldn't be recognized, so the codemod couldn't be applied. Please migrate manually.`, - ) - } - - const initializer = variableDeclaration.value.init - - // When it's a string, we just wrap it into an array expression. - if (isStringLiteral(initializer) || isTemplateLiteral(initializer)) { - return jscodeshift.arrayExpression([node]) - } - } - - throw new UnprocessableKeyError( - `In file ${filePath} at line ${node.loc.start.line} the type of the \`${keyName}\` couldn't be recognized, so the codemod couldn't be applied. Please migrate manually.`, - ) - } - - const createKeyProperty = (node) => - jscodeshift.property( - 'init', - jscodeshift.identifier(keyName), - createKeyValue(node), - ) - - const getPropertyFromObjectExpression = (objectExpression, propertyName) => - objectExpression.properties.find( - (property) => property.key.name === propertyName, - ) ?? null - - const buildWithTypeArguments = (node, builder) => { - const newNode = builder(node) - - if (node.typeParameters) { - newNode.typeArguments = node.typeParameters - } - - return newNode - } - - return ({ node }) => { - // When the node doesn't have the 'original' property, that means the codemod has been already applied, - // so we don't need to do any changes. - if (!node.original) { - return node - } - - const methodArguments = node.arguments - - // The method call doesn't have any arguments, we have nothing to do in this case. - if (methodArguments.length === 0) { - return node - } - - try { - const [firstArgument, ...restOfTheArguments] = methodArguments - - if ( - jscodeshift.match(firstArgument, { - type: jscodeshift.ObjectExpression.name, - }) - ) { - const originalKey = getPropertyFromObjectExpression( - firstArgument, - keyName, - ) - - if (!originalKey) { - throw new UnprocessableKeyError( - `In file ${filePath} at line ${node.loc.start.line} the \`${keyName}\` couldn't be found. Did you forget to add it?`, - ) - } - - const restOfTheProperties = firstArgument.properties.filter( - (item) => item.key.name !== keyName, - ) - - return buildWithTypeArguments(node, (originalNode) => - jscodeshift.callExpression(originalNode.original.callee, [ - jscodeshift.objectExpression([ - createKeyProperty(originalKey.value), - ...restOfTheProperties, - ]), - ...restOfTheArguments, - ]), - ) - } - - // When the node is an array expression we just simply return it because we want query keys to be arrays. - if (isArrayExpression(firstArgument)) { - return node - } - - return buildWithTypeArguments(node, (originalNode) => - jscodeshift.callExpression(originalNode.original.callee, [ - createKeyValue(firstArgument), - ...restOfTheArguments, - ]), - ) - } catch (error) { - if (error.name === 'UnprocessableKeyError') { - if (process.env.NODE_ENV !== 'test') { - console.warn(error.message) - } - - return node - } - - throw error - } - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs deleted file mode 100644 index eb7f1b0110cfbbf559d25554edd40c37e713e2fc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs +++ /dev/null @@ -1,244 +0,0 @@ -const createUtilsObject = require('../../utils/index.cjs') -const createUseQueryLikeTransformer = require('../../utils/transformers/use-query-like-transformer.cjs') -const createQueryClientTransformer = require('../../utils/transformers/query-client-transformer.cjs') - -const originalName = 'isLoading' -const newName = 'isPending' - -/** - * @param {import('jscodeshift')} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformUsages = ({ jscodeshift, utils, root, filePath, config }) => { - /** - * @param {import('jscodeshift').CallExpression | import('jscodeshift').ExpressionStatement} node - * @returns {{start: number, end: number}} - */ - const getNodeLocation = (node) => { - const location = utils.isCallExpression(node) ? node.callee.loc : node.loc - const start = location.start.line - const end = location.end.line - - return { start, end } - } - - /** - * @param {import('jscodeshift').ASTNode} node - * @returns {boolean} - */ - const isObjectExpression = (node) => { - return jscodeshift.match(node, { - type: jscodeshift.ObjectExpression.name, - }) - } - - /** - * @param {import('jscodeshift').ASTNode} node - * @returns {boolean} - */ - const isObjectPattern = (node) => { - return jscodeshift.match(node, { - type: jscodeshift.ObjectPattern.name, - }) - } - - /** - * @param {import('jscodeshift').ASTNode} node - * @returns {boolean} - */ - const isVariableDeclarator = (node) => { - return jscodeshift.match(node, { - type: jscodeshift.VariableDeclarator.name, - }) - } - - /** - * @param {import('jscodeshift').Node} node - * @param {import('jscodeshift').Identifier} identifier - * @returns {Collection} - */ - const findIsLoadingPropertiesOfIdentifier = (node, identifier) => { - return jscodeshift(node).find(jscodeshift.MemberExpression, { - object: { - type: jscodeshift.Identifier.name, - name: identifier.name, - }, - property: { - type: jscodeshift.Identifier.name, - name: originalName, - }, - }) - } - - /** - * @param {import('jscodeshift').ObjectPattern} node - * @returns {import('jscodeshift').ObjectProperty|null} - */ - const findIsLoadingObjectPropertyInObjectPattern = (node) => { - return ( - node.properties.find((property) => - jscodeshift.match(property, { - key: { - type: jscodeshift.Identifier.name, - name: originalName, - }, - }), - ) ?? null - ) - } - - /** - * @param {import('jscodeshift').ObjectPattern} node - * @returns {import('jscodeshift').RestElement|null} - */ - const findRestElementInObjectPattern = (node) => { - return ( - node.properties.find((property) => - jscodeshift.match(property, { - type: jscodeshift.RestElement.name, - }), - ) ?? null - ) - } - - const replacer = (path, transformNode) => { - const node = path.node - const parentNode = path.parentPath.value - const { start, end } = getNodeLocation(node) - - try { - if (!isVariableDeclarator(parentNode)) { - // The parent node is not a variable declarator, the transformation will be skipped. - return node - } - - const lookupNode = path.scope.node - const variableDeclaratorId = parentNode.id - - if (isObjectPattern(variableDeclaratorId)) { - const isLoadingObjectProperty = - findIsLoadingObjectPropertyInObjectPattern(variableDeclaratorId) - - if (isLoadingObjectProperty) { - jscodeshift(lookupNode) - .find(jscodeshift.ObjectProperty, { - key: { - type: jscodeshift.Identifier.name, - name: originalName, - }, - }) - .replaceWith((mutablePath) => { - if (isObjectPattern(mutablePath.parent)) { - const affectedProperty = mutablePath.value.value.shorthand - ? 'value' - : 'key' - - mutablePath.value[affectedProperty].name = newName - - return mutablePath.value - } - - if (isObjectExpression(mutablePath.parent)) { - const affectedProperty = mutablePath.value.value.shorthand - ? 'key' - : 'value' - - mutablePath.value[affectedProperty].name = newName - - return mutablePath.value - } - - return mutablePath.value - }) - - // Renaming all other 'isLoading' references that are object properties. - jscodeshift(lookupNode) - .find(jscodeshift.Identifier, { name: originalName }) - .replaceWith((mutablePath) => { - if ( - !jscodeshift.match(mutablePath.parent, { - type: jscodeshift.ObjectProperty.name, - }) - ) { - mutablePath.value.name = newName - } - - return mutablePath.value - }) - } - - const restElement = findRestElementInObjectPattern(variableDeclaratorId) - - if (restElement) { - findIsLoadingPropertiesOfIdentifier( - lookupNode, - restElement.argument, - ).replaceWith(({ node: mutableNode }) => { - mutableNode.property.name = newName - - return mutableNode - }) - } - - return node - } - - if (utils.isIdentifier(variableDeclaratorId)) { - findIsLoadingPropertiesOfIdentifier( - lookupNode, - variableDeclaratorId, - ).replaceWith(({ node: mutableNode }) => { - mutableNode.property.name = newName - - return mutableNode - }) - - return node - } - - utils.warn( - `The usage in file "${filePath}" at line ${start}:${end} could not be transformed. Please migrate this usage manually.`, - ) - - return node - } catch (error) { - utils.warn( - `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( - config.hooks, - replacer, - ) - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - replacer, - ) -} - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - - const dependencies = { jscodeshift, utils, root, filePath } - - transformUsages({ - ...dependencies, - config: { - hooks: ['useQuery', 'useMutation'], - queryClientMethods: [], - }, - }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md deleted file mode 100644 index a85f43416b3ef81e5d3cc5c3dca6cbd8dbb202cc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md +++ /dev/null @@ -1,32 +0,0 @@ -### Intro - -The prerequisite for this code mod is to migrate your usages to the new syntax, so overloads for hooks and `QueryClient` methods shouldn't be available anymore. - -### Affected usages - -Please note, this code mod transforms usages only where the first argument is an object expression. - -The following usage should be transformed by the code mod: - -```ts -const { data } = useQuery({ - queryKey: ['posts'], - queryFn: queryFn, - keepPreviousData: true, -}) -``` - -But the following usage won't be transformed by the code mod, because the first argument an identifier: - -```ts -const hookArgument = { - queryKey: ['posts'], - queryFn: queryFn, - keepPreviousData: true, -} -const { data } = useQuery(hookArgument) -``` - -### Troubleshooting - -In case of any errors, feel free to reach us out via Discord or open an issue. If you open an issue, please provide a code snippet as well, because without a snippet we cannot find the bug in the code mod. diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs deleted file mode 100644 index 3f3e3b7df70880c172228a9173b1165d30d6c2e7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs +++ /dev/null @@ -1,271 +0,0 @@ -const createUtilsObject = require('../../utils/index.cjs') -const createUseQueryLikeTransformer = require('../../utils/transformers/use-query-like-transformer.cjs') -const createQueryClientTransformer = require('../../utils/transformers/query-client-transformer.cjs') -const AlreadyHasPlaceholderDataProperty = require('./utils/already-has-placeholder-data-property.cjs') - -/** - * @param {import('jscodeshift')} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformUsages = ({ jscodeshift, utils, root, filePath, config }) => { - /** - * @param {import('jscodeshift').CallExpression | import('jscodeshift').ExpressionStatement} node - * @returns {{start: number, end: number}} - */ - const getNodeLocation = (node) => { - const location = utils.isCallExpression(node) ? node.callee.loc : node.loc - const start = location.start.line - const end = location.end.line - - return { start, end } - } - - /** - * @param {import('jscodeshift').ObjectProperty} objectProperty - * @returns {boolean} - */ - const isKeepPreviousDataObjectProperty = (objectProperty) => { - return jscodeshift.match(objectProperty.key, { - type: jscodeshift.Identifier.name, - name: 'keepPreviousData', - }) - } - - /** - * @param {import('jscodeshift').ObjectProperty} objectProperty - * @returns {boolean} - */ - const isObjectPropertyHasTrueBooleanLiteralValue = (objectProperty) => { - return jscodeshift.match(objectProperty.value, { - type: jscodeshift.BooleanLiteral.name, - value: true, - }) - } - - /** - * @param {import('jscodeshift').ObjectExpression} objectExpression - * @returns {Array} - */ - const filterKeepPreviousDataProperty = (objectExpression) => { - return objectExpression.properties.filter((objectProperty) => { - return !isKeepPreviousDataObjectProperty(objectProperty) - }) - } - - const createPlaceholderDataObjectProperty = () => { - return jscodeshift.objectProperty( - jscodeshift.identifier('placeholderData'), - jscodeshift.identifier('keepPreviousData'), - ) - } - - /** - * @param {import('jscodeshift').ObjectExpression} objectExpression - * @returns {boolean} - */ - const hasPlaceholderDataProperty = (objectExpression) => { - return ( - objectExpression.properties.findIndex((objectProperty) => { - return jscodeshift.match(objectProperty.key, { - type: jscodeshift.Identifier.name, - name: 'placeholderData', - }) - }) !== -1 - ) - } - - /** - * @param {import('jscodeshift').ObjectExpression} objectExpression - * @returns {import('jscodeshift').ObjectProperty | undefined} - */ - const getKeepPreviousDataProperty = (objectExpression) => { - return objectExpression.properties.find(isKeepPreviousDataObjectProperty) - } - - let shouldAddKeepPreviousDataImport = false - - const replacer = (path, resolveTargetArgument, transformNode) => { - const node = path.node - const { start, end } = getNodeLocation(node) - - try { - const targetArgument = resolveTargetArgument(node) - - if (targetArgument && utils.isObjectExpression(targetArgument)) { - const isPlaceholderDataPropertyPresent = - hasPlaceholderDataProperty(targetArgument) - - if (hasPlaceholderDataProperty(targetArgument)) { - throw new AlreadyHasPlaceholderDataProperty(node, filePath) - } - - const keepPreviousDataProperty = - getKeepPreviousDataProperty(targetArgument) - - const keepPreviousDataPropertyHasTrueValue = - isObjectPropertyHasTrueBooleanLiteralValue(keepPreviousDataProperty) - - if (!keepPreviousDataPropertyHasTrueValue) { - utils.warn( - `The usage in file "${filePath}" at line ${start}:${end} already contains a "keepPreviousData" property but its value is not "true". Please migrate this usage manually.`, - ) - - return node - } - - if (keepPreviousDataPropertyHasTrueValue) { - // Removing the `keepPreviousData` property from the object. - const mutableObjectExpressionProperties = - filterKeepPreviousDataProperty(targetArgument) - - if (!isPlaceholderDataPropertyPresent) { - shouldAddKeepPreviousDataImport = true - - // When the `placeholderData` property is not present, the `placeholderData: keepPreviousData` property will be added. - mutableObjectExpressionProperties.push( - createPlaceholderDataObjectProperty(), - ) - } - - return transformNode( - node, - jscodeshift.objectExpression(mutableObjectExpressionProperties), - ) - } - } - - utils.warn( - `The usage in file "${filePath}" at line ${start}:${end} could not be transformed, because the first parameter is not an object expression. Please migrate this usage manually.`, - ) - - return node - } catch (error) { - utils.warn( - error.name === AlreadyHasPlaceholderDataProperty.name - ? error.message - : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( - config.hooks, - (path) => { - const resolveTargetArgument = (node) => node.arguments[0] ?? null - const transformNode = (node, transformedArgument) => - jscodeshift.callExpression(node.original.callee, [transformedArgument]) - - return replacer(path, resolveTargetArgument, transformNode) - }, - ) - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - (path) => { - const resolveTargetArgument = (node) => node.arguments[1] ?? null - const transformNode = (node, transformedArgument) => { - return jscodeshift.callExpression(node.original.callee, [ - node.arguments[0], - transformedArgument, - ...node.arguments.slice(2, 0), - ]) - } - - return replacer(path, resolveTargetArgument, transformNode) - }, - ) - - const importIdentifierOfQueryClient = utils.getSelectorByImports( - utils.locateImports(['QueryClient']), - 'QueryClient', - ) - - root - .find(jscodeshift.ExpressionStatement, { - expression: { - type: jscodeshift.NewExpression.name, - callee: { - type: jscodeshift.Identifier.name, - name: importIdentifierOfQueryClient, - }, - }, - }) - .filter((path) => path.node.expression) - .replaceWith((path) => { - const resolveTargetArgument = (node) => { - const paths = jscodeshift(node) - .find(jscodeshift.ObjectProperty, { - key: { - type: jscodeshift.Identifier.name, - name: 'keepPreviousData', - }, - }) - .paths() - - return paths.length > 0 ? paths[0].parent.node : null - } - const transformNode = (node, transformedArgument) => { - jscodeshift(node.expression) - .find(jscodeshift.ObjectProperty, { - key: { - type: jscodeshift.Identifier.name, - name: 'queries', - }, - }) - .replaceWith(({ node: mutableNode }) => { - mutableNode.value.properties = transformedArgument.properties - - return mutableNode - }) - - return node - } - - return replacer(path, resolveTargetArgument, transformNode) - }) - - return { shouldAddKeepPreviousDataImport } -} - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - - const dependencies = { jscodeshift, utils, root, filePath } - - const { shouldAddKeepPreviousDataImport } = transformUsages({ - ...dependencies, - config: { - hooks: ['useInfiniteQuery', 'useQueries', 'useQuery'], - queryClientMethods: ['setQueryDefaults'], - }, - }) - - if (shouldAddKeepPreviousDataImport) { - root - .find(jscodeshift.ImportDeclaration, { - source: { - value: '@tanstack/react-query', - }, - }) - .replaceWith(({ node: mutableNode }) => { - mutableNode.specifiers = [ - jscodeshift.importSpecifier( - jscodeshift.identifier('keepPreviousData'), - ), - ...mutableNode.specifiers, - ] - - return mutableNode - }) - } - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs deleted file mode 100644 index c0bca9c1c148c0307bbf22bc8a526bc9b5c620f0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs +++ /dev/null @@ -1,26 +0,0 @@ -class AlreadyHasPlaceholderDataProperty extends Error { - /** - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - */ - constructor(callExpression, filePath) { - super('') - this.message = this.buildMessage(callExpression, filePath) - this.name = 'AlreadyHasPlaceholderDataProperty' - } - - /** - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - * @returns {string} - */ - buildMessage(callExpression, filePath) { - const location = callExpression.callee.loc - const start = location.start.line - const end = location.end.line - - return `The usage in file "${filePath}" at line ${start}:${end} already contains a a "placeholderData" property. Please migrate this usage manually.` - } -} - -module.exports = AlreadyHasPlaceholderDataProperty diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs deleted file mode 100644 index 9a7865ba5b086b01b7531de868e701883ec99f81..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs +++ /dev/null @@ -1,58 +0,0 @@ -const createUtilsObject = require('../../utils/index.cjs') -const transformFilterAwareUsages = require('./transformers/filter-aware-usage-transformer.cjs') -const transformQueryFnAwareUsages = require('./transformers/query-fn-aware-usage-transformer.cjs') - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - - const dependencies = { jscodeshift, utils, root, filePath } - - transformFilterAwareUsages({ - ...dependencies, - config: { - keyName: 'queryKey', - fnName: 'queryFn', - queryClientMethods: [ - 'cancelQueries', - 'getQueriesData', - 'invalidateQueries', - 'isFetching', - 'refetchQueries', - 'removeQueries', - 'resetQueries', - // 'setQueriesData', - ], - hooks: ['useIsFetching', 'useQuery'], - }, - }) - - transformFilterAwareUsages({ - ...dependencies, - config: { - keyName: 'mutationKey', - fnName: 'mutationFn', - queryClientMethods: [], - hooks: ['useIsMutating', 'useMutation'], - }, - }) - - transformQueryFnAwareUsages({ - ...dependencies, - config: { - keyName: 'queryKey', - queryClientMethods: [ - 'ensureQueryData', - 'fetchQuery', - 'prefetchQuery', - 'fetchInfiniteQuery', - 'prefetchInfiniteQuery', - ], - hooks: [], - }, - }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs deleted file mode 100644 index 33e098b777653b1d5e2f906a92300ab31e1b25ff..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs +++ /dev/null @@ -1,271 +0,0 @@ -const createV5UtilsObject = require('../utils/index.cjs') -const UnknownUsageError = require('../utils/unknown-usage-error.cjs') -const createQueryClientTransformer = require('../../../utils/transformers/query-client-transformer.cjs') -const createQueryCacheTransformer = require('../../../utils/transformers/query-cache-transformer.cjs') -const createUseQueryLikeTransformer = require('../../../utils/transformers/use-query-like-transformer.cjs') - -/** - * @param {import('jscodeshift').api} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", fnName: "mutationFn"|"queryFn", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformFilterAwareUsages = ({ - jscodeshift, - utils, - root, - filePath, - config, -}) => { - const v5Utils = createV5UtilsObject({ jscodeshift, utils }) - - /** - * @param {import('jscodeshift').CallExpression} node - * @param {"mutationKey"|"queryKey"} keyName - * @param {"mutationFn"|"queryFn"} fnName - * @returns {boolean} - */ - const canSkipReplacement = (node, keyName, fnName) => { - const callArguments = node.arguments - - const hasKeyOrFnProperty = () => - callArguments[0].properties.some( - (property) => - utils.isObjectProperty(property) && - property.key.name !== keyName && - property.key.name !== fnName, - ) - - /** - * This call has at least one argument. If it's an object expression and contains the "queryKey" or "mutationKey" - * field, the transformation can be skipped, because it's already matching the expected signature. - */ - return ( - callArguments.length > 0 && - utils.isObjectExpression(callArguments[0]) && - hasKeyOrFnProperty() - ) - } - - /** - * This function checks whether the given object property is a spread element or a property that's not named - * "queryKey" or "mutationKey". - * - * @param {import('jscodeshift').ObjectProperty} property - * @returns {boolean} - */ - const predicate = (property) => { - const isSpreadElement = utils.isSpreadElement(property) - const isObjectProperty = utils.isObjectProperty(property) - - return ( - isSpreadElement || - (isObjectProperty && property.key.name !== config.keyName) - ) - } - - const replacer = (path) => { - const node = path.node - - const isFunctionDefinition = (functionArgument) => { - if (utils.isFunctionDefinition(functionArgument)) { - return true - } - - if (utils.isIdentifier(functionArgument)) { - const binding = v5Utils.getBindingFromScope( - path, - functionArgument.name, - filePath, - ) - - const isVariableDeclarator = jscodeshift.match(binding, { - type: jscodeshift.VariableDeclarator.name, - }) - - return isVariableDeclarator && utils.isFunctionDefinition(binding.init) - } - } - - try { - // If the given method/function call matches certain criteria, the node doesn't need to be replaced, this step can be skipped. - if (canSkipReplacement(node, config.keyName, config.fnName)) { - return node - } - - /** - * Here we attempt to determine the first parameter of the function call. - * If it's a function definition, we can create an object property from it (the mutation fn). - */ - const firstArgument = node.arguments[0] - if (isFunctionDefinition(firstArgument)) { - const objectExpression = jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier(config.fnName), - firstArgument, - ), - ]) - - const secondArgument = node.arguments[1] - - if (secondArgument) { - // If it's an object expression, we can copy the properties from it to the newly created object expression. - if (utils.isObjectExpression(secondArgument)) { - v5Utils.copyPropertiesFromSource( - secondArgument, - objectExpression, - predicate, - ) - } else { - // Otherwise, we simply spread the second argument in the newly created object expression. - objectExpression.properties.push( - jscodeshift.spreadElement(secondArgument), - ) - } - } - - return jscodeshift.callExpression(node.original.callee, [ - objectExpression, - ]) - } - - /** - * If, instead, the first parameter is an array expression or an identifier that references - * an array expression, then we create an object property from it (the query or mutation key). - * - * @type {import('jscodeshift').Property|undefined} - */ - const keyProperty = v5Utils.transformArgumentToKey( - path, - node.arguments[0], - config.keyName, - filePath, - ) - - /** - * The first parameter couldn't be transformed into an object property, so it's time to throw an exception, - * it will notify the consumers that they need to rewrite this usage manually. - */ - if (!keyProperty) { - const secondArgument = - node.arguments.length > 1 ? node.arguments[1] : null - - if (!secondArgument) { - throw new UnknownUsageError(node, filePath) - } - - if (utils.isFunctionDefinition(secondArgument)) { - const originalArguments = node.arguments - const firstArgument = jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier(config.keyName), - originalArguments[0], - ), - jscodeshift.property( - 'init', - jscodeshift.identifier(config.fnName), - secondArgument, - ), - ]) - - return jscodeshift.callExpression(node.original.callee, [ - firstArgument, - ...originalArguments.slice(2), - ]) - } - } - - const functionArguments = [jscodeshift.objectExpression([keyProperty])] - const secondParameter = node.arguments[1] - - if (secondParameter) { - const createdObjectExpression = functionArguments[0] - - if (isFunctionDefinition(secondParameter)) { - const objectExpression = jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier(config.keyName), - node.arguments[0], - ), - jscodeshift.property( - 'init', - jscodeshift.identifier(config.fnName), - secondParameter, - ), - ]) - - const thirdArgument = node.arguments[2] - - if (thirdArgument) { - // If it's an object expression, we can copy the properties from it to the newly created object expression. - if (utils.isObjectExpression(thirdArgument)) { - v5Utils.copyPropertiesFromSource( - thirdArgument, - objectExpression, - predicate, - ) - } else { - // Otherwise, we simply spread the third argument in the newly created object expression. - objectExpression.properties.push( - jscodeshift.spreadElement(thirdArgument), - ) - } - } - - return jscodeshift.callExpression(node.original.callee, [ - objectExpression, - ]) - } - - /** - * If it has a second argument, and it's an object expression, then we get the properties from it - * (except the "queryKey" or "mutationKey" properties), because these arguments will also be moved to the - * newly created object expression. - */ - if (utils.isObjectExpression(secondParameter)) { - v5Utils.copyPropertiesFromSource( - secondParameter, - createdObjectExpression, - predicate, - ) - } else { - // Otherwise, we simply spread the second parameter in the newly created object expression. - createdObjectExpression.properties.push( - jscodeshift.spreadElement(secondParameter), - ) - } - } - - // The rest of the function arguments can be simply pushed to the function arguments object so all will be kept. - functionArguments.push(...node.arguments.slice(2)) - - return jscodeshift.callExpression(node.original.callee, functionArguments) - } catch (error) { - utils.warn( - error.name === UnknownUsageError.name - ? error.message - : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - replacer, - ) - - createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( - config.hooks, - replacer, - ) - - createQueryCacheTransformer({ jscodeshift, utils, root }).execute(replacer) -} - -module.exports = transformFilterAwareUsages diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs deleted file mode 100644 index 3f29d41661888fef7cd44716b6f45ce868634221..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs +++ /dev/null @@ -1,185 +0,0 @@ -const createV5UtilsObject = require('../utils/index.cjs') -const UnknownUsageError = require('../utils/unknown-usage-error.cjs') -const createQueryClientTransformer = require('../../../utils/transformers/query-client-transformer.cjs') - -/** - * @param {import('jscodeshift').api} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformQueryFnAwareUsages = ({ - jscodeshift, - utils, - root, - filePath, - config, -}) => { - const v5Utils = createV5UtilsObject({ jscodeshift, utils }) - - /** - * @param {import('jscodeshift').CallExpression} node - * @returns {boolean} - */ - const canSkipReplacement = (node) => { - const callArguments = node.arguments - - const hasKeyProperty = () => - callArguments[0].properties.some( - (property) => - utils.isObjectProperty(property) && - [config.keyName, 'queryFn'].includes(property.key.name), - ) - - return ( - callArguments.length > 0 && - utils.isObjectExpression(callArguments[0]) && - hasKeyProperty() - ) - } - - const predicate = (property) => { - const isSpreadElement = utils.isSpreadElement(property) - const isObjectProperty = utils.isObjectProperty(property) - - return ( - isSpreadElement || - (isObjectProperty && property.key.name !== config.keyName) - ) - } - - const transformArgumentToQueryFunction = (path, node) => { - const isIdentifier = utils.isIdentifier(node) - const isFunctionDefinition = utils.isFunctionDefinition(node) - - if (!isIdentifier && !isFunctionDefinition) { - return undefined - } - - if (isFunctionDefinition) { - return jscodeshift.property( - 'init', - jscodeshift.identifier('queryFn'), - node, - ) - } - - const binding = v5Utils.getBindingFromScope(path, node.name, filePath) - const initializer = v5Utils.getInitializerByDeclarator(binding) - - if (!utils.isFunctionDefinition(initializer)) { - return undefined - } - - return jscodeshift.property( - 'init', - jscodeshift.identifier('queryFn'), - binding.id, - ) - } - - const transformArgumentToOptionsObject = (path, node) => { - if (!utils.isIdentifier(node)) { - return undefined - } - - const binding = v5Utils.getBindingFromScope(path, node.name, filePath) - const initializer = v5Utils.getInitializerByDeclarator(binding) - - if (utils.isObjectExpression(initializer)) { - return jscodeshift.spreadElement(binding.id) - } - } - - const replacer = (path) => { - const node = path.node - - try { - // If the given method/function call matches certain criteria, the node doesn't need to be replaced, this step can be skipped. - if (canSkipReplacement(node)) { - return node - } - - const keyProperty = v5Utils.transformArgumentToKey( - path, - node.arguments[0], - config.keyName, - filePath, - ) - - if (!keyProperty) { - throw new UnknownUsageError(node, filePath) - } - - const parameters = [jscodeshift.objectExpression([keyProperty])] - const createdObjectExpression = parameters[0] - const secondParameter = node.arguments[1] - - if (secondParameter) { - const queryFnProperty = transformArgumentToQueryFunction( - path, - secondParameter, - ) - - if (queryFnProperty) { - createdObjectExpression.properties.push(queryFnProperty) - - const thirdParameter = node.arguments[2] - - if (utils.isObjectExpression(thirdParameter)) { - v5Utils.copyPropertiesFromSource( - thirdParameter, - createdObjectExpression, - predicate, - ) - } else { - createdObjectExpression.properties.push( - jscodeshift.spreadElement(thirdParameter), - ) - } - - return jscodeshift.callExpression(node.original.callee, parameters) - } - - const optionsProperty = transformArgumentToOptionsObject( - path, - secondParameter, - ) - - if (optionsProperty) { - createdObjectExpression.properties.push(optionsProperty) - - return jscodeshift.callExpression(node.original.callee, parameters) - } - - if (utils.isObjectExpression(secondParameter)) { - v5Utils.copyPropertiesFromSource( - secondParameter, - createdObjectExpression, - predicate, - ) - } - - return jscodeshift.callExpression(node.original.callee, parameters) - } - - return jscodeshift.callExpression(node.original.callee, parameters) - } catch (error) { - utils.warn( - error.name === UnknownUsageError.name - ? error.message - : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - replacer, - ) -} - -module.exports = transformQueryFnAwareUsages diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs deleted file mode 100644 index 5e81bf4469a28d903ef227cd7f19411694ffb6a5..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs +++ /dev/null @@ -1,123 +0,0 @@ -const UnknownUsageError = require('./unknown-usage-error.cjs') - -module.exports = ({ jscodeshift, utils }) => { - /** - * - * @param {import('jscodeshift').ObjectExpression} source - * @param {import('jscodeshift').ObjectExpression} target - * @param {(node: import('jscodeshift').Node) => boolean} predicate - */ - const copyPropertiesFromSource = (source, target, predicate) => { - source.properties.forEach((property) => { - if (predicate(property)) { - target.properties.push(property) - } - }) - } - - /** - * @param {import('jscodeshift').NodePath} path - * @param {string} argumentName - * @param {string} filePath - * @returns {*} - */ - const getBindingFromScope = (path, argumentName, filePath) => { - /** - * If the current scope contains the declaration then we can use the actual one else we attempt to find the - * binding from above. - */ - const scope = path.scope.declares(argumentName) - ? path.scope - : path.scope.lookup(argumentName) - - /** - * The declaration couldn't be found for some reason, time to move on. We warn the user it needs to be rewritten - * by themselves. - */ - if (!scope) { - return undefined - } - - const binding = scope.bindings[argumentName] - .filter((item) => utils.isIdentifier(item.value)) - .map((item) => item.parentPath.value) - .at(0) - - if (!binding) { - throw new UnknownUsageError(path.node, filePath) - } - - return binding - } - - /** - * @param {import('jscodeshift').VariableDeclarator} binding - * @returns {import('jscodeshift').Node|undefined} - */ - const getInitializerByDeclarator = (binding) => { - const isVariableDeclaration = jscodeshift.match(binding, { - type: jscodeshift.VariableDeclarator.name, - }) - - if (!isVariableDeclaration) { - return undefined - } - - const isTSAsExpression = jscodeshift.match(binding.init, { - type: jscodeshift.TSAsExpression.name, - }) - - return isTSAsExpression ? binding.init.expression : binding.init - } - - /** - * @param {import('jscodeshift').Node} node - * @returns {boolean} - */ - const isArrayExpressionVariable = (node) => - jscodeshift.match(node, { - type: jscodeshift.VariableDeclarator.name, - init: { - type: jscodeshift.ArrayExpression.name, - }, - }) - - /** - * @param {import('jscodeshift').NodePath} path - * @param {import('jscodeshift').Node} node - * @param {"queryKey"|"mutationKey"} keyName - * @param {string} filePath - * @returns {import('jscodeshift').Property|undefined} - */ - const transformArgumentToKey = (path, node, keyName, filePath) => { - // If the first argument is an identifier we have to infer its type if possible. - if (utils.isIdentifier(node)) { - const binding = getBindingFromScope(path, node.name, filePath) - - if (isArrayExpressionVariable(binding)) { - return jscodeshift.property( - 'init', - jscodeshift.identifier(keyName), - jscodeshift.identifier(binding.id.name), - ) - } - } - - // If the first argument is an array, then it matches the following overload: - // methodName(queryKey?: QueryKey, firstObject?: TFirstObject, secondObject?: TSecondObject) - if (utils.isArrayExpression(node)) { - // Then we create the 'queryKey' property based on it, because it will be passed to the first argument - // that should be an object according to the new signature. - return jscodeshift.property('init', jscodeshift.identifier(keyName), node) - } - - return undefined - } - - return { - copyPropertiesFromSource, - getInitializerByDeclarator, - getBindingFromScope, - transformArgumentToKey, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs deleted file mode 100644 index ff722ff1089182a08740a3fb683a7d1fe93b779c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs +++ /dev/null @@ -1,27 +0,0 @@ -class UnknownUsageError extends Error { - /** - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - */ - constructor(callExpression, filePath) { - super('') - this.message = this.buildMessage(callExpression, filePath) - this.name = 'UnknownUsageError' - } - - /** - * - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - * @returns {string} - */ - buildMessage(callExpression, filePath) { - const location = callExpression.callee.loc - const start = location.start.line - const end = location.end.line - - return `The usage in file "${filePath}" at line ${start}:${end} could not be transformed into the new syntax. Please do this manually.` - } -} - -module.exports = UnknownUsageError diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs deleted file mode 100644 index 488040d6a22738549f3427cce4a5dc9b74a64f73..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs +++ /dev/null @@ -1,55 +0,0 @@ -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - const importSpecifiers = root - .find(jscodeshift.ImportDeclaration, { - source: { - value: '@tanstack/react-query', - }, - }) - .find(jscodeshift.ImportSpecifier, { - imported: { - name: 'Hydrate', - }, - }) - - if (importSpecifiers.length > 0) { - const names = { - searched: 'Hydrate', // By default, we want to replace the `Hydrate` usages. - target: 'HydrationBoundary', // We want to replace them with `HydrationBoundary`. - } - - importSpecifiers.replaceWith(({ node: mutableNode }) => { - /** - * When the local and imported names match which means the code doesn't contain import aliases, we need - * to replace only the import specifier. - * @type {boolean} - */ - const usesDefaultImport = - mutableNode.local.name === mutableNode.imported.name - - if (!usesDefaultImport) { - // If the code uses import aliases, we must re-use the alias. - names.searched = mutableNode.local.name - names.target = mutableNode.local.name - } - - // Override the import specifier. - mutableNode.imported.name = 'HydrationBoundary' - - return mutableNode - }) - - root - .findJSXElements(names.searched) - .replaceWith(({ node: mutableNode }) => { - mutableNode.openingElement.name.name = names.target - mutableNode.closingElement.name.name = names.target - - return mutableNode - }) - } - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs deleted file mode 100644 index 3213be7c7ccea4ec65ba77820e85bef9dfd62019..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - const baseRenameLogic = (kind, from, to) => { - root - .find(kind, (node) => { - return ( - node.computed === false && - (node.key?.name === from || node.key?.value === from) - ) - }) - .replaceWith(({ node: mutableNode }) => { - if (mutableNode.key.name !== undefined) { - mutableNode.key.name = to - } - - if (mutableNode.key.value !== undefined) { - mutableNode.key.value = to - } - - return mutableNode - }) - } - - const renameObjectProperty = (from, to) => { - baseRenameLogic(jscodeshift.ObjectProperty, from, to) - } - - const renameTypeScriptPropertySignature = (from, to) => { - baseRenameLogic(jscodeshift.TSPropertySignature, from, to) - } - - renameObjectProperty('cacheTime', 'gcTime') - renameObjectProperty('useErrorBoundary', 'throwOnError') - - renameTypeScriptPropertySignature('cacheTime', 'gcTime') - renameTypeScriptPropertySignature('useErrorBoundary', 'throwOnError') - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs deleted file mode 100644 index 6b2a871b531049f9ee5022e486753a3ca83eb92f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/HydrationBoundary.tsx -var HydrationBoundary_exports = {}; -__export(HydrationBoundary_exports, { - HydrationBoundary: () => HydrationBoundary -}); -module.exports = __toCommonJS(HydrationBoundary_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const [hydrationQueue, setHydrationQueue] = React.useState(); - const optionsRef = React.useRef(options); - optionsRef.current = options; - React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt; - const queryAlreadyQueued = hydrationQueue == null ? void 0 : hydrationQueue.find( - (query) => query.queryHash === dehydratedQuery.queryHash - ); - if (hydrationIsNewer && (!queryAlreadyQueued || dehydratedQuery.state.dataUpdatedAt > queryAlreadyQueued.state.dataUpdatedAt)) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - setHydrationQueue( - (prev) => prev ? [...prev, ...existingQueries] : existingQueries - ); - } - } - }, [client, hydrationQueue, state]); - React.useEffect(() => { - if (hydrationQueue) { - (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); - setHydrationQueue(void 0); - } - }, [client, hydrationQueue]); - return children; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary -}); -//# sourceMappingURL=HydrationBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map deleted file mode 100644 index b4c49094f7bb83a6f62362e85375b6a6d20dff75..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n const [hydrationQueue, setHydrationQueue] = React.useState<\n DehydratedState['queries'] | undefined\n >()\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // This useMemo is for performance reasons only, everything inside it _must_\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (state as DehydratedState).queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt\n const queryAlreadyQueued = hydrationQueue?.find(\n (query) => query.queryHash === dehydratedQuery.queryHash,\n )\n\n if (\n hydrationIsNewer &&\n (!queryAlreadyQueued ||\n dehydratedQuery.state.dataUpdatedAt >\n queryAlreadyQueued.state.dataUpdatedAt)\n ) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n setHydrationQueue((prev) =>\n prev ? [...prev, ...existingQueries] : existingQueries,\n )\n }\n }\n }, [client, hydrationQueue, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n setHydrationQueue(undefined)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,YAAuB;AAEvB,wBAAwB;AACxB,iCAA+B;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,CAAC,gBAAgB,iBAAiB,IAAU,eAEhD;AAEF,QAAM,aAAmB,aAAO,OAAO;AACvC,aAAW,UAAU;AAiBrB,EAAM,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAExC,YAAM,UAAW,MAA0B,WAAW,CAAC;AAEvD,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACtB,cAAc,MAAM;AACtB,gBAAM,qBAAqB,iDAAgB;AAAA,YACzC,CAAC,UAAU,MAAM,cAAc,gBAAgB;AAAA;AAGjD,cACE,qBACC,CAAC,sBACA,gBAAgB,MAAM,gBACpB,mBAAmB,MAAM,gBAC7B;AACA,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAGzB,uCAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B;AAAA,UAAkB,CAAC,SACjB,OAAO,CAAC,GAAG,MAAM,GAAG,eAAe,IAAI;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,gBAAgB,KAAK,CAAC;AAElC,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qCAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAC/D,wBAAkB,MAAS;AAAA,IAC7B;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts deleted file mode 100644 index fc13cc13373d12470b89340e275a9e5aceb18f0c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state?: unknown; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement>; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts deleted file mode 100644 index fc13cc13373d12470b89340e275a9e5aceb18f0c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state?: unknown; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement>; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js deleted file mode 100644 index c1963d24c07f99c773c82c02df85f351eca17ff5..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js +++ /dev/null @@ -1,61 +0,0 @@ -"use client"; - -// src/HydrationBoundary.tsx -import * as React from "react"; -import { hydrate } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = useQueryClient(queryClient); - const [hydrationQueue, setHydrationQueue] = React.useState(); - const optionsRef = React.useRef(options); - optionsRef.current = options; - React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt; - const queryAlreadyQueued = hydrationQueue == null ? void 0 : hydrationQueue.find( - (query) => query.queryHash === dehydratedQuery.queryHash - ); - if (hydrationIsNewer && (!queryAlreadyQueued || dehydratedQuery.state.dataUpdatedAt > queryAlreadyQueued.state.dataUpdatedAt)) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - hydrate(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - setHydrationQueue( - (prev) => prev ? [...prev, ...existingQueries] : existingQueries - ); - } - } - }, [client, hydrationQueue, state]); - React.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current); - setHydrationQueue(void 0); - } - }, [client, hydrationQueue]); - return children; -}; -export { - HydrationBoundary -}; -//# sourceMappingURL=HydrationBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map deleted file mode 100644 index 46afb3618f85b02206b2eea063cd5326869f58f3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n const [hydrationQueue, setHydrationQueue] = React.useState<\n DehydratedState['queries'] | undefined\n >()\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // This useMemo is for performance reasons only, everything inside it _must_\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (state as DehydratedState).queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt\n const queryAlreadyQueued = hydrationQueue?.find(\n (query) => query.queryHash === dehydratedQuery.queryHash,\n )\n\n if (\n hydrationIsNewer &&\n (!queryAlreadyQueued ||\n dehydratedQuery.state.dataUpdatedAt >\n queryAlreadyQueued.state.dataUpdatedAt)\n ) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n setHydrationQueue((prev) =>\n prev ? [...prev, ...existingQueries] : existingQueries,\n )\n }\n }\n }, [client, hydrationQueue, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n setHydrationQueue(undefined)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAEvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,CAAC,gBAAgB,iBAAiB,IAAU,eAEhD;AAEF,QAAM,aAAmB,aAAO,OAAO;AACvC,aAAW,UAAU;AAiBrB,EAAM,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAExC,YAAM,UAAW,MAA0B,WAAW,CAAC;AAEvD,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACtB,cAAc,MAAM;AACtB,gBAAM,qBAAqB,iDAAgB;AAAA,YACzC,CAAC,UAAU,MAAM,cAAc,gBAAgB;AAAA;AAGjD,cACE,qBACC,CAAC,sBACA,gBAAgB,MAAM,gBACpB,mBAAmB,MAAM,gBAC7B;AACA,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAGzB,gBAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B;AAAA,UAAkB,CAAC,SACjB,OAAO,CAAC,GAAG,MAAM,GAAG,eAAe,IAAI;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,gBAAgB,KAAK,CAAC;AAElC,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,cAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAC/D,wBAAkB,MAAS;AAAA,IAC7B;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs deleted file mode 100644 index d91255c2ac94614ca960c8bc72121a75625798b2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/QueryClientProvider.tsx -var QueryClientProvider_exports = {}; -__export(QueryClientProvider_exports, { - QueryClientContext: () => QueryClientContext, - QueryClientProvider: () => QueryClientProvider, - useQueryClient: () => useQueryClient -}); -module.exports = __toCommonJS(QueryClientProvider_exports); -var React = __toESM(require("react"), 1); -var import_jsx_runtime = require("react/jsx-runtime"); -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClientContext, - QueryClientProvider, - useQueryClient -}); -//# sourceMappingURL=QueryClientProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts deleted file mode 100644 index 1b1fd69711e40c3fd048432deb1301dbd2adc863..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts deleted file mode 100644 index 1b1fd69711e40c3fd048432deb1301dbd2adc863..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map deleted file mode 100644 index 44bad03d77595352e613d3d46deaf20a4b77f13e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map deleted file mode 100644 index 29c7b08210ea6a1799b9f7980511db3e91378a54..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,4CAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts deleted file mode 100644 index bfb574515964a5e40a71f77b54bbe38e3445dee1..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React from 'react'; - -type QueryErrorResetFunction = () => void; -type QueryErrorIsResetFunction = () => boolean; -type QueryErrorClearResetFunction = () => void; -interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction; - isReset: QueryErrorIsResetFunction; - reset: QueryErrorResetFunction; -} -declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; -type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; -interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode; -} -declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; - -export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js deleted file mode 100644 index ae56edcc2b124f886c1330bb4b3e0c00de7d8437..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -// src/QueryErrorResetBoundary.tsx -import * as React from "react"; -import { jsx } from "react/jsx-runtime"; -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React.createContext(createValue()); -var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React.useState(() => createValue()); - return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; -export { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -}; -//# sourceMappingURL=QueryErrorResetBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map deleted file mode 100644 index c8b04a7ca9b36d1d85e8f9092c838868e538dfab..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oBAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs deleted file mode 100644 index c75d6b33f1de4cd40f8b7aeb49c2768c41518087..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/errorBoundaryUtils.ts -var errorBoundaryUtils_exports = {}; -__export(errorBoundaryUtils_exports, { - ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, - getHasError: () => getHasError, - useClearResetErrorBoundary: () => useClearResetErrorBoundary -}); -module.exports = __toCommonJS(errorBoundaryUtils_exports); -var React = __toESM(require("react"), 1); -var import_utils = require("./utils.cjs"); -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { - if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (0, import_utils.shouldThrowError)(throwOnError, [result.error, query]); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}); -//# sourceMappingURL=errorBoundaryUtils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map deleted file mode 100644 index 7d4c296cd6dd0b4f447a693baf23e85f7419b6b1..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (\n options.suspense ||\n options.throwOnError ||\n options.experimental_prefetchInRender\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,mBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,uBACG;AACH,MACE,QAAQ,YACR,QAAQ,gBACR,QAAQ,+BACR;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,aACA,+BAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAExD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts deleted file mode 100644 index 6e8f6c0df2e90cdede820a72d648d5cf04a24610..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, QueryObserverResult, ThrowOnError, Query } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts deleted file mode 100644 index 20e222e867c816bcb36952a3eab041dc5f6d3775..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, QueryObserverResult, ThrowOnError, Query } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js deleted file mode 100644 index a2e16fe5ef68b54de24f6192c36017d3f58d7a6b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js +++ /dev/null @@ -1,31 +0,0 @@ -"use client"; - -// src/errorBoundaryUtils.ts -import * as React from "react"; -import { shouldThrowError } from "./utils.js"; -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { - if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]); -}; -export { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}; -//# sourceMappingURL=errorBoundaryUtils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map deleted file mode 100644 index 5f0c6b0259fbab8106bbd217e5d9b3d15890e2d8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (\n options.suspense ||\n options.throwOnError ||\n options.experimental_prefetchInRender\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,uBACG;AACH,MACE,QAAQ,YACR,QAAQ,gBACR,QAAQ,+BACR;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,SACA,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAExD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.cjs b/node_modules/@tanstack/react-query/build/legacy/index.cjs deleted file mode 100644 index a2d9ae6e3e7cc33be801c8d1305f38551bcce8dd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.cjs +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, - IsRestoringProvider: () => import_isRestoring.IsRestoringProvider, - QueryClientContext: () => import_QueryClientProvider.QueryClientContext, - QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, - QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, - infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, - queryOptions: () => import_queryOptions.queryOptions, - useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, - useIsFetching: () => import_useIsFetching.useIsFetching, - useIsMutating: () => import_useMutationState.useIsMutating, - useIsRestoring: () => import_isRestoring.useIsRestoring, - useMutation: () => import_useMutation.useMutation, - useMutationState: () => import_useMutationState.useMutationState, - usePrefetchInfiniteQuery: () => import_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery, - usePrefetchQuery: () => import_usePrefetchQuery.usePrefetchQuery, - useQueries: () => import_useQueries.useQueries, - useQuery: () => import_useQuery.useQuery, - useQueryClient: () => import_QueryClientProvider.useQueryClient, - useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, - useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, - useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, - useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery -}); -module.exports = __toCommonJS(src_exports); -__reExport(src_exports, require("@tanstack/query-core"), module.exports); -__reExport(src_exports, require("./types.cjs"), module.exports); -var import_useQueries = require("./useQueries.cjs"); -var import_useQuery = require("./useQuery.cjs"); -var import_useSuspenseQuery = require("./useSuspenseQuery.cjs"); -var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs"); -var import_useSuspenseQueries = require("./useSuspenseQueries.cjs"); -var import_usePrefetchQuery = require("./usePrefetchQuery.cjs"); -var import_usePrefetchInfiniteQuery = require("./usePrefetchInfiniteQuery.cjs"); -var import_queryOptions = require("./queryOptions.cjs"); -var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_HydrationBoundary = require("./HydrationBoundary.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_useIsFetching = require("./useIsFetching.cjs"); -var import_useMutationState = require("./useMutationState.cjs"); -var import_useMutation = require("./useMutation.cjs"); -var import_useInfiniteQuery = require("./useInfiniteQuery.cjs"); -var import_isRestoring = require("./isRestoring.cjs"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery, - ...require("@tanstack/query-core"), - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.cjs.map b/node_modules/@tanstack/react-query/build/legacy/index.cjs.map deleted file mode 100644 index 43c96d0826e5a52a54bd74b28066815be800b274..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './isRestoring'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAc,iCAHd;AAMA,wBAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,gCAAmC;AAKnC,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAM7B,kCAAqC;AAMrC,iCAIO;AAGP,+BAAkC;AAQlC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,8BAAiC;AACjC,yBAAoD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.d.cts b/node_modules/@tanstack/react-query/build/legacy/index.d.cts deleted file mode 100644 index 3af037a9d0024d4e1206fa9aed182ea4ddea9d04..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.d.cts +++ /dev/null @@ -1,21 +0,0 @@ -export * from '@tanstack/query-core'; -export { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs'; -export { useQuery } from './useQuery.cjs'; -export { useSuspenseQuery } from './useSuspenseQuery.cjs'; -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs'; -export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.cjs'; -export { usePrefetchQuery } from './usePrefetchQuery.cjs'; -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.cjs'; -export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.cjs'; -export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.cjs'; -export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs'; -export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs'; -export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs'; -export { useIsFetching } from './useIsFetching.cjs'; -export { useIsMutating, useMutationState } from './useMutationState.cjs'; -export { useMutation } from './useMutation.cjs'; -export { useInfiniteQuery } from './useInfiniteQuery.cjs'; -export { IsRestoringProvider, useIsRestoring } from './isRestoring.cjs'; -import 'react'; -import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/legacy/index.js b/node_modules/@tanstack/react-query/build/legacy/index.js deleted file mode 100644 index c90cb765baaaf3f1edd6e555de5cd4f5dfaa1452..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.js +++ /dev/null @@ -1,52 +0,0 @@ -// src/index.ts -export * from "@tanstack/query-core"; -export * from "./types.js"; -import { useQueries } from "./useQueries.js"; -import { useQuery } from "./useQuery.js"; -import { useSuspenseQuery } from "./useSuspenseQuery.js"; -import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js"; -import { useSuspenseQueries } from "./useSuspenseQueries.js"; -import { usePrefetchQuery } from "./usePrefetchQuery.js"; -import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.js"; -import { queryOptions } from "./queryOptions.js"; -import { infiniteQueryOptions } from "./infiniteQueryOptions.js"; -import { - QueryClientContext, - QueryClientProvider, - useQueryClient -} from "./QueryClientProvider.js"; -import { HydrationBoundary } from "./HydrationBoundary.js"; -import { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -} from "./QueryErrorResetBoundary.js"; -import { useIsFetching } from "./useIsFetching.js"; -import { useIsMutating, useMutationState } from "./useMutationState.js"; -import { useMutation } from "./useMutation.js"; -import { useInfiniteQuery } from "./useInfiniteQuery.js"; -import { useIsRestoring, IsRestoringProvider } from "./isRestoring.js"; -export { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map deleted file mode 100644 index 986febc1d589b128a654c6b49df79c4b70043315..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\ntype NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6JO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts deleted file mode 100644 index 0e05ad630584cc7c117fe29768e49d7924301bd1..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseInfiniteQueryOptions } from './types.js'; - -type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; -}; -type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type NonUndefinedGuard = T extends undefined ? never : T; -type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { - queryKey: DataTag>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { - queryKey: DataTag>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { - queryKey: DataTag>; -}; - -export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js deleted file mode 100644 index bc8d5b0bebceafab86971f75a08323edee67d0b7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/infiniteQueryOptions.ts -function infiniteQueryOptions(options) { - return options; -} -export { - infiniteQueryOptions -}; -//# sourceMappingURL=infiniteQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map deleted file mode 100644 index 173e6efc5cc42947a6f2dd57f639957ab4b24ae2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\ntype NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AA6JO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/isRestoring.cjs b/node_modules/@tanstack/react-query/build/legacy/isRestoring.cjs deleted file mode 100644 index e4357949a653e6bff94e3ca1aa4550ca93b746be..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/isRestoring.cjs +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/isRestoring.ts -var isRestoring_exports = {}; -__export(isRestoring_exports, { - IsRestoringProvider: () => IsRestoringProvider, - useIsRestoring: () => useIsRestoring -}); -module.exports = __toCommonJS(isRestoring_exports); -var React = __toESM(require("react"), 1); -var IsRestoringContext = React.createContext(false); -var useIsRestoring = () => React.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - IsRestoringProvider, - useIsRestoring -}); -//# sourceMappingURL=isRestoring.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/isRestoring.cjs.map b/node_modules/@tanstack/react-query/build/legacy/isRestoring.cjs.map deleted file mode 100644 index af71da72c69acf78e4414bbc7b9b1b329b3add23..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/isRestoring.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/isRestoring.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/isRestoring.d.ts b/node_modules/@tanstack/react-query/build/legacy/isRestoring.d.ts deleted file mode 100644 index 08b14ff344a36fbb42886399b916f1bca57df399..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/isRestoring.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; - -declare const useIsRestoring: () => boolean; -declare const IsRestoringProvider: React.Provider; - -export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/legacy/isRestoring.js.map b/node_modules/@tanstack/react-query/build/legacy/isRestoring.js.map deleted file mode 100644 index a4619d1f6cbe752b371a993f27474a8c07dfa8d0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/isRestoring.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/isRestoring.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs deleted file mode 100644 index ffda67f4bba99e0f381bb5e584e9e593bd58b525..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryOptions.ts -var queryOptions_exports = {}; -__export(queryOptions_exports, { - queryOptions: () => queryOptions -}); -module.exports = __toCommonJS(queryOptions_exports); -function queryOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - queryOptions -}); -//# sourceMappingURL=queryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts deleted file mode 100644 index 8a3ef696b7c5c401f006abdef66d6ceb713c673e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, QueryKey, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseQueryOptions } from './types.js'; - -type UndefinedInitialDataOptions = UseQueryOptions & { - initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; -}; -type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type NonUndefinedGuard = T extends undefined ? never : T; -type DefinedInitialDataOptions = UseQueryOptions & { - initialData: NonUndefinedGuard | (() => NonUndefinedGuard); -}; -declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { - queryKey: DataTag; -}; - -export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js deleted file mode 100644 index 7fb75ff32594afe16aa69be3101004b219b39a58..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/queryOptions.ts -function queryOptions(options) { - return options; -} -export { - queryOptions -}; -//# sourceMappingURL=queryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map deleted file mode 100644 index dcf004545843a00dd51737422b3b794bf9cb42c2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (defaultedOptions.staleTime === undefined) {\n defaultedOptions.staleTime = 1000\n }\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,QAAI,iBAAiB,cAAc,QAAW;AAC5C,uBAAiB,YAAY;AAAA,IAC/B;AACA,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK,IAAI,iBAAiB,QAAQ,GAAI;AAAA,IAClE;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,YACG,qDAAkB,aAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts b/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts deleted file mode 100644 index fbead76ed1b3e61e99a19b7955bdb56b1e7d651f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import { QueryKey, Query, DefaultedQueryObserverOptions, QueryObserverResult, QueryObserver } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; -declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; -declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; -declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; -declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; - -export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.js b/node_modules/@tanstack/react-query/build/legacy/suspense.js deleted file mode 100644 index 27dffebf662a6805098ecf74437f8ac1fe477112..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.js +++ /dev/null @@ -1,25 +0,0 @@ -// src/suspense.ts -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - if (defaultedOptions.staleTime === void 0) { - defaultedOptions.staleTime = 1e3; - } - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1e3); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); -export { - defaultThrowOnError, - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -}; -//# sourceMappingURL=suspense.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.js.map b/node_modules/@tanstack/react-query/build/legacy/suspense.js.map deleted file mode 100644 index 917d0a0a526ed069d2f9719a506437faed5e07dc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (defaultedOptions.staleTime === undefined) {\n defaultedOptions.staleTime = 1000\n }\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,QAAI,iBAAiB,cAAc,QAAW;AAC5C,uBAAiB,YAAY;AAAA,IAC/B;AACA,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK,IAAI,iBAAiB,QAAQ,GAAI;AAAA,IAClE;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,YACG,qDAAkB,aAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.cjs b/node_modules/@tanstack/react-query/build/legacy/types.cjs deleted file mode 100644 index d22152bc67861f6fd334ace0ed3fdd09464cc941..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.cjs +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.d.cts b/node_modules/@tanstack/react-query/build/legacy/types.d.cts deleted file mode 100644 index 1cff51e59e4997759da1e5fcce2f08a0dfeb869c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.d.cts +++ /dev/null @@ -1,33 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, SkipToken, InfiniteQueryObserverOptions, QueryObserverResult, DefinedQueryObserverResult, InfiniteQueryObserverResult, DefinedInfiniteQueryObserverResult, MutationObserverOptions, MutateFunction, Override, MutationObserverResult } from '@tanstack/query-core'; - -interface UseBaseQueryOptions extends QueryObserverOptions { -} -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/legacy/types.d.ts b/node_modules/@tanstack/react-query/build/legacy/types.d.ts deleted file mode 100644 index 1cff51e59e4997759da1e5fcce2f08a0dfeb869c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, SkipToken, InfiniteQueryObserverOptions, QueryObserverResult, DefinedQueryObserverResult, InfiniteQueryObserverResult, DefinedInfiniteQueryObserverResult, MutationObserverOptions, MutateFunction, Override, MutationObserverResult } from '@tanstack/query-core'; - -interface UseBaseQueryOptions extends QueryObserverOptions { -} -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/legacy/types.js b/node_modules/@tanstack/react-query/build/legacy/types.js deleted file mode 100644 index 5b2306a4c52321a5316142318d15fa56711ec12d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.js.map b/node_modules/@tanstack/react-query/build/legacy/types.js.map deleted file mode 100644 index 84c51b288c478ac0d18748007ccfb8cddc797f3a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs deleted file mode 100644 index b64ea5c5f9389e560ce6fd850dd3d52e8d2e6e73..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useBaseQuery.ts -var useBaseQuery_exports = {}; -__export(useBaseQuery_exports, { - useBaseQuery: () => useBaseQuery -}); -module.exports = __toCommonJS(useBaseQuery_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_isRestoring = require("./isRestoring.cjs"); -var import_suspense = require("./suspense.cjs"); -var import_utils = require("./utils.cjs"); -function useBaseQuery(options, Observer, queryClient) { - var _a, _b, _c, _d, _e; - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - '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' - ); - } - } - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const isRestoring = (0, import_isRestoring.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const defaultedOptions = client.defaultQueryOptions(options); - (_b = (_a = client.getDefaultOptions().queries) == null ? void 0 : _a._experimental_beforeQuery) == null ? void 0 : _b.call( - _a, - defaultedOptions - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - (0, import_suspense.ensureSuspenseTimers)(defaultedOptions); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = isRestoring ? import_utils.noop : observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)); - observer.updateResult(); - return unsubscribe; - }, - [observer, isRestoring] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions, { listeners: false }); - }, [defaultedOptions, observer]); - if ((0, import_suspense.shouldSuspend)(defaultedOptions, result)) { - throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); - } - if ((0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query: client.getQueryCache().get(defaultedOptions.queryHash) - })) { - throw result.error; - } - ; - (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( - _c, - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !import_query_core.isServer && (0, import_suspense.willFetch)(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - (_e = client.getQueryCache().get(defaultedOptions.queryHash)) == null ? void 0 : _e.promise - ); - promise == null ? void 0 : promise.catch(import_utils.noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useBaseQuery -}); -//# sourceMappingURL=useBaseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts deleted file mode 100644 index baa8469ad5ee8c20c0908d3a26100b7e3d65eae6..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.cjs'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts deleted file mode 100644 index 60430b0495ccf21e6f158ea36c3ae714611c1493..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.js'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js deleted file mode 100644 index daadb39a71bcb61c20aab33031b2c8be5a02df42..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js +++ /dev/null @@ -1,99 +0,0 @@ -"use client"; - -// src/useBaseQuery.ts -import * as React from "react"; -import { isServer, notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -} from "./errorBoundaryUtils.js"; -import { useIsRestoring } from "./isRestoring.js"; -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -} from "./suspense.js"; -import { noop } from "./utils.js"; -function useBaseQuery(options, Observer, queryClient) { - var _a, _b, _c, _d, _e; - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - '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' - ); - } - } - const client = useQueryClient(queryClient); - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const defaultedOptions = client.defaultQueryOptions(options); - (_b = (_a = client.getDefaultOptions().queries) == null ? void 0 : _a._experimental_beforeQuery) == null ? void 0 : _b.call( - _a, - defaultedOptions - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - ensureSuspenseTimers(defaultedOptions); - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); - useClearResetErrorBoundary(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = isRestoring ? noop : observer.subscribe(notifyManager.batchCalls(onStoreChange)); - observer.updateResult(); - return unsubscribe; - }, - [observer, isRestoring] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions, { listeners: false }); - }, [defaultedOptions, observer]); - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); - } - if (getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query: client.getQueryCache().get(defaultedOptions.queryHash) - })) { - throw result.error; - } - ; - (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( - _c, - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - (_e = client.getQueryCache().get(defaultedOptions.queryHash)) == null ? void 0 : _e.promise - ); - promise == null ? void 0 : promise.catch(noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -export { - useBaseQuery -}; -//# sourceMappingURL=useBaseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs deleted file mode 100644 index e1ae216829681d04826f282a2616275b3d570d60..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useInfiniteQuery.ts -var useInfiniteQuery_exports = {}; -__export(useInfiniteQuery_exports, { - useInfiniteQuery: () => useInfiniteQuery -}); -module.exports = __toCommonJS(useInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useInfiniteQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)( - options, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useInfiniteQuery -}); -//# sourceMappingURL=useInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map deleted file mode 100644 index 104ecd219da5c7ff1e28cc51edcf8310ae50ef3b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AACtC,0BAA6B;AAsEtB,SAAS,iBACd,SACA,aACA;AACA,aAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs deleted file mode 100644 index 28660e7d19489acc86f6a2f0c9b47e453ac66fae..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useIsFetching.ts -var useIsFetching_exports = {}; -__export(useIsFetching_exports, { - useIsFetching: () => useIsFetching -}); -module.exports = __toCommonJS(useIsFetching_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsFetching(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const queryCache = client.getQueryCache(); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsFetching -}); -//# sourceMappingURL=useIsFetching.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map deleted file mode 100644 index 5a58e86806e2919b9dcfbaf0cc3c32a4e23a5661..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAA8B;AAE9B,iCAA+B;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts deleted file mode 100644 index 832d33f56bd3024b01d378505c84d81a7553f5c9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts deleted file mode 100644 index 832d33f56bd3024b01d378505c84d81a7553f5c9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map deleted file mode 100644 index 9921ab6e20952d564197ef61fccc3ab1f4943bd0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAE9B,SAAS,sBAAsB;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs deleted file mode 100644 index 175de467172e7c876d51141d22f151de482d2a43..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutation.ts -var useMutation_exports = {}; -__export(useMutation_exports, { - useMutation: () => useMutation -}); -module.exports = __toCommonJS(useMutation_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_utils = require("./utils.cjs"); -function useMutation(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const [observer] = React.useState( - () => new import_query_core.MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(import_utils.noop); - }, - [observer] - ); - if (result.error && (0, import_utils.shouldThrowError)(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useMutation -}); -//# sourceMappingURL=useMutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map deleted file mode 100644 index 2beaf7a697d67be63bb22ae4739b0db0eeede8f7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { MutationObserver, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { noop, shouldThrowError } from './utils'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAAgD;AAChD,iCAA+B;AAC/B,mBAAuC;AAUhC,SAAS,YAMd,SACA,aACwD;AACxD,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,iBAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,aACP,+BAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts deleted file mode 100644 index 5343f3ff36b60e78553bc472657cd039b6355d1d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.cjs'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts deleted file mode 100644 index dfe60df8cb126fdb62b208763ee1ff14a02269c0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.js'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.js b/node_modules/@tanstack/react-query/build/legacy/useMutation.js deleted file mode 100644 index 515a3b92ecf8c348ccc7f16de4f778301327e9c9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.js +++ /dev/null @@ -1,41 +0,0 @@ -"use client"; - -// src/useMutation.ts -import * as React from "react"; -import { MutationObserver, notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { noop, shouldThrowError } from "./utils.js"; -function useMutation(options, queryClient) { - const client = useQueryClient(queryClient); - const [observer] = React.useState( - () => new MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop); - }, - [observer] - ); - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -export { - useMutation -}; -//# sourceMappingURL=useMutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs deleted file mode 100644 index 0248bea1b0a0922589748a9338d85be66fc3468c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutationState.ts -var useMutationState_exports = {}; -__export(useMutationState_exports, { - useIsMutating: () => useIsMutating, - useMutationState: () => useMutationState -}); -module.exports = __toCommonJS(useMutationState_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsMutating(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (!result.current) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = (0, import_query_core.replaceEqualDeep)( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - import_query_core.notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsMutating, - useMutationState -}); -//# sourceMappingURL=useMutationState.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map deleted file mode 100644 index 68b0a392336cba75982a1146353c1e14698fca14..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (!result.current) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,YAAuB;AAEvB,wBAAgD;AAChD,iCAA+B;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,oBAAgB,2CAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,iBAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,0CAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts deleted file mode 100644 index 6f35037650d40fa6b55826d7f41b9a332d8b569f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts deleted file mode 100644 index 6f35037650d40fa6b55826d7f41b9a332d8b569f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js deleted file mode 100644 index 0648af4cfd70499f3365abc8b63a06e06976f793..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -// src/useMutationState.ts -import * as React from "react"; -import { notifyManager, replaceEqualDeep } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useIsMutating(filters, queryClient) { - const client = useQueryClient(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = useQueryClient(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (!result.current) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -export { - useIsMutating, - useMutationState -}; -//# sourceMappingURL=useMutationState.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map deleted file mode 100644 index ae13415e7f9c31177b3ccd37a92ba91b10385705..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (!result.current) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAEvB,SAAS,eAAe,wBAAwB;AAChD,SAAS,sBAAsB;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,gBAAgB,eAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,aAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,wBAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs deleted file mode 100644 index 91481968950cb95e51d224a112d63c2269879793..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchInfiniteQuery.tsx -var usePrefetchInfiniteQuery_exports = {}; -__export(usePrefetchInfiniteQuery_exports, { - usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery -}); -module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchInfiniteQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchInfiniteQuery -}); -//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts deleted file mode 100644 index aeba2f8cd3759becc5bda14a51b92a01c907652f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map deleted file mode 100644 index 20e30421d72b2889605ba28f3485236f34ea2817..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs deleted file mode 100644 index a884e0f7f51bdc0159d1c108410c87a1b0f79237..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchQuery.tsx -var usePrefetchQuery_exports = {}; -__export(usePrefetchQuery_exports, { - usePrefetchQuery: () => usePrefetchQuery -}); -module.exports = __toCommonJS(usePrefetchQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchQuery -}); -//# sourceMappingURL=usePrefetchQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map deleted file mode 100644 index 2dcf0781528b5015d1655a16503f1ab95106b9fc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: FetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAQxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts deleted file mode 100644 index 4b04fcc95f1dd0d260aa208143a78db72389a2fb..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchQuery(options: FetchQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js deleted file mode 100644 index 63d3292b7478f878582ade638a754c8565ad5847..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/usePrefetchQuery.tsx -import { useQueryClient } from "./QueryClientProvider.js"; -function usePrefetchQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -export { - usePrefetchQuery -}; -//# sourceMappingURL=usePrefetchQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs deleted file mode 100644 index 30624c08a79ccc7bdb806089683cacf0fd3a7223..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQueries.ts -var useQueries_exports = {}; -__export(useQueries_exports, { - useQueries: () => useQueries -}); -module.exports = __toCommonJS(useQueries_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_isRestoring = require("./isRestoring.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_suspense = require("./suspense.cjs"); -var import_utils = require("./utils.cjs"); -function useQueries({ - queries, - ...options -}, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const isRestoring = (0, import_isRestoring.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const defaultedQueries = React.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((query) => { - (0, import_suspense.ensureSuspenseTimers)(query); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(query, errorResetBoundary); - }); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const [observer] = React.useState( - () => new import_query_core.QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => isRestoring ? import_utils.noop : observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [observer, isRestoring] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options, - { - listeners: false - } - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts) { - const queryObserver = new import_query_core.QueryObserver(client, opts); - if ((0, import_suspense.shouldSuspend)(opts, result)) { - return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); - } else if ((0, import_suspense.willFetch)(result, isRestoring)) { - void (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); - } - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && (0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash) - }); - } - ); - if (firstSingleResultWhichShouldThrow == null ? void 0 : firstSingleResultWhichShouldThrow.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQueries -}); -//# sourceMappingURL=useQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map deleted file mode 100644 index 7b475fbe921935d164f0d29821f068d25281b048..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './isRestoring'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport { noop } from './utils'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries: readonly [...QueriesOptions]\n combine?: (result: QueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((query) => {\n ensureSuspenseTimers(query)\n ensurePreventErrorBoundaryRetry(query, errorResetBoundary)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n isRestoring\n ? noop\n : observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n {\n listeners: false,\n },\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts) {\n const queryObserver = new QueryObserver(client, opts)\n if (shouldSuspend(opts, result)) {\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n } else if (willFetch(result, isRestoring)) {\n void fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAIO;AACP,iCAA+B;AAC/B,yBAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,sBAKO;AACP,mBAAqB;AAyMd,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAIA,aACiB;AACjB,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,kBAAc,mCAAe;AACnC,QAAM,yBAAqB,2DAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,UAAU;AAClC,8CAAqB,KAAK;AAC1B,mEAAgC,OAAO,kBAAkB;AAAA,EAC3D,CAAC;AAED,4DAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,QAAM,CAAC,kBAAkB,mBAAmB,WAAW,IACrD,SAAS;AAAA,IACP;AAAA,IACC,QAAoD;AAAA,EACvD;AAEF,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBACC,cACI,oBACA,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAChE,CAAC,UAAU,WAAW;AAAA,IACxB;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AAGpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,cAC7D,+BAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,MAAM;AACR,YAAM,gBAAgB,IAAI,gCAAc,QAAQ,IAAI;AACpD,cAAI,+BAAc,MAAM,MAAM,GAAG;AAC/B,mBAAO,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,MAChE,eAAW,2BAAU,QAAQ,WAAW,GAAG;AACzC,iBAAK,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,MAC9D;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,aACA,uCAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,MACnD,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,uFAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts deleted file mode 100644 index c933395c1898c5a8fd5ce90d33ec6b2c6afc4f35..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts +++ /dev/null @@ -1,71 +0,0 @@ -import { UseQueryResult, UseQueryOptions, DefinedUseQueryResult } from './types.cjs'; -import { DefaultError, QueryClient, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError } from '@tanstack/query-core'; - -type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData'> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; -}; -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseQueryOptionsForUseQueries = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseQueryOptionsForUseQueries : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends { - data: infer TData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData; -} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; -type GetUseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? GetDefinedOrUndefinedQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseQueryOptionsForUseQueries -], [ - ...TDepth, - 1 -]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; -/** - * QueriesResults reducer recursively maps type param to results - */ -type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseQueryResult -], [ - ...TDepth, - 1 -]> : T extends Array> ? Array> : Array; -declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { - queries: readonly [...QueriesOptions]; - combine?: (result: QueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map b/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map deleted file mode 100644 index b4e19659cea057b7421f374e1a3a45f882225ba2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './isRestoring'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport { noop } from './utils'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries: readonly [...QueriesOptions]\n combine?: (result: QueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((query) => {\n ensureSuspenseTimers(query)\n ensurePreventErrorBoundaryRetry(query, errorResetBoundary)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n isRestoring\n ? noop\n : observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n {\n listeners: false,\n },\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts) {\n const queryObserver = new QueryObserver(client, opts)\n if (shouldSuspend(opts, result)) {\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n } else if (willFetch(result, isRestoring)) {\n void fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAY;AAyMd,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAIA,aACiB;AACjB,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,UAAU;AAClC,yBAAqB,KAAK;AAC1B,oCAAgC,OAAO,kBAAkB;AAAA,EAC3D,CAAC;AAED,6BAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,QAAM,CAAC,kBAAkB,mBAAmB,WAAW,IACrD,SAAS;AAAA,IACP;AAAA,IACC,QAAoD;AAAA,EACvD;AAEF,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBACC,cACI,OACA,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAChE,CAAC,UAAU,WAAW;AAAA,IACxB;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AAGpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,UAC7D,cAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,MAAM;AACR,YAAM,gBAAgB,IAAI,cAAc,QAAQ,IAAI;AACpD,UAAI,cAAc,MAAM,MAAM,GAAG;AAC/B,eAAO,gBAAgB,MAAM,eAAe,kBAAkB;AAAA,MAChE,WAAW,UAAU,QAAQ,WAAW,GAAG;AACzC,aAAK,gBAAgB,MAAM,eAAe,kBAAkB;AAAA,MAC9D;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,SACA,YAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,MACnD,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,uFAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs deleted file mode 100644 index 993525b9d2901718636f305166aae9ac8564c7c8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQuery.ts -var useQuery_exports = {}; -__export(useQuery_exports, { - useQuery: () => useQuery -}); -module.exports = __toCommonJS(useQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQuery -}); -//# sourceMappingURL=useQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map deleted file mode 100644 index 35e5c5915f6301e49788f38032349794fce49326..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA8B;AAC9B,0BAA6B;AA0CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,aAAO,kCAAa,SAAS,iCAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts deleted file mode 100644 index 394c39ec53ccf4b0dc6514bda739bf962c78da44..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; -import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.js'; -import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.js'; - -declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult; -declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult; -declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult; - -export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.js b/node_modules/@tanstack/react-query/build/legacy/useQuery.js deleted file mode 100644 index 6173d626004696cb4676b8ed4b3c681eabf60ac7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -// src/useQuery.ts -import { QueryObserver } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -function useQuery(options, queryClient) { - return useBaseQuery(options, QueryObserver, queryClient); -} -export { - useQuery -}; -//# sourceMappingURL=useQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map deleted file mode 100644 index e64061116d972f7785ba2414ef48306b67da40d2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA0CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,SAAO,aAAa,SAAS,eAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs deleted file mode 100644 index 1d06bb1b6e148aa89255504ba0c12d9e2fb76a42..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseInfiniteQuery.ts -var useSuspenseInfiniteQuery_exports = {}; -__export(useSuspenseInfiniteQuery_exports, { - useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery -}); -module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError - }, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseInfiniteQuery -}); -//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map deleted file mode 100644 index e51349493a9a1cb9f36a64e63dea34c1b7df6d6e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAiD;AACjD,0BAA6B;AAC7B,sBAAoC;AAc7B,SAAS,yBAOd,SAQA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts deleted file mode 100644 index 9ae1eeecddebd051ec6f8cdff3f8690dbd315f13..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.cjs'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts deleted file mode 100644 index b210055dd9e344c059fa406586c1071f6370f88b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.js'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js deleted file mode 100644 index 7c8facf679ebcc46c01175dc34536084cff1f94a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -// src/useSuspenseInfiniteQuery.ts -import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError - }, - InfiniteQueryObserver, - queryClient - ); -} -export { - useSuspenseInfiniteQuery -}; -//# sourceMappingURL=useSuspenseInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs deleted file mode 100644 index 75f86ef030be6b622e5ae456421519d8d26b8e1d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQueries.ts -var useSuspenseQueries_exports = {}; -__export(useSuspenseQueries_exports, { - useSuspenseQueries: () => useSuspenseQueries -}); -module.exports = __toCommonJS(useSuspenseQueries_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useQueries = require("./useQueries.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQueries(options, queryClient) { - return (0, import_useQueries.useQueries)( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== "production") { - if (query.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQueries -}); -//# sourceMappingURL=useSuspenseQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map deleted file mode 100644 index 2887e829977f519af3864b83284f98bc0a15fdbf..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n } as any,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0B;AAC1B,wBAA2B;AAC3B,sBAAoC;AAiL7B,SAAS,mBAId,SAIA,aACiB;AACjB,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAU;AACtC,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,6BAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts deleted file mode 100644 index d2be29325a813bd0c228819e01a6d2e86753b183..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts +++ /dev/null @@ -1,71 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : T extends Array> ? Array> : Array; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts deleted file mode 100644 index 2b70a4dda66e816da4f0d7b574cd06b864bd1950..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : T extends Array> ? Array> : Array; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map deleted file mode 100644 index ba7575c54753fc5ac3bbc4c884f511093edd707f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n } as any,\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAiL7B,SAAS,mBAId,SAIA,aACiB;AACjB,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAU;AACtC,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,WAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs deleted file mode 100644 index dcf18a21c2d24adfed65c1e8598200a66573d546..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQuery.ts -var useSuspenseQuery_exports = {}; -__export(useSuspenseQuery_exports, { - useSuspenseQuery: () => useSuspenseQuery -}); -module.exports = __toCommonJS(useSuspenseQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - placeholderData: void 0 - }, - import_query_core.QueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQuery -}); -//# sourceMappingURL=useSuspenseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map deleted file mode 100644 index c4568602b8a64ac4cabe4dfb54caf9f7b58b9225..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAyC;AACzC,0BAA6B;AAC7B,sBAAoC;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts deleted file mode 100644 index b2e662eedf56ecc4e096f367a103306e57326a42..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts deleted file mode 100644 index f53bc838139f70c6ec571f0181c9a3c62f584850..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map deleted file mode 100644 index 2d961426492a38da8f5970b7ad14782d9eceae3e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;AACA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/utils.cjs b/node_modules/@tanstack/react-query/build/legacy/utils.cjs deleted file mode 100644 index 6cc6bddbc3bf3d20845159abb56be3bb981ed36d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/utils.cjs +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - noop: () => noop, - shouldThrowError: () => shouldThrowError -}); -module.exports = __toCommonJS(utils_exports); -function shouldThrowError(throwError, params) { - if (typeof throwError === "function") { - return throwError(...params); - } - return !!throwError; -} -function noop() { -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - noop, - shouldThrowError -}); -//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/utils.d.cts b/node_modules/@tanstack/react-query/build/legacy/utils.d.cts deleted file mode 100644 index d181e0d8f10a397db54b5760eccdb733da1a2259..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/utils.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -declare function shouldThrowError) => boolean>(throwError: boolean | T | undefined, params: Parameters): boolean; -declare function noop(): void; - -export { noop, shouldThrowError }; diff --git a/node_modules/@tanstack/react-query/build/legacy/utils.d.ts b/node_modules/@tanstack/react-query/build/legacy/utils.d.ts deleted file mode 100644 index d181e0d8f10a397db54b5760eccdb733da1a2259..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/legacy/utils.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare function shouldThrowError) => boolean>(throwError: boolean | T | undefined, params: Parameters): boolean; -declare function noop(): void; - -export { noop, shouldThrowError }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs deleted file mode 100644 index 3be764ace8f6222061dd40b0ae72ddd49829390c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/HydrationBoundary.tsx -var HydrationBoundary_exports = {}; -__export(HydrationBoundary_exports, { - HydrationBoundary: () => HydrationBoundary -}); -module.exports = __toCommonJS(HydrationBoundary_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const [hydrationQueue, setHydrationQueue] = React.useState(); - const optionsRef = React.useRef(options); - optionsRef.current = options; - React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt; - const queryAlreadyQueued = hydrationQueue?.find( - (query) => query.queryHash === dehydratedQuery.queryHash - ); - if (hydrationIsNewer && (!queryAlreadyQueued || dehydratedQuery.state.dataUpdatedAt > queryAlreadyQueued.state.dataUpdatedAt)) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - setHydrationQueue( - (prev) => prev ? [...prev, ...existingQueries] : existingQueries - ); - } - } - }, [client, hydrationQueue, state]); - React.useEffect(() => { - if (hydrationQueue) { - (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); - setHydrationQueue(void 0); - } - }, [client, hydrationQueue]); - return children; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary -}); -//# sourceMappingURL=HydrationBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map deleted file mode 100644 index 93d821916ff272d28f89c7b747c7186a58c9308d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n const [hydrationQueue, setHydrationQueue] = React.useState<\n DehydratedState['queries'] | undefined\n >()\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // This useMemo is for performance reasons only, everything inside it _must_\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (state as DehydratedState).queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt\n const queryAlreadyQueued = hydrationQueue?.find(\n (query) => query.queryHash === dehydratedQuery.queryHash,\n )\n\n if (\n hydrationIsNewer &&\n (!queryAlreadyQueued ||\n dehydratedQuery.state.dataUpdatedAt >\n queryAlreadyQueued.state.dataUpdatedAt)\n ) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n setHydrationQueue((prev) =>\n prev ? [...prev, ...existingQueries] : existingQueries,\n )\n }\n }\n }, [client, hydrationQueue, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n setHydrationQueue(undefined)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,YAAuB;AAEvB,wBAAwB;AACxB,iCAA+B;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,CAAC,gBAAgB,iBAAiB,IAAU,eAEhD;AAEF,QAAM,aAAmB,aAAO,OAAO;AACvC,aAAW,UAAU;AAiBrB,EAAM,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAExC,YAAM,UAAW,MAA0B,WAAW,CAAC;AAEvD,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACtB,cAAc,MAAM;AACtB,gBAAM,qBAAqB,gBAAgB;AAAA,YACzC,CAAC,UAAU,MAAM,cAAc,gBAAgB;AAAA,UACjD;AAEA,cACE,qBACC,CAAC,sBACA,gBAAgB,MAAM,gBACpB,mBAAmB,MAAM,gBAC7B;AACA,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAGzB,uCAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B;AAAA,UAAkB,CAAC,SACjB,OAAO,CAAC,GAAG,MAAM,GAAG,eAAe,IAAI;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,gBAAgB,KAAK,CAAC;AAElC,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qCAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAC/D,wBAAkB,MAAS;AAAA,IAC7B;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts deleted file mode 100644 index fc13cc13373d12470b89340e275a9e5aceb18f0c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state?: unknown; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement>; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts deleted file mode 100644 index fc13cc13373d12470b89340e275a9e5aceb18f0c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state?: unknown; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement>; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js deleted file mode 100644 index 49e452b6f86c83845487afffb1f8fb2f09c15bd9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js +++ /dev/null @@ -1,61 +0,0 @@ -"use client"; - -// src/HydrationBoundary.tsx -import * as React from "react"; -import { hydrate } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = useQueryClient(queryClient); - const [hydrationQueue, setHydrationQueue] = React.useState(); - const optionsRef = React.useRef(options); - optionsRef.current = options; - React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt; - const queryAlreadyQueued = hydrationQueue?.find( - (query) => query.queryHash === dehydratedQuery.queryHash - ); - if (hydrationIsNewer && (!queryAlreadyQueued || dehydratedQuery.state.dataUpdatedAt > queryAlreadyQueued.state.dataUpdatedAt)) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - hydrate(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - setHydrationQueue( - (prev) => prev ? [...prev, ...existingQueries] : existingQueries - ); - } - } - }, [client, hydrationQueue, state]); - React.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current); - setHydrationQueue(void 0); - } - }, [client, hydrationQueue]); - return children; -}; -export { - HydrationBoundary -}; -//# sourceMappingURL=HydrationBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map deleted file mode 100644 index 9d5c1c9b4399b9b67954c1e7f7b7f3992ce334ae..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n const [hydrationQueue, setHydrationQueue] = React.useState<\n DehydratedState['queries'] | undefined\n >()\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // This useMemo is for performance reasons only, everything inside it _must_\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (state as DehydratedState).queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt\n const queryAlreadyQueued = hydrationQueue?.find(\n (query) => query.queryHash === dehydratedQuery.queryHash,\n )\n\n if (\n hydrationIsNewer &&\n (!queryAlreadyQueued ||\n dehydratedQuery.state.dataUpdatedAt >\n queryAlreadyQueued.state.dataUpdatedAt)\n ) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n setHydrationQueue((prev) =>\n prev ? [...prev, ...existingQueries] : existingQueries,\n )\n }\n }\n }, [client, hydrationQueue, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n setHydrationQueue(undefined)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAEvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,CAAC,gBAAgB,iBAAiB,IAAU,eAEhD;AAEF,QAAM,aAAmB,aAAO,OAAO;AACvC,aAAW,UAAU;AAiBrB,EAAM,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAExC,YAAM,UAAW,MAA0B,WAAW,CAAC;AAEvD,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACtB,cAAc,MAAM;AACtB,gBAAM,qBAAqB,gBAAgB;AAAA,YACzC,CAAC,UAAU,MAAM,cAAc,gBAAgB;AAAA,UACjD;AAEA,cACE,qBACC,CAAC,sBACA,gBAAgB,MAAM,gBACpB,mBAAmB,MAAM,gBAC7B;AACA,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAGzB,gBAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B;AAAA,UAAkB,CAAC,SACjB,OAAO,CAAC,GAAG,MAAM,GAAG,eAAe,IAAI;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,gBAAgB,KAAK,CAAC;AAElC,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,cAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAC/D,wBAAkB,MAAS;AAAA,IAC7B;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs deleted file mode 100644 index d91255c2ac94614ca960c8bc72121a75625798b2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/QueryClientProvider.tsx -var QueryClientProvider_exports = {}; -__export(QueryClientProvider_exports, { - QueryClientContext: () => QueryClientContext, - QueryClientProvider: () => QueryClientProvider, - useQueryClient: () => useQueryClient -}); -module.exports = __toCommonJS(QueryClientProvider_exports); -var React = __toESM(require("react"), 1); -var import_jsx_runtime = require("react/jsx-runtime"); -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClientContext, - QueryClientProvider, - useQueryClient -}); -//# sourceMappingURL=QueryClientProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts deleted file mode 100644 index 1b1fd69711e40c3fd048432deb1301dbd2adc863..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts deleted file mode 100644 index 1b1fd69711e40c3fd048432deb1301dbd2adc863..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map deleted file mode 100644 index 44bad03d77595352e613d3d46deaf20a4b77f13e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map deleted file mode 100644 index 29c7b08210ea6a1799b9f7980511db3e91378a54..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,4CAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts deleted file mode 100644 index bfb574515964a5e40a71f77b54bbe38e3445dee1..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React from 'react'; - -type QueryErrorResetFunction = () => void; -type QueryErrorIsResetFunction = () => boolean; -type QueryErrorClearResetFunction = () => void; -interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction; - isReset: QueryErrorIsResetFunction; - reset: QueryErrorResetFunction; -} -declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; -type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; -interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode; -} -declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; - -export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js deleted file mode 100644 index ae56edcc2b124f886c1330bb4b3e0c00de7d8437..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -// src/QueryErrorResetBoundary.tsx -import * as React from "react"; -import { jsx } from "react/jsx-runtime"; -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React.createContext(createValue()); -var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React.useState(() => createValue()); - return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; -export { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -}; -//# sourceMappingURL=QueryErrorResetBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map deleted file mode 100644 index c8b04a7ca9b36d1d85e8f9092c838868e538dfab..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oBAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs deleted file mode 100644 index c75d6b33f1de4cd40f8b7aeb49c2768c41518087..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/errorBoundaryUtils.ts -var errorBoundaryUtils_exports = {}; -__export(errorBoundaryUtils_exports, { - ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, - getHasError: () => getHasError, - useClearResetErrorBoundary: () => useClearResetErrorBoundary -}); -module.exports = __toCommonJS(errorBoundaryUtils_exports); -var React = __toESM(require("react"), 1); -var import_utils = require("./utils.cjs"); -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { - if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (0, import_utils.shouldThrowError)(throwOnError, [result.error, query]); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}); -//# sourceMappingURL=errorBoundaryUtils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map deleted file mode 100644 index 7d4c296cd6dd0b4f447a693baf23e85f7419b6b1..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (\n options.suspense ||\n options.throwOnError ||\n options.experimental_prefetchInRender\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,mBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,uBACG;AACH,MACE,QAAQ,YACR,QAAQ,gBACR,QAAQ,+BACR;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,aACA,+BAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAExD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts deleted file mode 100644 index 6e8f6c0df2e90cdede820a72d648d5cf04a24610..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, QueryObserverResult, ThrowOnError, Query } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts deleted file mode 100644 index 20e222e867c816bcb36952a3eab041dc5f6d3775..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, QueryObserverResult, ThrowOnError, Query } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js deleted file mode 100644 index a2e16fe5ef68b54de24f6192c36017d3f58d7a6b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +++ /dev/null @@ -1,31 +0,0 @@ -"use client"; - -// src/errorBoundaryUtils.ts -import * as React from "react"; -import { shouldThrowError } from "./utils.js"; -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { - if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]); -}; -export { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}; -//# sourceMappingURL=errorBoundaryUtils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map deleted file mode 100644 index 5f0c6b0259fbab8106bbd217e5d9b3d15890e2d8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (\n options.suspense ||\n options.throwOnError ||\n options.experimental_prefetchInRender\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,uBACG;AACH,MACE,QAAQ,YACR,QAAQ,gBACR,QAAQ,+BACR;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,SACA,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAExD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.cjs b/node_modules/@tanstack/react-query/build/modern/index.cjs deleted file mode 100644 index a2d9ae6e3e7cc33be801c8d1305f38551bcce8dd..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/index.cjs +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, - IsRestoringProvider: () => import_isRestoring.IsRestoringProvider, - QueryClientContext: () => import_QueryClientProvider.QueryClientContext, - QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, - QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, - infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, - queryOptions: () => import_queryOptions.queryOptions, - useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, - useIsFetching: () => import_useIsFetching.useIsFetching, - useIsMutating: () => import_useMutationState.useIsMutating, - useIsRestoring: () => import_isRestoring.useIsRestoring, - useMutation: () => import_useMutation.useMutation, - useMutationState: () => import_useMutationState.useMutationState, - usePrefetchInfiniteQuery: () => import_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery, - usePrefetchQuery: () => import_usePrefetchQuery.usePrefetchQuery, - useQueries: () => import_useQueries.useQueries, - useQuery: () => import_useQuery.useQuery, - useQueryClient: () => import_QueryClientProvider.useQueryClient, - useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, - useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, - useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, - useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery -}); -module.exports = __toCommonJS(src_exports); -__reExport(src_exports, require("@tanstack/query-core"), module.exports); -__reExport(src_exports, require("./types.cjs"), module.exports); -var import_useQueries = require("./useQueries.cjs"); -var import_useQuery = require("./useQuery.cjs"); -var import_useSuspenseQuery = require("./useSuspenseQuery.cjs"); -var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs"); -var import_useSuspenseQueries = require("./useSuspenseQueries.cjs"); -var import_usePrefetchQuery = require("./usePrefetchQuery.cjs"); -var import_usePrefetchInfiniteQuery = require("./usePrefetchInfiniteQuery.cjs"); -var import_queryOptions = require("./queryOptions.cjs"); -var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_HydrationBoundary = require("./HydrationBoundary.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_useIsFetching = require("./useIsFetching.cjs"); -var import_useMutationState = require("./useMutationState.cjs"); -var import_useMutation = require("./useMutation.cjs"); -var import_useInfiniteQuery = require("./useInfiniteQuery.cjs"); -var import_isRestoring = require("./isRestoring.cjs"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery, - ...require("@tanstack/query-core"), - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.cjs.map b/node_modules/@tanstack/react-query/build/modern/index.cjs.map deleted file mode 100644 index 43c96d0826e5a52a54bd74b28066815be800b274..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './isRestoring'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAc,iCAHd;AAMA,wBAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,gCAAmC;AAKnC,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAM7B,kCAAqC;AAMrC,iCAIO;AAGP,+BAAkC;AAQlC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,8BAAiC;AACjC,yBAAoD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.d.cts b/node_modules/@tanstack/react-query/build/modern/index.d.cts deleted file mode 100644 index 3af037a9d0024d4e1206fa9aed182ea4ddea9d04..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/index.d.cts +++ /dev/null @@ -1,21 +0,0 @@ -export * from '@tanstack/query-core'; -export { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs'; -export { useQuery } from './useQuery.cjs'; -export { useSuspenseQuery } from './useSuspenseQuery.cjs'; -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs'; -export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.cjs'; -export { usePrefetchQuery } from './usePrefetchQuery.cjs'; -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.cjs'; -export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.cjs'; -export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.cjs'; -export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs'; -export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs'; -export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs'; -export { useIsFetching } from './useIsFetching.cjs'; -export { useIsMutating, useMutationState } from './useMutationState.cjs'; -export { useMutation } from './useMutation.cjs'; -export { useInfiniteQuery } from './useInfiniteQuery.cjs'; -export { IsRestoringProvider, useIsRestoring } from './isRestoring.cjs'; -import 'react'; -import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/modern/index.js b/node_modules/@tanstack/react-query/build/modern/index.js deleted file mode 100644 index c90cb765baaaf3f1edd6e555de5cd4f5dfaa1452..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/index.js +++ /dev/null @@ -1,52 +0,0 @@ -// src/index.ts -export * from "@tanstack/query-core"; -export * from "./types.js"; -import { useQueries } from "./useQueries.js"; -import { useQuery } from "./useQuery.js"; -import { useSuspenseQuery } from "./useSuspenseQuery.js"; -import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js"; -import { useSuspenseQueries } from "./useSuspenseQueries.js"; -import { usePrefetchQuery } from "./usePrefetchQuery.js"; -import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.js"; -import { queryOptions } from "./queryOptions.js"; -import { infiniteQueryOptions } from "./infiniteQueryOptions.js"; -import { - QueryClientContext, - QueryClientProvider, - useQueryClient -} from "./QueryClientProvider.js"; -import { HydrationBoundary } from "./HydrationBoundary.js"; -import { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -} from "./QueryErrorResetBoundary.js"; -import { useIsFetching } from "./useIsFetching.js"; -import { useIsMutating, useMutationState } from "./useMutationState.js"; -import { useMutation } from "./useMutation.js"; -import { useInfiniteQuery } from "./useInfiniteQuery.js"; -import { useIsRestoring, IsRestoringProvider } from "./isRestoring.js"; -export { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map deleted file mode 100644 index 986febc1d589b128a654c6b49df79c4b70043315..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\ntype NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6JO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts deleted file mode 100644 index 0e05ad630584cc7c117fe29768e49d7924301bd1..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseInfiniteQueryOptions } from './types.js'; - -type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; -}; -type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type NonUndefinedGuard = T extends undefined ? never : T; -type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { - queryKey: DataTag>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { - queryKey: DataTag>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { - queryKey: DataTag>; -}; - -export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js deleted file mode 100644 index bc8d5b0bebceafab86971f75a08323edee67d0b7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/infiniteQueryOptions.ts -function infiniteQueryOptions(options) { - return options; -} -export { - infiniteQueryOptions -}; -//# sourceMappingURL=infiniteQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map deleted file mode 100644 index 173e6efc5cc42947a6f2dd57f639957ab4b24ae2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\ntype NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AA6JO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/isRestoring.cjs b/node_modules/@tanstack/react-query/build/modern/isRestoring.cjs deleted file mode 100644 index e4357949a653e6bff94e3ca1aa4550ca93b746be..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/isRestoring.cjs +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/isRestoring.ts -var isRestoring_exports = {}; -__export(isRestoring_exports, { - IsRestoringProvider: () => IsRestoringProvider, - useIsRestoring: () => useIsRestoring -}); -module.exports = __toCommonJS(isRestoring_exports); -var React = __toESM(require("react"), 1); -var IsRestoringContext = React.createContext(false); -var useIsRestoring = () => React.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - IsRestoringProvider, - useIsRestoring -}); -//# sourceMappingURL=isRestoring.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/isRestoring.cjs.map b/node_modules/@tanstack/react-query/build/modern/isRestoring.cjs.map deleted file mode 100644 index af71da72c69acf78e4414bbc7b9b1b329b3add23..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/isRestoring.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/isRestoring.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/isRestoring.d.ts b/node_modules/@tanstack/react-query/build/modern/isRestoring.d.ts deleted file mode 100644 index 08b14ff344a36fbb42886399b916f1bca57df399..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/isRestoring.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; - -declare const useIsRestoring: () => boolean; -declare const IsRestoringProvider: React.Provider; - -export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/modern/isRestoring.js.map b/node_modules/@tanstack/react-query/build/modern/isRestoring.js.map deleted file mode 100644 index a4619d1f6cbe752b371a993f27474a8c07dfa8d0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/isRestoring.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/isRestoring.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs deleted file mode 100644 index ffda67f4bba99e0f381bb5e584e9e593bd58b525..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryOptions.ts -var queryOptions_exports = {}; -__export(queryOptions_exports, { - queryOptions: () => queryOptions -}); -module.exports = __toCommonJS(queryOptions_exports); -function queryOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - queryOptions -}); -//# sourceMappingURL=queryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts deleted file mode 100644 index 8a3ef696b7c5c401f006abdef66d6ceb713c673e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, QueryKey, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseQueryOptions } from './types.js'; - -type UndefinedInitialDataOptions = UseQueryOptions & { - initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; -}; -type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type NonUndefinedGuard = T extends undefined ? never : T; -type DefinedInitialDataOptions = UseQueryOptions & { - initialData: NonUndefinedGuard | (() => NonUndefinedGuard); -}; -declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { - queryKey: DataTag; -}; - -export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.js b/node_modules/@tanstack/react-query/build/modern/queryOptions.js deleted file mode 100644 index 7fb75ff32594afe16aa69be3101004b219b39a58..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/queryOptions.ts -function queryOptions(options) { - return options; -} -export { - queryOptions -}; -//# sourceMappingURL=queryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map b/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map deleted file mode 100644 index 0be7a3c1cace7f1d9925f7308bc589a51980ebed..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (defaultedOptions.staleTime === undefined) {\n defaultedOptions.staleTime = 1000\n }\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,QAAI,iBAAiB,cAAc,QAAW;AAC5C,uBAAiB,YAAY;AAAA,IAC/B;AACA,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK,IAAI,iBAAiB,QAAQ,GAAI;AAAA,IAClE;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,WACG,kBAAkB,YAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.d.cts b/node_modules/@tanstack/react-query/build/modern/suspense.d.cts deleted file mode 100644 index fbead76ed1b3e61e99a19b7955bdb56b1e7d651f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import { QueryKey, Query, DefaultedQueryObserverOptions, QueryObserverResult, QueryObserver } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; -declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; -declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; -declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; -declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; - -export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.js b/node_modules/@tanstack/react-query/build/modern/suspense.js deleted file mode 100644 index 9c19a470fc8ef1a4cbe81d8ec2177d0756c93990..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.js +++ /dev/null @@ -1,25 +0,0 @@ -// src/suspense.ts -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - if (defaultedOptions.staleTime === void 0) { - defaultedOptions.staleTime = 1e3; - } - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1e3); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); -export { - defaultThrowOnError, - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -}; -//# sourceMappingURL=suspense.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.js.map b/node_modules/@tanstack/react-query/build/modern/suspense.js.map deleted file mode 100644 index 01b5ca3efc3f8264c903dee4180e555194d0a861..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (defaultedOptions.staleTime === undefined) {\n defaultedOptions.staleTime = 1000\n }\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,QAAI,iBAAiB,cAAc,QAAW;AAC5C,uBAAiB,YAAY;AAAA,IAC/B;AACA,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK,IAAI,iBAAiB,QAAQ,GAAI;AAAA,IAClE;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,WACG,kBAAkB,YAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.cjs b/node_modules/@tanstack/react-query/build/modern/types.cjs deleted file mode 100644 index d22152bc67861f6fd334ace0ed3fdd09464cc941..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/types.cjs +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.d.cts b/node_modules/@tanstack/react-query/build/modern/types.d.cts deleted file mode 100644 index 1cff51e59e4997759da1e5fcce2f08a0dfeb869c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/types.d.cts +++ /dev/null @@ -1,33 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, SkipToken, InfiniteQueryObserverOptions, QueryObserverResult, DefinedQueryObserverResult, InfiniteQueryObserverResult, DefinedInfiniteQueryObserverResult, MutationObserverOptions, MutateFunction, Override, MutationObserverResult } from '@tanstack/query-core'; - -interface UseBaseQueryOptions extends QueryObserverOptions { -} -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/modern/types.d.ts b/node_modules/@tanstack/react-query/build/modern/types.d.ts deleted file mode 100644 index 1cff51e59e4997759da1e5fcce2f08a0dfeb869c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, SkipToken, InfiniteQueryObserverOptions, QueryObserverResult, DefinedQueryObserverResult, InfiniteQueryObserverResult, DefinedInfiniteQueryObserverResult, MutationObserverOptions, MutateFunction, Override, MutationObserverResult } from '@tanstack/query-core'; - -interface UseBaseQueryOptions extends QueryObserverOptions { -} -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { -} -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/modern/types.js b/node_modules/@tanstack/react-query/build/modern/types.js deleted file mode 100644 index 5b2306a4c52321a5316142318d15fa56711ec12d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/types.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.js.map b/node_modules/@tanstack/react-query/build/modern/types.js.map deleted file mode 100644 index 84c51b288c478ac0d18748007ccfb8cddc797f3a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs deleted file mode 100644 index 6b9f949241b8f5dad782c53d96da7a39c22bfeb9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useBaseQuery.ts -var useBaseQuery_exports = {}; -__export(useBaseQuery_exports, { - useBaseQuery: () => useBaseQuery -}); -module.exports = __toCommonJS(useBaseQuery_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_isRestoring = require("./isRestoring.cjs"); -var import_suspense = require("./suspense.cjs"); -var import_utils = require("./utils.cjs"); -function useBaseQuery(options, Observer, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - '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' - ); - } - } - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const isRestoring = (0, import_isRestoring.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const defaultedOptions = client.defaultQueryOptions(options); - client.getDefaultOptions().queries?._experimental_beforeQuery?.( - defaultedOptions - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - (0, import_suspense.ensureSuspenseTimers)(defaultedOptions); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = isRestoring ? import_utils.noop : observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)); - observer.updateResult(); - return unsubscribe; - }, - [observer, isRestoring] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions, { listeners: false }); - }, [defaultedOptions, observer]); - if ((0, import_suspense.shouldSuspend)(defaultedOptions, result)) { - throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); - } - if ((0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query: client.getQueryCache().get(defaultedOptions.queryHash) - })) { - throw result.error; - } - ; - client.getDefaultOptions().queries?._experimental_afterQuery?.( - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !import_query_core.isServer && (0, import_suspense.willFetch)(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - client.getQueryCache().get(defaultedOptions.queryHash)?.promise - ); - promise?.catch(import_utils.noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useBaseQuery -}); -//# sourceMappingURL=useBaseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts deleted file mode 100644 index baa8469ad5ee8c20c0908d3a26100b7e3d65eae6..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.cjs'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts deleted file mode 100644 index 60430b0495ccf21e6f158ea36c3ae714611c1493..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.js'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js deleted file mode 100644 index e8cf3a4fba4c6f8ddbbdf8ebd3fdad054a059d0c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +++ /dev/null @@ -1,96 +0,0 @@ -"use client"; - -// src/useBaseQuery.ts -import * as React from "react"; -import { isServer, notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -} from "./errorBoundaryUtils.js"; -import { useIsRestoring } from "./isRestoring.js"; -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -} from "./suspense.js"; -import { noop } from "./utils.js"; -function useBaseQuery(options, Observer, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - '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' - ); - } - } - const client = useQueryClient(queryClient); - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const defaultedOptions = client.defaultQueryOptions(options); - client.getDefaultOptions().queries?._experimental_beforeQuery?.( - defaultedOptions - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - ensureSuspenseTimers(defaultedOptions); - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); - useClearResetErrorBoundary(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = isRestoring ? noop : observer.subscribe(notifyManager.batchCalls(onStoreChange)); - observer.updateResult(); - return unsubscribe; - }, - [observer, isRestoring] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions, { listeners: false }); - }, [defaultedOptions, observer]); - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); - } - if (getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query: client.getQueryCache().get(defaultedOptions.queryHash) - })) { - throw result.error; - } - ; - client.getDefaultOptions().queries?._experimental_afterQuery?.( - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - client.getQueryCache().get(defaultedOptions.queryHash)?.promise - ); - promise?.catch(noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -export { - useBaseQuery -}; -//# sourceMappingURL=useBaseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs deleted file mode 100644 index e1ae216829681d04826f282a2616275b3d570d60..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useInfiniteQuery.ts -var useInfiniteQuery_exports = {}; -__export(useInfiniteQuery_exports, { - useInfiniteQuery: () => useInfiniteQuery -}); -module.exports = __toCommonJS(useInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useInfiniteQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)( - options, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useInfiniteQuery -}); -//# sourceMappingURL=useInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map deleted file mode 100644 index 104ecd219da5c7ff1e28cc51edcf8310ae50ef3b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AACtC,0BAA6B;AAsEtB,SAAS,iBACd,SACA,aACA;AACA,aAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs deleted file mode 100644 index 28660e7d19489acc86f6a2f0c9b47e453ac66fae..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useIsFetching.ts -var useIsFetching_exports = {}; -__export(useIsFetching_exports, { - useIsFetching: () => useIsFetching -}); -module.exports = __toCommonJS(useIsFetching_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsFetching(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const queryCache = client.getQueryCache(); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsFetching -}); -//# sourceMappingURL=useIsFetching.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map deleted file mode 100644 index 5a58e86806e2919b9dcfbaf0cc3c32a4e23a5661..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAA8B;AAE9B,iCAA+B;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts deleted file mode 100644 index 832d33f56bd3024b01d378505c84d81a7553f5c9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts deleted file mode 100644 index 832d33f56bd3024b01d378505c84d81a7553f5c9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map deleted file mode 100644 index 9921ab6e20952d564197ef61fccc3ab1f4943bd0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAE9B,SAAS,sBAAsB;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs deleted file mode 100644 index 175de467172e7c876d51141d22f151de482d2a43..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutation.ts -var useMutation_exports = {}; -__export(useMutation_exports, { - useMutation: () => useMutation -}); -module.exports = __toCommonJS(useMutation_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_utils = require("./utils.cjs"); -function useMutation(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const [observer] = React.useState( - () => new import_query_core.MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(import_utils.noop); - }, - [observer] - ); - if (result.error && (0, import_utils.shouldThrowError)(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useMutation -}); -//# sourceMappingURL=useMutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map deleted file mode 100644 index 2beaf7a697d67be63bb22ae4739b0db0eeede8f7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { MutationObserver, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { noop, shouldThrowError } from './utils'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAAgD;AAChD,iCAA+B;AAC/B,mBAAuC;AAUhC,SAAS,YAMd,SACA,aACwD;AACxD,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,iBAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,aACP,+BAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts b/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts deleted file mode 100644 index 5343f3ff36b60e78553bc472657cd039b6355d1d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.cjs'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts b/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts deleted file mode 100644 index dfe60df8cb126fdb62b208763ee1ff14a02269c0..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.js'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.js b/node_modules/@tanstack/react-query/build/modern/useMutation.js deleted file mode 100644 index 515a3b92ecf8c348ccc7f16de4f778301327e9c9..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.js +++ /dev/null @@ -1,41 +0,0 @@ -"use client"; - -// src/useMutation.ts -import * as React from "react"; -import { MutationObserver, notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { noop, shouldThrowError } from "./utils.js"; -function useMutation(options, queryClient) { - const client = useQueryClient(queryClient); - const [observer] = React.useState( - () => new MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop); - }, - [observer] - ); - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -export { - useMutation -}; -//# sourceMappingURL=useMutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs deleted file mode 100644 index 0248bea1b0a0922589748a9338d85be66fc3468c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutationState.ts -var useMutationState_exports = {}; -__export(useMutationState_exports, { - useIsMutating: () => useIsMutating, - useMutationState: () => useMutationState -}); -module.exports = __toCommonJS(useMutationState_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsMutating(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (!result.current) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = (0, import_query_core.replaceEqualDeep)( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - import_query_core.notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsMutating, - useMutationState -}); -//# sourceMappingURL=useMutationState.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map deleted file mode 100644 index 68b0a392336cba75982a1146353c1e14698fca14..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (!result.current) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,YAAuB;AAEvB,wBAAgD;AAChD,iCAA+B;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,oBAAgB,2CAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,iBAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,0CAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts deleted file mode 100644 index 6f35037650d40fa6b55826d7f41b9a332d8b569f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts deleted file mode 100644 index 6f35037650d40fa6b55826d7f41b9a332d8b569f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.js b/node_modules/@tanstack/react-query/build/modern/useMutationState.js deleted file mode 100644 index 0648af4cfd70499f3365abc8b63a06e06976f793..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.js +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -// src/useMutationState.ts -import * as React from "react"; -import { notifyManager, replaceEqualDeep } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useIsMutating(filters, queryClient) { - const client = useQueryClient(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = useQueryClient(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (!result.current) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -export { - useIsMutating, - useMutationState -}; -//# sourceMappingURL=useMutationState.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map b/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map deleted file mode 100644 index ae13415e7f9c31177b3ccd37a92ba91b10385705..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["/* eslint-disable react-compiler/react-compiler */\n\n'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (!result.current) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAEvB,SAAS,eAAe,wBAAwB;AAChD,SAAS,sBAAsB;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,gBAAgB,eAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,aAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,wBAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs deleted file mode 100644 index 91481968950cb95e51d224a112d63c2269879793..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchInfiniteQuery.tsx -var usePrefetchInfiniteQuery_exports = {}; -__export(usePrefetchInfiniteQuery_exports, { - usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery -}); -module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchInfiniteQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchInfiniteQuery -}); -//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts deleted file mode 100644 index aeba2f8cd3759becc5bda14a51b92a01c907652f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map deleted file mode 100644 index 20e30421d72b2889605ba28f3485236f34ea2817..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs deleted file mode 100644 index a884e0f7f51bdc0159d1c108410c87a1b0f79237..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchQuery.tsx -var usePrefetchQuery_exports = {}; -__export(usePrefetchQuery_exports, { - usePrefetchQuery: () => usePrefetchQuery -}); -module.exports = __toCommonJS(usePrefetchQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchQuery -}); -//# sourceMappingURL=usePrefetchQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map deleted file mode 100644 index 2dcf0781528b5015d1655a16503f1ab95106b9fc..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: FetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAQxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts deleted file mode 100644 index 4b04fcc95f1dd0d260aa208143a78db72389a2fb..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchQuery(options: FetchQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js deleted file mode 100644 index 63d3292b7478f878582ade638a754c8565ad5847..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/usePrefetchQuery.tsx -import { useQueryClient } from "./QueryClientProvider.js"; -function usePrefetchQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -export { - usePrefetchQuery -}; -//# sourceMappingURL=usePrefetchQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs deleted file mode 100644 index a3be327942dfeb675da9da9308a4e21d7c29704c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQueries.ts -var useQueries_exports = {}; -__export(useQueries_exports, { - useQueries: () => useQueries -}); -module.exports = __toCommonJS(useQueries_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_isRestoring = require("./isRestoring.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_suspense = require("./suspense.cjs"); -var import_utils = require("./utils.cjs"); -function useQueries({ - queries, - ...options -}, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const isRestoring = (0, import_isRestoring.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const defaultedQueries = React.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((query) => { - (0, import_suspense.ensureSuspenseTimers)(query); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(query, errorResetBoundary); - }); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const [observer] = React.useState( - () => new import_query_core.QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => isRestoring ? import_utils.noop : observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [observer, isRestoring] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options, - { - listeners: false - } - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts) { - const queryObserver = new import_query_core.QueryObserver(client, opts); - if ((0, import_suspense.shouldSuspend)(opts, result)) { - return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); - } else if ((0, import_suspense.willFetch)(result, isRestoring)) { - void (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); - } - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && (0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash) - }); - } - ); - if (firstSingleResultWhichShouldThrow?.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQueries -}); -//# sourceMappingURL=useQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map deleted file mode 100644 index a6403e666c754b1bf351a8553556e6628c61ac30..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './isRestoring'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport { noop } from './utils'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries: readonly [...QueriesOptions]\n combine?: (result: QueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((query) => {\n ensureSuspenseTimers(query)\n ensurePreventErrorBoundaryRetry(query, errorResetBoundary)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n isRestoring\n ? noop\n : observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n {\n listeners: false,\n },\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts) {\n const queryObserver = new QueryObserver(client, opts)\n if (shouldSuspend(opts, result)) {\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n } else if (willFetch(result, isRestoring)) {\n void fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAIO;AACP,iCAA+B;AAC/B,yBAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,sBAKO;AACP,mBAAqB;AAyMd,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAIA,aACiB;AACjB,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,kBAAc,mCAAe;AACnC,QAAM,yBAAqB,2DAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,UAAU;AAClC,8CAAqB,KAAK;AAC1B,mEAAgC,OAAO,kBAAkB;AAAA,EAC3D,CAAC;AAED,4DAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,QAAM,CAAC,kBAAkB,mBAAmB,WAAW,IACrD,SAAS;AAAA,IACP;AAAA,IACC,QAAoD;AAAA,EACvD;AAEF,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBACC,cACI,oBACA,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAChE,CAAC,UAAU,WAAW;AAAA,IACxB;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AAGpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,cAC7D,+BAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,MAAM;AACR,YAAM,gBAAgB,IAAI,gCAAc,QAAQ,IAAI;AACpD,cAAI,+BAAc,MAAM,MAAM,GAAG;AAC/B,mBAAO,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,MAChE,eAAW,2BAAU,QAAQ,WAAW,GAAG;AACzC,iBAAK,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,MAC9D;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,aACA,uCAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,MACnD,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,mCAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts b/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts deleted file mode 100644 index c933395c1898c5a8fd5ce90d33ec6b2c6afc4f35..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts +++ /dev/null @@ -1,71 +0,0 @@ -import { UseQueryResult, UseQueryOptions, DefinedUseQueryResult } from './types.cjs'; -import { DefaultError, QueryClient, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError } from '@tanstack/query-core'; - -type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData'> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; -}; -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseQueryOptionsForUseQueries = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseQueryOptionsForUseQueries : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends { - data: infer TData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData; -} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; -type GetUseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? GetDefinedOrUndefinedQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseQueryOptionsForUseQueries -], [ - ...TDepth, - 1 -]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; -/** - * QueriesResults reducer recursively maps type param to results - */ -type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseQueryResult -], [ - ...TDepth, - 1 -]> : T extends Array> ? Array> : Array; -declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { - queries: readonly [...QueriesOptions]; - combine?: (result: QueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.js.map b/node_modules/@tanstack/react-query/build/modern/useQueries.js.map deleted file mode 100644 index cce8620de6f08dc7b6dd927df034edc54ab0ea50..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './isRestoring'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport { noop } from './utils'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries: readonly [...QueriesOptions]\n combine?: (result: QueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((query) => {\n ensureSuspenseTimers(query)\n ensurePreventErrorBoundaryRetry(query, errorResetBoundary)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n isRestoring\n ? noop\n : observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer, isRestoring],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n {\n listeners: false,\n },\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts) {\n const queryObserver = new QueryObserver(client, opts)\n if (shouldSuspend(opts, result)) {\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n } else if (willFetch(result, isRestoring)) {\n void fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAY;AAyMd,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAIA,aACiB;AACjB,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,UAAU;AAClC,yBAAqB,KAAK;AAC1B,oCAAgC,OAAO,kBAAkB;AAAA,EAC3D,CAAC;AAED,6BAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,QAAM,CAAC,kBAAkB,mBAAmB,WAAW,IACrD,SAAS;AAAA,IACP;AAAA,IACC,QAAoD;AAAA,EACvD;AAEF,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBACC,cACI,OACA,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAChE,CAAC,UAAU,WAAW;AAAA,IACxB;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AAGpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,UAC7D,cAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,MAAM;AACR,YAAM,gBAAgB,IAAI,cAAc,QAAQ,IAAI;AACpD,UAAI,cAAc,MAAM,MAAM,GAAG;AAC/B,eAAO,gBAAgB,MAAM,eAAe,kBAAkB;AAAA,MAChE,WAAW,UAAU,QAAQ,WAAW,GAAG;AACzC,aAAK,gBAAgB,MAAM,eAAe,kBAAkB;AAAA,MAC9D;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,SACA,YAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,MACnD,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,mCAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs deleted file mode 100644 index 993525b9d2901718636f305166aae9ac8564c7c8..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQuery.ts -var useQuery_exports = {}; -__export(useQuery_exports, { - useQuery: () => useQuery -}); -module.exports = __toCommonJS(useQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQuery -}); -//# sourceMappingURL=useQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map deleted file mode 100644 index 35e5c5915f6301e49788f38032349794fce49326..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA8B;AAC9B,0BAA6B;AA0CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,aAAO,kCAAa,SAAS,iCAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts deleted file mode 100644 index 394c39ec53ccf4b0dc6514bda739bf962c78da44..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; -import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.js'; -import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.js'; - -declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult; -declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult; -declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult; - -export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.js b/node_modules/@tanstack/react-query/build/modern/useQuery.js deleted file mode 100644 index 6173d626004696cb4676b8ed4b3c681eabf60ac7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -// src/useQuery.ts -import { QueryObserver } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -function useQuery(options, queryClient) { - return useBaseQuery(options, QueryObserver, queryClient); -} -export { - useQuery -}; -//# sourceMappingURL=useQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useQuery.js.map deleted file mode 100644 index e64061116d972f7785ba2414ef48306b67da40d2..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA0CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,SAAO,aAAa,SAAS,eAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs deleted file mode 100644 index 1d06bb1b6e148aa89255504ba0c12d9e2fb76a42..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseInfiniteQuery.ts -var useSuspenseInfiniteQuery_exports = {}; -__export(useSuspenseInfiniteQuery_exports, { - useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery -}); -module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError - }, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseInfiniteQuery -}); -//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map deleted file mode 100644 index e51349493a9a1cb9f36a64e63dea34c1b7df6d6e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAiD;AACjD,0BAA6B;AAC7B,sBAAoC;AAc7B,SAAS,yBAOd,SAQA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts deleted file mode 100644 index 9ae1eeecddebd051ec6f8cdff3f8690dbd315f13..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.cjs'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts deleted file mode 100644 index b210055dd9e344c059fa406586c1071f6370f88b..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.js'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js deleted file mode 100644 index 7c8facf679ebcc46c01175dc34536084cff1f94a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -// src/useSuspenseInfiniteQuery.ts -import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError - }, - InfiniteQueryObserver, - queryClient - ); -} -export { - useSuspenseInfiniteQuery -}; -//# sourceMappingURL=useSuspenseInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs deleted file mode 100644 index 75f86ef030be6b622e5ae456421519d8d26b8e1d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQueries.ts -var useSuspenseQueries_exports = {}; -__export(useSuspenseQueries_exports, { - useSuspenseQueries: () => useSuspenseQueries -}); -module.exports = __toCommonJS(useSuspenseQueries_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useQueries = require("./useQueries.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQueries(options, queryClient) { - return (0, import_useQueries.useQueries)( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== "production") { - if (query.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQueries -}); -//# sourceMappingURL=useSuspenseQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map deleted file mode 100644 index 2887e829977f519af3864b83284f98bc0a15fdbf..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n } as any,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0B;AAC1B,wBAA2B;AAC3B,sBAAoC;AAiL7B,SAAS,mBAId,SAIA,aACiB;AACjB,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAU;AACtC,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,6BAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts deleted file mode 100644 index d2be29325a813bd0c228819e01a6d2e86753b183..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts +++ /dev/null @@ -1,71 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : T extends Array> ? Array> : Array; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts deleted file mode 100644 index 2b70a4dda66e816da4f0d7b574cd06b864bd1950..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : T extends Array> ? Array> : Array; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map deleted file mode 100644 index ba7575c54753fc5ac3bbc4c884f511093edd707f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n any\n >\n >\n ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results\n Array<\n UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n >\n : // Fallback\n Array\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n } as any,\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAiL7B,SAAS,mBAId,SAIA,aACiB;AACjB,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAU;AACtC,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,WAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs deleted file mode 100644 index dcf18a21c2d24adfed65c1e8598200a66573d546..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQuery.ts -var useSuspenseQuery_exports = {}; -__export(useSuspenseQuery_exports, { - useSuspenseQuery: () => useSuspenseQuery -}); -module.exports = __toCommonJS(useSuspenseQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - placeholderData: void 0 - }, - import_query_core.QueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQuery -}); -//# sourceMappingURL=useSuspenseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map deleted file mode 100644 index c4568602b8a64ac4cabe4dfb54caf9f7b58b9225..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAyC;AACzC,0BAA6B;AAC7B,sBAAoC;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts deleted file mode 100644 index b2e662eedf56ecc4e096f367a103306e57326a42..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts deleted file mode 100644 index f53bc838139f70c6ec571f0181c9a3c62f584850..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map deleted file mode 100644 index 2d961426492a38da8f5970b7ad14782d9eceae3e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;AACA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/utils.cjs b/node_modules/@tanstack/react-query/build/modern/utils.cjs deleted file mode 100644 index 6cc6bddbc3bf3d20845159abb56be3bb981ed36d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/utils.cjs +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - noop: () => noop, - shouldThrowError: () => shouldThrowError -}); -module.exports = __toCommonJS(utils_exports); -function shouldThrowError(throwError, params) { - if (typeof throwError === "function") { - return throwError(...params); - } - return !!throwError; -} -function noop() { -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - noop, - shouldThrowError -}); -//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/utils.d.cts b/node_modules/@tanstack/react-query/build/modern/utils.d.cts deleted file mode 100644 index d181e0d8f10a397db54b5760eccdb733da1a2259..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/utils.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -declare function shouldThrowError) => boolean>(throwError: boolean | T | undefined, params: Parameters): boolean; -declare function noop(): void; - -export { noop, shouldThrowError }; diff --git a/node_modules/@tanstack/react-query/build/modern/utils.d.ts b/node_modules/@tanstack/react-query/build/modern/utils.d.ts deleted file mode 100644 index d181e0d8f10a397db54b5760eccdb733da1a2259..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/modern/utils.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare function shouldThrowError) => boolean>(throwError: boolean | T | undefined, params: Parameters): boolean; -declare function noop(): void; - -export { noop, shouldThrowError }; diff --git a/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js b/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js deleted file mode 100644 index 6f7a573d45314885327e37a791675393e01bffae..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js +++ /dev/null @@ -1,18 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: { - 'cspell/spellchecker': 'off', - '@typescript-eslint/no-unnecessary-condition': 'off', - 'import/no-duplicates': 'off', - 'import/no-unresolved': 'off', - 'import/order': 'off', - 'no-shadow': 'off', - 'sort-imports': 'off', - }, - }, -] diff --git a/node_modules/@tanstack/react-query/build/query-codemods/package.json b/node_modules/@tanstack/react-query/build/query-codemods/package.json deleted file mode 100644 index 32e4f069a5f57a10254d4f6a232adc39f8dab24a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@tanstack/query-codemods", - "private": true, - "description": "Collection of codemods to make the migration easier.", - "author": "Balázs Máté Petró", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/TanStack/query.git", - "directory": "packages/query-codemods" - }, - "homepage": "https://tanstack.com/query", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "scripts": { - "test:eslint": "eslint ./src", - "test:lib": "vitest", - "test:lib:dev": "pnpm run test:lib --watch" - }, - "type": "module", - "exports": { - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "src", - "!src/jest.config.js", - "!src/**/__testfixtures__", - "!src/**/__tests__" - ], - "devDependencies": { - "@types/jscodeshift": "0.11.11", - "jscodeshift": "17.0.0" - } -} diff --git a/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json b/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json deleted file mode 100644 index cbceff3f8b6e2cfea7cc1f521b15da2eb65c1bca..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "moduleResolution": "Bundler" - }, - "include": ["src", "eslint.config.js", "vite.config.ts"] -} diff --git a/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts b/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts deleted file mode 100644 index 13f248e8ea6b26e9003f36b1fef21e2e445b5190..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'vitest/config' -import packageJson from './package.json' - -export default defineConfig({ - test: { - name: packageJson.name, - dir: './src', - watch: false, - globals: true, - coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] }, - typecheck: { enabled: true }, - restoreMocks: true, - }, -}) diff --git a/node_modules/@tanstack/react-query/package.json b/node_modules/@tanstack/react-query/package.json deleted file mode 100644 index 822a6ead845585e68f6b6b7942b72718c76cd8d5..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@tanstack/react-query", - "version": "5.60.5", - "description": "Hooks for managing, caching and syncing asynchronous and remote data in React", - "author": "tannerlinsley", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/TanStack/query.git", - "directory": "packages/react-query" - }, - "homepage": "https://tanstack.com/query", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "type": "module", - "types": "build/legacy/index.d.ts", - "main": "build/legacy/index.cjs", - "module": "build/legacy/index.js", - "exports": { - ".": { - "import": { - "types": "./build/modern/index.d.ts", - "default": "./build/modern/index.js" - }, - "require": { - "types": "./build/modern/index.d.cts", - "default": "./build/modern/index.cjs" - } - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "build", - "src", - "!src/__tests__", - "!build/codemods/node_modules", - "!build/codemods/vite.config.ts", - "!build/codemods/**/__testfixtures__", - "!build/codemods/**/__tests__" - ], - "dependencies": { - "@tanstack/query-core": "5.60.5" - }, - "devDependencies": { - "@types/react": "npm:types-react@rc", - "@types/react-dom": "npm:types-react-dom@rc", - "@vitejs/plugin-react": "^4.3.1", - "eslint-plugin-react-compiler": "0.0.0-experimental-f8a5409-20240829", - "react": "19.0.0-rc-4c2e457c7c-20240522", - "react-dom": "19.0.0-rc-4c2e457c7c-20240522", - "react-error-boundary": "^4.0.13", - "@tanstack/query-persist-client-core": "5.60.5" - }, - "peerDependencies": { - "react": "^18 || ^19" - }, - "scripts": {} -} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx b/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx deleted file mode 100644 index 407933fc5c977ece55eb25f55e1992523b6dffba..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx +++ /dev/null @@ -1,113 +0,0 @@ -/* eslint-disable react-compiler/react-compiler */ - -'use client' -import * as React from 'react' - -import { hydrate } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import type { - DehydratedState, - HydrateOptions, - OmitKeyof, - QueryClient, -} from '@tanstack/query-core' - -export interface HydrationBoundaryProps { - state?: unknown - options?: OmitKeyof & { - defaultOptions?: OmitKeyof< - Exclude, - 'mutations' - > - } - children?: React.ReactNode - queryClient?: QueryClient -} - -export const HydrationBoundary = ({ - children, - options = {}, - state, - queryClient, -}: HydrationBoundaryProps) => { - const client = useQueryClient(queryClient) - const [hydrationQueue, setHydrationQueue] = React.useState< - DehydratedState['queries'] | undefined - >() - - const optionsRef = React.useRef(options) - optionsRef.current = options - - // This useMemo is for performance reasons only, everything inside it _must_ - // be safe to run in every render and code here should be read as "in render". - // - // This code needs to happen during the render phase, because after initial - // SSR, hydration needs to happen _before_ children render. Also, if hydrating - // during a transition, we want to hydrate as much as is safe in render so - // we can prerender as much as possible. - // - // For any queries that already exist in the cache, we want to hold back on - // hydrating until _after_ the render phase. The reason for this is that during - // transitions, we don't want the existing queries and observers to update to - // the new data on the current page, only _after_ the transition is committed. - // If the transition is aborted, we will have hydrated any _new_ queries, but - // we throw away the fresh data for any existing ones to avoid unexpectedly - // updating the UI. - React.useMemo(() => { - if (state) { - if (typeof state !== 'object') { - return - } - - const queryCache = client.getQueryCache() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const queries = (state as DehydratedState).queries || [] - - const newQueries: DehydratedState['queries'] = [] - const existingQueries: DehydratedState['queries'] = [] - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash) - - if (!existingQuery) { - newQueries.push(dehydratedQuery) - } else { - const hydrationIsNewer = - dehydratedQuery.state.dataUpdatedAt > - existingQuery.state.dataUpdatedAt - const queryAlreadyQueued = hydrationQueue?.find( - (query) => query.queryHash === dehydratedQuery.queryHash, - ) - - if ( - hydrationIsNewer && - (!queryAlreadyQueued || - dehydratedQuery.state.dataUpdatedAt > - queryAlreadyQueued.state.dataUpdatedAt) - ) { - existingQueries.push(dehydratedQuery) - } - } - } - - if (newQueries.length > 0) { - // It's actually fine to call this with queries/state that already exists - // in the cache, or is older. hydrate() is idempotent for queries. - hydrate(client, { queries: newQueries }, optionsRef.current) - } - if (existingQueries.length > 0) { - setHydrationQueue((prev) => - prev ? [...prev, ...existingQueries] : existingQueries, - ) - } - } - }, [client, hydrationQueue, state]) - - React.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current) - setHydrationQueue(undefined) - } - }, [client, hydrationQueue]) - - return children as React.ReactElement -} diff --git a/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx b/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx deleted file mode 100644 index 7fa1df9798beab02db77e1f7bd63e55a11d5f09f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx +++ /dev/null @@ -1,45 +0,0 @@ -'use client' -import * as React from 'react' - -import type { QueryClient } from '@tanstack/query-core' - -export const QueryClientContext = React.createContext( - undefined, -) - -export const useQueryClient = (queryClient?: QueryClient) => { - const client = React.useContext(QueryClientContext) - - if (queryClient) { - return queryClient - } - - if (!client) { - throw new Error('No QueryClient set, use QueryClientProvider to set one') - } - - return client -} - -export type QueryClientProviderProps = { - client: QueryClient - children?: React.ReactNode -} - -export const QueryClientProvider = ({ - client, - children, -}: QueryClientProviderProps): React.JSX.Element => { - React.useEffect(() => { - client.mount() - return () => { - client.unmount() - } - }, [client]) - - return ( - - {children} - - ) -} diff --git a/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx b/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx deleted file mode 100644 index 910215bcb6d68a9a9e495c94522ce255867a08a5..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx +++ /dev/null @@ -1,56 +0,0 @@ -'use client' -import * as React from 'react' - -// CONTEXT -export type QueryErrorResetFunction = () => void -export type QueryErrorIsResetFunction = () => boolean -export type QueryErrorClearResetFunction = () => void - -export interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction - isReset: QueryErrorIsResetFunction - reset: QueryErrorResetFunction -} - -function createValue(): QueryErrorResetBoundaryValue { - let isReset = false - return { - clearReset: () => { - isReset = false - }, - reset: () => { - isReset = true - }, - isReset: () => { - return isReset - }, - } -} - -const QueryErrorResetBoundaryContext = React.createContext(createValue()) - -// HOOK - -export const useQueryErrorResetBoundary = () => - React.useContext(QueryErrorResetBoundaryContext) - -// COMPONENT - -export type QueryErrorResetBoundaryFunction = ( - value: QueryErrorResetBoundaryValue, -) => React.ReactNode - -export interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode -} - -export const QueryErrorResetBoundary = ({ - children, -}: QueryErrorResetBoundaryProps) => { - const [value] = React.useState(() => createValue()) - return ( - - {typeof children === 'function' ? children(value) : children} - - ) -} diff --git a/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts b/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts deleted file mode 100644 index 3e0d036066615d3b79d17fbd6a8fdc584c528266..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts +++ /dev/null @@ -1,73 +0,0 @@ -'use client' -import * as React from 'react' -import { shouldThrowError } from './utils' -import type { - DefaultedQueryObserverOptions, - Query, - QueryKey, - QueryObserverResult, - ThrowOnError, -} from '@tanstack/query-core' -import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary' - -export const ensurePreventErrorBoundaryRetry = < - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey extends QueryKey, ->( - options: DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - errorResetBoundary: QueryErrorResetBoundaryValue, -) => { - if ( - options.suspense || - options.throwOnError || - options.experimental_prefetchInRender - ) { - // Prevent retrying failed query if the error boundary has not been reset yet - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false - } - } -} - -export const useClearResetErrorBoundary = ( - errorResetBoundary: QueryErrorResetBoundaryValue, -) => { - React.useEffect(() => { - errorResetBoundary.clearReset() - }, [errorResetBoundary]) -} - -export const getHasError = < - TData, - TError, - TQueryFnData, - TQueryData, - TQueryKey extends QueryKey, ->({ - result, - errorResetBoundary, - throwOnError, - query, -}: { - result: QueryObserverResult - errorResetBoundary: QueryErrorResetBoundaryValue - throwOnError: ThrowOnError - query: Query | undefined -}) => { - return ( - result.isError && - !errorResetBoundary.isReset() && - !result.isFetching && - query && - shouldThrowError(throwOnError, [result.error, query]) - ) -} diff --git a/node_modules/@tanstack/react-query/src/index.ts b/node_modules/@tanstack/react-query/src/index.ts deleted file mode 100644 index 5f372f4195e60731566d8a3aab442ed66c0d3e69..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* istanbul ignore file */ - -// Re-export core -export * from '@tanstack/query-core' - -// React Query -export * from './types' -export { useQueries } from './useQueries' -export type { QueriesResults, QueriesOptions } from './useQueries' -export { useQuery } from './useQuery' -export { useSuspenseQuery } from './useSuspenseQuery' -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery' -export { useSuspenseQueries } from './useSuspenseQueries' -export type { - SuspenseQueriesResults, - SuspenseQueriesOptions, -} from './useSuspenseQueries' -export { usePrefetchQuery } from './usePrefetchQuery' -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery' -export { queryOptions } from './queryOptions' -export type { - DefinedInitialDataOptions, - UndefinedInitialDataOptions, - UnusedSkipTokenOptions, -} from './queryOptions' -export { infiniteQueryOptions } from './infiniteQueryOptions' -export type { - DefinedInitialDataInfiniteOptions, - UndefinedInitialDataInfiniteOptions, - UnusedSkipTokenInfiniteOptions, -} from './infiniteQueryOptions' -export { - QueryClientContext, - QueryClientProvider, - useQueryClient, -} from './QueryClientProvider' -export type { QueryClientProviderProps } from './QueryClientProvider' -export type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary' -export { HydrationBoundary } from './HydrationBoundary' -export type { HydrationBoundaryProps } from './HydrationBoundary' -export type { - QueryErrorClearResetFunction, - QueryErrorIsResetFunction, - QueryErrorResetBoundaryFunction, - QueryErrorResetFunction, -} from './QueryErrorResetBoundary' -export { - QueryErrorResetBoundary, - useQueryErrorResetBoundary, -} from './QueryErrorResetBoundary' -export { useIsFetching } from './useIsFetching' -export { useIsMutating, useMutationState } from './useMutationState' -export { useMutation } from './useMutation' -export { useInfiniteQuery } from './useInfiniteQuery' -export { useIsRestoring, IsRestoringProvider } from './isRestoring' diff --git a/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts b/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts deleted file mode 100644 index 594c4217e2a198c0819ac78de633a4c88538ed0d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts +++ /dev/null @@ -1,160 +0,0 @@ -import type { - DataTag, - DefaultError, - InfiniteData, - InitialDataFunction, - OmitKeyof, - QueryKey, - SkipToken, -} from '@tanstack/query-core' -import type { UseInfiniteQueryOptions } from './types' - -export type UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryFnData, - TQueryKey, - TPageParam -> & { - initialData?: - | undefined - | NonUndefinedGuard> - | InitialDataFunction< - NonUndefinedGuard> - > -} - -export type UnusedSkipTokenInfiniteOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = OmitKeyof< - UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryFnData, - TQueryKey, - TPageParam - >, - 'queryFn' -> & { - queryFn?: Exclude< - UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryFnData, - TQueryKey, - TPageParam - >['queryFn'], - SkipToken | undefined - > -} - -type NonUndefinedGuard = T extends undefined ? never : T - -export type DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryFnData, - TQueryKey, - TPageParam -> & { - initialData: - | NonUndefinedGuard> - | (() => NonUndefinedGuard>) - | undefined -} - -export function infiniteQueryOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, -): DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - queryKey: DataTag> -} - -export function infiniteQueryOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UnusedSkipTokenInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, -): UnusedSkipTokenInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - queryKey: DataTag> -} - -export function infiniteQueryOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, -): UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - queryKey: DataTag> -} - -export function infiniteQueryOptions(options: unknown) { - return options -} diff --git a/node_modules/@tanstack/react-query/src/isRestoring.ts b/node_modules/@tanstack/react-query/src/isRestoring.ts deleted file mode 100644 index 7d59c72507524014f208c30f06441aecf42c29c3..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/isRestoring.ts +++ /dev/null @@ -1,7 +0,0 @@ -'use client' -import * as React from 'react' - -const IsRestoringContext = React.createContext(false) - -export const useIsRestoring = () => React.useContext(IsRestoringContext) -export const IsRestoringProvider = IsRestoringContext.Provider diff --git a/node_modules/@tanstack/react-query/src/queryOptions.ts b/node_modules/@tanstack/react-query/src/queryOptions.ts deleted file mode 100644 index f07020791b046034300e00a2e3c4b13439ed3831..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/queryOptions.ts +++ /dev/null @@ -1,86 +0,0 @@ -import type { - DataTag, - DefaultError, - InitialDataFunction, - OmitKeyof, - QueryKey, - SkipToken, -} from '@tanstack/query-core' -import type { UseQueryOptions } from './types' - -export type UndefinedInitialDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = UseQueryOptions & { - initialData?: - | undefined - | InitialDataFunction> - | NonUndefinedGuard -} - -export type UnusedSkipTokenOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = OmitKeyof< - UseQueryOptions, - 'queryFn' -> & { - queryFn?: Exclude< - UseQueryOptions['queryFn'], - SkipToken | undefined - > -} - -type NonUndefinedGuard = T extends undefined ? never : T - -export type DefinedInitialDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = UseQueryOptions & { - initialData: - | NonUndefinedGuard - | (() => NonUndefinedGuard) -} - -export function queryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: DefinedInitialDataOptions, -): DefinedInitialDataOptions & { - queryKey: DataTag -} - -export function queryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UnusedSkipTokenOptions, -): UnusedSkipTokenOptions & { - queryKey: DataTag -} - -export function queryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UndefinedInitialDataOptions, -): UndefinedInitialDataOptions & { - queryKey: DataTag -} - -export function queryOptions(options: unknown) { - return options -} diff --git a/node_modules/@tanstack/react-query/src/suspense.ts b/node_modules/@tanstack/react-query/src/suspense.ts deleted file mode 100644 index 497bb83bd8e8394582d992ed362a9a6a07807177..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/suspense.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { - DefaultError, - DefaultedQueryObserverOptions, - Query, - QueryKey, - QueryObserver, - QueryObserverResult, -} from '@tanstack/query-core' -import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary' - -export const defaultThrowOnError = < - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - _error: TError, - query: Query, -) => query.state.data === undefined - -export const ensureSuspenseTimers = ( - defaultedOptions: DefaultedQueryObserverOptions, -) => { - if (defaultedOptions.suspense) { - // Always set stale time when using suspense to prevent - // fetching again when directly mounting after suspending - if (defaultedOptions.staleTime === undefined) { - defaultedOptions.staleTime = 1000 - } - if (typeof defaultedOptions.gcTime === 'number') { - defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1000) - } - } -} - -export const willFetch = ( - result: QueryObserverResult, - isRestoring: boolean, -) => result.isLoading && result.isFetching && !isRestoring - -export const shouldSuspend = ( - defaultedOptions: - | DefaultedQueryObserverOptions - | undefined, - result: QueryObserverResult, -) => defaultedOptions?.suspense && result.isPending - -export const fetchOptimistic = < - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey extends QueryKey, ->( - defaultedOptions: DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - observer: QueryObserver, - errorResetBoundary: QueryErrorResetBoundaryValue, -) => - observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset() - }) diff --git a/node_modules/@tanstack/react-query/src/types.ts b/node_modules/@tanstack/react-query/src/types.ts deleted file mode 100644 index 85165363619851dae8cbcb40563137ddd410dc9a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/types.ts +++ /dev/null @@ -1,191 +0,0 @@ -/* istanbul ignore file */ - -import type { - DefaultError, - DefinedInfiniteQueryObserverResult, - DefinedQueryObserverResult, - InfiniteQueryObserverOptions, - InfiniteQueryObserverResult, - MutateFunction, - MutationObserverOptions, - MutationObserverResult, - OmitKeyof, - Override, - QueryKey, - QueryObserverOptions, - QueryObserverResult, - SkipToken, -} from '@tanstack/query-core' - -export interface UseBaseQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > {} - -export interface UseQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends OmitKeyof< - UseBaseQueryOptions, - 'suspense' - > {} - -export interface UseSuspenseQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends OmitKeyof< - UseQueryOptions, - 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' - > { - queryFn?: Exclude< - UseQueryOptions['queryFn'], - SkipToken - > -} - -export interface UseInfiniteQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends OmitKeyof< - InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - 'suspense' - > {} - -export interface UseSuspenseInfiniteQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends OmitKeyof< - UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >, - 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' - > { - queryFn?: Exclude< - UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - >['queryFn'], - SkipToken - > -} - -export type UseBaseQueryResult< - TData = unknown, - TError = DefaultError, -> = QueryObserverResult - -export type UseQueryResult< - TData = unknown, - TError = DefaultError, -> = UseBaseQueryResult - -export type UseSuspenseQueryResult< - TData = unknown, - TError = DefaultError, -> = OmitKeyof< - DefinedQueryObserverResult, - 'isPlaceholderData' | 'promise' -> - -export type DefinedUseQueryResult< - TData = unknown, - TError = DefaultError, -> = DefinedQueryObserverResult - -export type UseInfiniteQueryResult< - TData = unknown, - TError = DefaultError, -> = InfiniteQueryObserverResult - -export type DefinedUseInfiniteQueryResult< - TData = unknown, - TError = DefaultError, -> = DefinedInfiniteQueryObserverResult - -export type UseSuspenseInfiniteQueryResult< - TData = unknown, - TError = DefaultError, -> = OmitKeyof< - DefinedInfiniteQueryObserverResult, - 'isPlaceholderData' | 'promise' -> - -export interface UseMutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> extends OmitKeyof< - MutationObserverOptions, - '_defaulted' - > {} - -export type UseMutateFunction< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> = ( - ...args: Parameters> -) => void - -export type UseMutateAsyncFunction< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, -> = MutateFunction - -export type UseBaseMutationResult< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TContext = unknown, -> = Override< - MutationObserverResult, - { mutate: UseMutateFunction } -> & { mutateAsync: UseMutateAsyncFunction } - -export type UseMutationResult< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TContext = unknown, -> = UseBaseMutationResult diff --git a/node_modules/@tanstack/react-query/src/useBaseQuery.ts b/node_modules/@tanstack/react-query/src/useBaseQuery.ts deleted file mode 100644 index bcbf700ef73cd0b74753b4efa0532de77976d891..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useBaseQuery.ts +++ /dev/null @@ -1,162 +0,0 @@ -'use client' -import * as React from 'react' - -import { isServer, notifyManager } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary' -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary, -} from './errorBoundaryUtils' -import { useIsRestoring } from './isRestoring' -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch, -} from './suspense' -import { noop } from './utils' -import type { - QueryClient, - QueryKey, - QueryObserver, - QueryObserverResult, -} from '@tanstack/query-core' -import type { UseBaseQueryOptions } from './types' - -export function useBaseQuery< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey extends QueryKey, ->( - options: UseBaseQueryOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - Observer: typeof QueryObserver, - queryClient?: QueryClient, -): QueryObserverResult { - if (process.env.NODE_ENV !== 'production') { - if (typeof options !== 'object' || Array.isArray(options)) { - throw new Error( - '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', - ) - } - } - - const client = useQueryClient(queryClient) - const isRestoring = useIsRestoring() - const errorResetBoundary = useQueryErrorResetBoundary() - const defaultedOptions = client.defaultQueryOptions(options) - - ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.( - defaultedOptions, - ) - - // Make sure results are optimistically set in fetching state before subscribing or updating options - defaultedOptions._optimisticResults = isRestoring - ? 'isRestoring' - : 'optimistic' - - ensureSuspenseTimers(defaultedOptions) - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary) - - useClearResetErrorBoundary(errorResetBoundary) - - // this needs to be invoked before creating the Observer because that can create a cache entry - const isNewCacheEntry = !client - .getQueryCache() - .get(defaultedOptions.queryHash) - - const [observer] = React.useState( - () => - new Observer( - client, - defaultedOptions, - ), - ) - - const result = observer.getOptimisticResult(defaultedOptions) - - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = isRestoring - ? noop - : observer.subscribe(notifyManager.batchCalls(onStoreChange)) - - // Update result to make sure we did not miss any query updates - // between creating the observer and subscribing to it. - observer.updateResult() - - return unsubscribe - }, - [observer, isRestoring], - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult(), - ) - - React.useEffect(() => { - // Do not notify on updates because of changes in the options because - // these changes should already be reflected in the optimistic result. - observer.setOptions(defaultedOptions, { listeners: false }) - }, [defaultedOptions, observer]) - - // Handle suspense - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - } - - // Handle error boundary - if ( - getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query: client - .getQueryCache() - .get< - TQueryFnData, - TError, - TQueryData, - TQueryKey - >(defaultedOptions.queryHash), - }) - ) { - throw result.error - } - - ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.( - defaultedOptions, - result, - ) - - if ( - defaultedOptions.experimental_prefetchInRender && - !isServer && - willFetch(result, isRestoring) - ) { - const promise = isNewCacheEntry - ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - : // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - client.getQueryCache().get(defaultedOptions.queryHash)?.promise - - promise?.catch(noop).finally(() => { - // `.updateResult()` will trigger `.#currentThenable` to finalize - observer.updateResult() - }) - } - - // Handle result property usage tracking - return !defaultedOptions.notifyOnChangeProps - ? observer.trackResult(result) - : result -} diff --git a/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts b/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts deleted file mode 100644 index fd2ce11a7f23118da980ac66c654006572f41455..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts +++ /dev/null @@ -1,82 +0,0 @@ -'use client' -import { InfiniteQueryObserver } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import type { - DefaultError, - InfiniteData, - QueryClient, - QueryKey, - QueryObserver, -} from '@tanstack/query-core' -import type { - DefinedUseInfiniteQueryResult, - UseInfiniteQueryOptions, - UseInfiniteQueryResult, -} from './types' -import type { - DefinedInitialDataInfiniteOptions, - UndefinedInitialDataInfiniteOptions, -} from './infiniteQueryOptions' - -export function useInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): DefinedUseInfiniteQueryResult - -export function useInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): UseInfiniteQueryResult - -export function useInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryFnData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): UseInfiniteQueryResult - -export function useInfiniteQuery( - options: UseInfiniteQueryOptions, - queryClient?: QueryClient, -) { - return useBaseQuery( - options, - InfiniteQueryObserver as typeof QueryObserver, - queryClient, - ) -} diff --git a/node_modules/@tanstack/react-query/src/useIsFetching.ts b/node_modules/@tanstack/react-query/src/useIsFetching.ts deleted file mode 100644 index a6252912f22e0504e3212bd1aee683b4930db771..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useIsFetching.ts +++ /dev/null @@ -1,24 +0,0 @@ -'use client' -import * as React from 'react' -import { notifyManager } from '@tanstack/query-core' - -import { useQueryClient } from './QueryClientProvider' -import type { QueryClient, QueryFilters } from '@tanstack/query-core' - -export function useIsFetching( - filters?: QueryFilters, - queryClient?: QueryClient, -): number { - const client = useQueryClient(queryClient) - const queryCache = client.getQueryCache() - - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), - [queryCache], - ), - () => client.isFetching(filters), - () => client.isFetching(filters), - ) -} diff --git a/node_modules/@tanstack/react-query/src/useMutation.ts b/node_modules/@tanstack/react-query/src/useMutation.ts deleted file mode 100644 index 34edd450a2660473396e0c5acd1e3d550c34c43a..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useMutation.ts +++ /dev/null @@ -1,65 +0,0 @@ -'use client' -import * as React from 'react' -import { MutationObserver, notifyManager } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import { noop, shouldThrowError } from './utils' -import type { - UseMutateFunction, - UseMutationOptions, - UseMutationResult, -} from './types' -import type { DefaultError, QueryClient } from '@tanstack/query-core' - -// HOOK - -export function useMutation< - TData = unknown, - TError = DefaultError, - TVariables = void, - TContext = unknown, ->( - options: UseMutationOptions, - queryClient?: QueryClient, -): UseMutationResult { - const client = useQueryClient(queryClient) - - const [observer] = React.useState( - () => - new MutationObserver( - client, - options, - ), - ) - - React.useEffect(() => { - observer.setOptions(options) - }, [observer, options]) - - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer], - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult(), - ) - - const mutate = React.useCallback< - UseMutateFunction - >( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop) - }, - [observer], - ) - - if ( - result.error && - shouldThrowError(observer.options.throwOnError, [result.error]) - ) { - throw result.error - } - - return { ...result, mutate, mutateAsync: result.mutate } -} diff --git a/node_modules/@tanstack/react-query/src/useMutationState.ts b/node_modules/@tanstack/react-query/src/useMutationState.ts deleted file mode 100644 index d962bf085d9dc30ba75fcc8fa6dde4e402fa41e7..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useMutationState.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable react-compiler/react-compiler */ - -'use client' -import * as React from 'react' - -import { notifyManager, replaceEqualDeep } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import type { - Mutation, - MutationCache, - MutationFilters, - MutationState, - QueryClient, -} from '@tanstack/query-core' - -export function useIsMutating( - filters?: MutationFilters, - queryClient?: QueryClient, -): number { - const client = useQueryClient(queryClient) - return useMutationState( - { filters: { ...filters, status: 'pending' } }, - client, - ).length -} - -type MutationStateOptions = { - filters?: MutationFilters - select?: (mutation: Mutation) => TResult -} - -function getResult( - mutationCache: MutationCache, - options: MutationStateOptions, -): Array { - return mutationCache - .findAll(options.filters) - .map( - (mutation): TResult => - (options.select ? options.select(mutation) : mutation.state) as TResult, - ) -} - -export function useMutationState( - options: MutationStateOptions = {}, - queryClient?: QueryClient, -): Array { - const mutationCache = useQueryClient(queryClient).getMutationCache() - const optionsRef = React.useRef(options) - const result = React.useRef>(null) - if (!result.current) { - result.current = getResult(mutationCache, options) - } - - React.useEffect(() => { - optionsRef.current = options - }) - - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current), - ) - if (result.current !== nextResult) { - result.current = nextResult - notifyManager.schedule(onStoreChange) - } - }), - [mutationCache], - ), - () => result.current, - () => result.current, - )! -} diff --git a/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx b/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx deleted file mode 100644 index 08c2fcdfa3e4a8ed508a433f758f0bf2e2066e8e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { useQueryClient } from './QueryClientProvider' -import type { - DefaultError, - FetchInfiniteQueryOptions, - QueryClient, - QueryKey, -} from '@tanstack/query-core' - -export function usePrefetchInfiniteQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -) { - const client = useQueryClient(queryClient) - - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options) - } -} diff --git a/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx b/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx deleted file mode 100644 index 54c4cc649999997fc8b1c568c4959d435a4dd25e..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { useQueryClient } from './QueryClientProvider' -import type { - DefaultError, - FetchQueryOptions, - QueryClient, - QueryKey, -} from '@tanstack/query-core' - -export function usePrefetchQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: FetchQueryOptions, - queryClient?: QueryClient, -) { - const client = useQueryClient(queryClient) - - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options) - } -} diff --git a/node_modules/@tanstack/react-query/src/useQueries.ts b/node_modules/@tanstack/react-query/src/useQueries.ts deleted file mode 100644 index 90ef2e32ad0d2267b2f3266cc5dc078ff9786e3f..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useQueries.ts +++ /dev/null @@ -1,347 +0,0 @@ -'use client' -import * as React from 'react' - -import { - QueriesObserver, - QueryObserver, - notifyManager, -} from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import { useIsRestoring } from './isRestoring' -import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary' -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary, -} from './errorBoundaryUtils' -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch, -} from './suspense' -import { noop } from './utils' -import type { - DefinedUseQueryResult, - UseQueryOptions, - UseQueryResult, -} from './types' -import type { - DefaultError, - OmitKeyof, - QueriesObserverOptions, - QueriesPlaceholderDataFunction, - QueryClient, - QueryFunction, - QueryKey, - QueryObserverOptions, - ThrowOnError, -} from '@tanstack/query-core' - -// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`. -// `placeholderData` function always gets undefined passed -type UseQueryOptionsForUseQueries< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = OmitKeyof< - UseQueryOptions, - 'placeholderData' -> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction -} - -// Avoid TS depth-limit error in case of large array literal -type MAXIMUM_DEPTH = 20 - -// Widen the type of the symbol to enable type inference even if skipToken is not immutable. -type SkipTokenForUseQueries = symbol - -type GetUseQueryOptionsForUseQueries = - // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData } - T extends { - queryFnData: infer TQueryFnData - error?: infer TError - data: infer TData - } - ? UseQueryOptionsForUseQueries - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? UseQueryOptionsForUseQueries - : T extends { data: infer TData; error?: infer TError } - ? UseQueryOptionsForUseQueries - : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData] - T extends [infer TQueryFnData, infer TError, infer TData] - ? UseQueryOptionsForUseQueries - : T extends [infer TQueryFnData, infer TError] - ? UseQueryOptionsForUseQueries - : T extends [infer TQueryFnData] - ? UseQueryOptionsForUseQueries - : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? UseQueryOptionsForUseQueries< - TQueryFnData, - unknown extends TError ? DefaultError : TError, - unknown extends TData ? TQueryFnData : TData, - TQueryKey - > - : // Fallback - UseQueryOptionsForUseQueries - -// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData -} - ? unknown extends TInitialData - ? UseQueryResult - : TInitialData extends TData - ? DefinedUseQueryResult - : TInitialData extends () => infer TInitialDataResult - ? unknown extends TInitialDataResult - ? UseQueryResult - : TInitialDataResult extends TData - ? DefinedUseQueryResult - : UseQueryResult - : UseQueryResult - : UseQueryResult - -type GetUseQueryResult = - // Part 1: responsible for mapping explicit type parameter to function result, if object - T extends { queryFnData: any; error?: infer TError; data: infer TData } - ? GetDefinedOrUndefinedQueryResult - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? GetDefinedOrUndefinedQueryResult - : T extends { data: infer TData; error?: infer TError } - ? GetDefinedOrUndefinedQueryResult - : // Part 2: responsible for mapping explicit type parameter to function result, if tuple - T extends [any, infer TError, infer TData] - ? GetDefinedOrUndefinedQueryResult - : T extends [infer TQueryFnData, infer TError] - ? GetDefinedOrUndefinedQueryResult - : T extends [infer TQueryFnData] - ? GetDefinedOrUndefinedQueryResult - : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? GetDefinedOrUndefinedQueryResult< - T, - unknown extends TData ? TQueryFnData : TData, - unknown extends TError ? DefaultError : TError - > - : // Fallback - UseQueryResult - -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -export type QueriesOptions< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseQueryOptionsForUseQueries] - : T extends [infer Head, ...infer Tails] - ? QueriesOptions< - [...Tails], - [...TResults, GetUseQueryOptionsForUseQueries], - [...TDepth, 1] - > - : ReadonlyArray extends T - ? T - : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type! - // use this to infer the param types in the case of Array.map() argument - T extends Array< - UseQueryOptionsForUseQueries< - infer TQueryFnData, - infer TError, - infer TData, - infer TQueryKey - > - > - ? Array< - UseQueryOptionsForUseQueries< - TQueryFnData, - TError, - TData, - TQueryKey - > - > - : // Fallback - Array - -/** - * QueriesResults reducer recursively maps type param to results - */ -export type QueriesResults< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseQueryResult] - : T extends [infer Head, ...infer Tails] - ? QueriesResults< - [...Tails], - [...TResults, GetUseQueryResult], - [...TDepth, 1] - > - : T extends Array< - UseQueryOptionsForUseQueries< - infer TQueryFnData, - infer TError, - infer TData, - any - > - > - ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results - Array< - UseQueryResult< - unknown extends TData ? TQueryFnData : TData, - unknown extends TError ? DefaultError : TError - > - > - : // Fallback - Array - -export function useQueries< - T extends Array, - TCombinedResult = QueriesResults, ->( - { - queries, - ...options - }: { - queries: readonly [...QueriesOptions] - combine?: (result: QueriesResults) => TCombinedResult - }, - queryClient?: QueryClient, -): TCombinedResult { - const client = useQueryClient(queryClient) - const isRestoring = useIsRestoring() - const errorResetBoundary = useQueryErrorResetBoundary() - - const defaultedQueries = React.useMemo( - () => - queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts as QueryObserverOptions, - ) - - // Make sure the results are already in fetching state before subscribing or updating options - defaultedOptions._optimisticResults = isRestoring - ? 'isRestoring' - : 'optimistic' - - return defaultedOptions - }), - [queries, client, isRestoring], - ) - - defaultedQueries.forEach((query) => { - ensureSuspenseTimers(query) - ensurePreventErrorBoundaryRetry(query, errorResetBoundary) - }) - - useClearResetErrorBoundary(errorResetBoundary) - - const [observer] = React.useState( - () => - new QueriesObserver( - client, - defaultedQueries, - options as QueriesObserverOptions, - ), - ) - - const [optimisticResult, getCombinedResult, trackResult] = - observer.getOptimisticResult( - defaultedQueries, - (options as QueriesObserverOptions).combine, - ) - - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - isRestoring - ? noop - : observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer, isRestoring], - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult(), - ) - - React.useEffect(() => { - // Do not notify on updates because of changes in the options because - // these changes should already be reflected in the optimistic result. - observer.setQueries( - defaultedQueries, - options as QueriesObserverOptions, - { - listeners: false, - }, - ) - }, [defaultedQueries, options, observer]) - - const shouldAtLeastOneSuspend = optimisticResult.some((result, index) => - shouldSuspend(defaultedQueries[index], result), - ) - - const suspensePromises = shouldAtLeastOneSuspend - ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index] - - if (opts) { - const queryObserver = new QueryObserver(client, opts) - if (shouldSuspend(opts, result)) { - return fetchOptimistic(opts, queryObserver, errorResetBoundary) - } else if (willFetch(result, isRestoring)) { - void fetchOptimistic(opts, queryObserver, errorResetBoundary) - } - } - return [] - }) - : [] - - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises) - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index] - return ( - query && - getHasError({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - }) - ) - }, - ) - - if (firstSingleResultWhichShouldThrow?.error) { - throw firstSingleResultWhichShouldThrow.error - } - - return getCombinedResult(trackResult()) -} diff --git a/node_modules/@tanstack/react-query/src/useQuery.ts b/node_modules/@tanstack/react-query/src/useQuery.ts deleted file mode 100644 index 962ef4da66b553e8de0889455f00831bac089c8c..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useQuery.ts +++ /dev/null @@ -1,47 +0,0 @@ -'use client' -import { QueryObserver } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' -import type { - DefinedUseQueryResult, - UseQueryOptions, - UseQueryResult, -} from './types' -import type { - DefinedInitialDataOptions, - UndefinedInitialDataOptions, -} from './queryOptions' - -export function useQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: DefinedInitialDataOptions, - queryClient?: QueryClient, -): DefinedUseQueryResult - -export function useQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UndefinedInitialDataOptions, - queryClient?: QueryClient, -): UseQueryResult - -export function useQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UseQueryOptions, - queryClient?: QueryClient, -): UseQueryResult - -export function useQuery(options: UseQueryOptions, queryClient?: QueryClient) { - return useBaseQuery(options, QueryObserver, queryClient) -} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts b/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts deleted file mode 100644 index 916e89265a17a681158bfe9c245926fad151f6f6..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts +++ /dev/null @@ -1,51 +0,0 @@ -'use client' -import { InfiniteQueryObserver, skipToken } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import { defaultThrowOnError } from './suspense' -import type { - DefaultError, - InfiniteData, - InfiniteQueryObserverSuccessResult, - QueryClient, - QueryKey, - QueryObserver, -} from '@tanstack/query-core' -import type { - UseSuspenseInfiniteQueryOptions, - UseSuspenseInfiniteQueryResult, -} from './types' - -export function useSuspenseInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UseSuspenseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryFnData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): UseSuspenseInfiniteQueryResult { - if (process.env.NODE_ENV !== 'production') { - if ((options.queryFn as any) === skipToken) { - console.error('skipToken is not allowed for useSuspenseInfiniteQuery') - } - } - - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - }, - InfiniteQueryObserver as typeof QueryObserver, - queryClient, - ) as InfiniteQueryObserverSuccessResult -} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts b/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts deleted file mode 100644 index 790e72e12a14792a605950553ccdd394bc840214..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts +++ /dev/null @@ -1,212 +0,0 @@ -'use client' -import { skipToken } from '@tanstack/query-core' -import { useQueries } from './useQueries' -import { defaultThrowOnError } from './suspense' -import type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types' -import type { - DefaultError, - QueryClient, - QueryFunction, - ThrowOnError, -} from '@tanstack/query-core' - -// Avoid TS depth-limit error in case of large array literal -type MAXIMUM_DEPTH = 20 - -// Widen the type of the symbol to enable type inference even if skipToken is not immutable. -type SkipTokenForUseQueries = symbol - -type GetUseSuspenseQueryOptions = - // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData } - T extends { - queryFnData: infer TQueryFnData - error?: infer TError - data: infer TData - } - ? UseSuspenseQueryOptions - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? UseSuspenseQueryOptions - : T extends { data: infer TData; error?: infer TError } - ? UseSuspenseQueryOptions - : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData] - T extends [infer TQueryFnData, infer TError, infer TData] - ? UseSuspenseQueryOptions - : T extends [infer TQueryFnData, infer TError] - ? UseSuspenseQueryOptions - : T extends [infer TQueryFnData] - ? UseSuspenseQueryOptions - : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey - > - : T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryOptions< - TQueryFnData, - TError, - TQueryFnData, - TQueryKey - > - : // Fallback - UseSuspenseQueryOptions - -type GetUseSuspenseQueryResult = - // Part 1: responsible for mapping explicit type parameter to function result, if object - T extends { queryFnData: any; error?: infer TError; data: infer TData } - ? UseSuspenseQueryResult - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? UseSuspenseQueryResult - : T extends { data: infer TData; error?: infer TError } - ? UseSuspenseQueryResult - : // Part 2: responsible for mapping explicit type parameter to function result, if tuple - T extends [any, infer TError, infer TData] - ? UseSuspenseQueryResult - : T extends [infer TQueryFnData, infer TError] - ? UseSuspenseQueryResult - : T extends [infer TQueryFnData] - ? UseSuspenseQueryResult - : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryResult< - unknown extends TData ? TQueryFnData : TData, - unknown extends TError ? DefaultError : TError - > - : T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryResult< - TQueryFnData, - unknown extends TError ? DefaultError : TError - > - : // Fallback - UseSuspenseQueryResult - -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -export type SuspenseQueriesOptions< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseSuspenseQueryOptions] - : T extends [infer Head, ...infer Tails] - ? SuspenseQueriesOptions< - [...Tails], - [...TResults, GetUseSuspenseQueryOptions], - [...TDepth, 1] - > - : Array extends T - ? T - : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type! - // use this to infer the param types in the case of Array.map() argument - T extends Array< - UseSuspenseQueryOptions< - infer TQueryFnData, - infer TError, - infer TData, - infer TQueryKey - > - > - ? Array< - UseSuspenseQueryOptions - > - : // Fallback - Array - -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -export type SuspenseQueriesResults< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseSuspenseQueryResult] - : T extends [infer Head, ...infer Tails] - ? SuspenseQueriesResults< - [...Tails], - [...TResults, GetUseSuspenseQueryResult], - [...TDepth, 1] - > - : T extends Array< - UseSuspenseQueryOptions< - infer TQueryFnData, - infer TError, - infer TData, - any - > - > - ? // Dynamic-size (homogenous) UseQueryOptions array: map directly to array of results - Array< - UseSuspenseQueryResult< - unknown extends TData ? TQueryFnData : TData, - unknown extends TError ? DefaultError : TError - > - > - : // Fallback - Array - -export function useSuspenseQueries< - T extends Array, - TCombinedResult = SuspenseQueriesResults, ->( - options: { - queries: readonly [...SuspenseQueriesOptions] - combine?: (result: SuspenseQueriesResults) => TCombinedResult - }, - queryClient?: QueryClient, -): TCombinedResult { - return useQueries( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== 'production') { - if (query.queryFn === skipToken) { - console.error('skipToken is not allowed for useSuspenseQueries') - } - } - - return { - ...query, - suspense: true, - throwOnError: defaultThrowOnError, - enabled: true, - placeholderData: undefined, - } - }), - } as any, - queryClient, - ) -} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts b/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts deleted file mode 100644 index 7dfdb0647782e0b63f42322893bf7a251f0dae8d..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts +++ /dev/null @@ -1,34 +0,0 @@ -'use client' -import { QueryObserver, skipToken } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import { defaultThrowOnError } from './suspense' -import type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types' -import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' - -export function useSuspenseQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UseSuspenseQueryOptions, - queryClient?: QueryClient, -): UseSuspenseQueryResult { - if (process.env.NODE_ENV !== 'production') { - if ((options.queryFn as any) === skipToken) { - console.error('skipToken is not allowed for useSuspenseQuery') - } - } - - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - placeholderData: undefined, - }, - QueryObserver, - queryClient, - ) as UseSuspenseQueryResult -} diff --git a/node_modules/@tanstack/react-query/src/utils.ts b/node_modules/@tanstack/react-query/src/utils.ts deleted file mode 100644 index 9647e965e038a754aa76c706077cb6372708c490..0000000000000000000000000000000000000000 --- a/node_modules/@tanstack/react-query/src/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function shouldThrowError) => boolean>( - throwError: boolean | T | undefined, - params: Parameters, -): boolean { - // Allow throwError function to override throwing behavior on a per-error basis - if (typeof throwError === 'function') { - return throwError(...params) - } - - return !!throwError -} - -export function noop(): void {} diff --git a/node_modules/@types/babel__core/LICENSE b/node_modules/@types/babel__core/LICENSE deleted file mode 100644 index 9e841e7a26e4eb057b24511e7b92d42b257a80e5..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/babel__core/README.md b/node_modules/@types/babel__core/README.md deleted file mode 100644 index 5121fc3acc64a867d44ff4478429df761d119c97..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__core/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/babel__core` - -# Summary -This package contains type definitions for @babel/core (https://github.com/babel/babel/tree/master/packages/babel-core). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core. - -### Additional Details - * Last updated: Mon, 20 Nov 2023 23:36:23 GMT - * Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types), [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse) - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), [Jessica Franco](https://github.com/Jessidhia), and [Ifiok Jr.](https://github.com/ifiokjr). diff --git a/node_modules/@types/babel__core/index.d.ts b/node_modules/@types/babel__core/index.d.ts deleted file mode 100644 index 48dc0500c5c387adef8c088f059f3bde89776d87..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__core/index.d.ts +++ /dev/null @@ -1,831 +0,0 @@ -import { GeneratorOptions } from "@babel/generator"; -import { ParserOptions } from "@babel/parser"; -import template from "@babel/template"; -import traverse, { Hub, NodePath, Scope, Visitor } from "@babel/traverse"; -import * as t from "@babel/types"; - -export { GeneratorOptions, NodePath, ParserOptions, t as types, template, traverse, Visitor }; - -export type Node = t.Node; -export type ParseResult = ReturnType; -export const version: string; -export const DEFAULT_EXTENSIONS: [".js", ".jsx", ".es6", ".es", ".mjs"]; - -/** - * Source map standard format as to revision 3 - * @see {@link https://sourcemaps.info/spec.html} - * @see {@link https://github.com/mozilla/source-map/blob/HEAD/source-map.d.ts} - */ -interface InputSourceMap { - version: number; - sources: string[]; - names: string[]; - sourceRoot?: string | undefined; - sourcesContent?: string[] | undefined; - mappings: string; - file: string; -} - -export interface TransformOptions { - /** - * Specify which assumptions it can make about your code, to better optimize the compilation result. **NOTE**: This replaces the various `loose` options in plugins in favor of - * top-level options that can apply to multiple plugins - * - * @see https://babeljs.io/docs/en/assumptions - */ - assumptions?: { [name: string]: boolean } | null | undefined; - - /** - * Include the AST in the returned object - * - * Default: `false` - */ - ast?: boolean | null | undefined; - - /** - * Attach a comment after all non-user injected code - * - * Default: `null` - */ - auxiliaryCommentAfter?: string | null | undefined; - - /** - * Attach a comment before all non-user injected code - * - * Default: `null` - */ - auxiliaryCommentBefore?: string | null | undefined; - - /** - * Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of. - * - * Default: `"."` - */ - root?: string | null | undefined; - - /** - * This option, combined with the "root" value, defines how Babel chooses its project root. - * The different modes define different ways that Babel can process the "root" value to get - * the final project root. - * - * @see https://babeljs.io/docs/en/next/options#rootmode - */ - rootMode?: "root" | "upward" | "upward-optional" | undefined; - - /** - * The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files. - * - * Default: `undefined` - */ - configFile?: string | boolean | null | undefined; - - /** - * Specify whether or not to use .babelrc and - * .babelignore files. - * - * Default: `true` - */ - babelrc?: boolean | null | undefined; - - /** - * Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search - * inside of. Defaults to only searching the "root" package. - * - * Default: `(root)` - */ - babelrcRoots?: boolean | MatchPattern | MatchPattern[] | null | undefined; - - /** - * Toggles whether or not browserslist config sources are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json. - * This is useful for projects that use a browserslist config for files that won't be compiled with Babel. - * - * If a string is specified, it must represent the path of a browserslist configuration file. Relative paths are resolved relative to the configuration file which specifies - * this option, or to `cwd` when it's passed as part of the programmatic options. - * - * Default: `true` - */ - browserslistConfigFile?: boolean | null | undefined; - - /** - * The Browserslist environment to use. - * - * Default: `undefined` - */ - browserslistEnv?: string | null | undefined; - - /** - * By default `babel.transformFromAst` will clone the input AST to avoid mutations. - * Specifying `cloneInputAst: false` can improve parsing performance if the input AST is not used elsewhere. - * - * Default: `true` - */ - cloneInputAst?: boolean | null | undefined; - - /** - * Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"` - * - * Default: env vars - */ - envName?: string | undefined; - - /** - * If any of patterns match, the current configuration object is considered inactive and is ignored during config processing. - */ - exclude?: MatchPattern | MatchPattern[] | undefined; - - /** - * Enable code generation - * - * Default: `true` - */ - code?: boolean | null | undefined; - - /** - * Output comments in generated output - * - * Default: `true` - */ - comments?: boolean | null | undefined; - - /** - * Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB - * - * Default: `"auto"` - */ - compact?: boolean | "auto" | null | undefined; - - /** - * The working directory that Babel's programmatic options are loaded relative to. - * - * Default: `"."` - */ - cwd?: string | null | undefined; - - /** - * Utilities may pass a caller object to identify themselves to Babel and - * pass capability-related flags for use by configs, presets and plugins. - * - * @see https://babeljs.io/docs/en/next/options#caller - */ - caller?: TransformCaller | undefined; - - /** - * This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }` - * which will use those options when the `envName` is `production` - * - * Default: `{}` - */ - env?: { [index: string]: TransformOptions | null | undefined } | null | undefined; - - /** - * A path to a `.babelrc` file to extend - * - * Default: `null` - */ - extends?: string | null | undefined; - - /** - * Filename for use in errors etc - * - * Default: `"unknown"` - */ - filename?: string | null | undefined; - - /** - * Filename relative to `sourceRoot` - * - * Default: `(filename)` - */ - filenameRelative?: string | null | undefined; - - /** - * An object containing the options to be passed down to the babel code generator, @babel/generator - * - * Default: `{}` - */ - generatorOpts?: GeneratorOptions | null | undefined; - - /** - * Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used - * - * Default: `null` - */ - getModuleId?: ((moduleName: string) => string | null | undefined) | null | undefined; - - /** - * ANSI highlight syntax error code frames - * - * Default: `true` - */ - highlightCode?: boolean | null | undefined; - - /** - * Opposite to the `only` option. `ignore` is disregarded if `only` is specified - * - * Default: `null` - */ - ignore?: MatchPattern[] | null | undefined; - - /** - * This option is a synonym for "test" - */ - include?: MatchPattern | MatchPattern[] | undefined; - - /** - * A source map object that the output source map will be based on - * - * Default: `null` - */ - inputSourceMap?: InputSourceMap | null | undefined; - - /** - * Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe) - * - * Default: `false` - */ - minified?: boolean | null | undefined; - - /** - * Specify a custom name for module ids - * - * Default: `null` - */ - moduleId?: string | null | undefined; - - /** - * If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules) - * - * Default: `false` - */ - moduleIds?: boolean | null | undefined; - - /** - * Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions - * - * Default: `(sourceRoot)` - */ - moduleRoot?: string | null | undefined; - - /** - * A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile - * a non-matching file it's returned verbatim - * - * Default: `null` - */ - only?: MatchPattern[] | null | undefined; - - /** - * Allows users to provide an array of options that will be merged into the current configuration one at a time. - * This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply - */ - overrides?: TransformOptions[] | undefined; - - /** - * An object containing the options to be passed down to the babel parser, @babel/parser - * - * Default: `{}` - */ - parserOpts?: ParserOptions | null | undefined; - - /** - * List of plugins to load and use - * - * Default: `[]` - */ - plugins?: PluginItem[] | null | undefined; - - /** - * List of presets (a set of plugins) to load and use - * - * Default: `[]` - */ - presets?: PluginItem[] | null | undefined; - - /** - * Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns) - * - * Default: `false` - */ - retainLines?: boolean | null | undefined; - - /** - * An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used - * - * Default: `null` - */ - shouldPrintComment?: ((commentContents: string) => boolean) | null | undefined; - - /** - * Set `sources[0]` on returned source map - * - * Default: `(filenameRelative)` - */ - sourceFileName?: string | null | undefined; - - /** - * If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"` - * then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!** - * - * Default: `false` - */ - sourceMaps?: boolean | "inline" | "both" | null | undefined; - - /** - * The root from which all sources are relative - * - * Default: `(moduleRoot)` - */ - sourceRoot?: string | null | undefined; - - /** - * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6 - * `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`. - * - * Default: `("module")` - */ - sourceType?: "script" | "module" | "unambiguous" | null | undefined; - - /** - * If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing. - */ - test?: MatchPattern | MatchPattern[] | undefined; - - /** - * Describes the environments you support/target for your project. - * This can either be a [browserslist-compatible](https://github.com/ai/browserslist) query (with [caveats](https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries)) - * - * Default: `{}` - */ - targets?: - | string - | string[] - | { - esmodules?: boolean; - node?: Omit | "current" | true; - safari?: Omit | "tp"; - browsers?: string | string[]; - android?: string; - chrome?: string; - deno?: string; - edge?: string; - electron?: string; - firefox?: string; - ie?: string; - ios?: string; - opera?: string; - rhino?: string; - samsung?: string; - }; - - /** - * An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as - * `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`. - */ - wrapPluginVisitorMethod?: - | (( - pluginAlias: string, - visitorType: "enter" | "exit", - callback: (path: NodePath, state: any) => void, - ) => (path: NodePath, state: any) => void) - | null - | undefined; -} - -export interface TransformCaller { - // the only required property - name: string; - // e.g. set to true by `babel-loader` and false by `babel-jest` - supportsStaticESM?: boolean | undefined; - supportsDynamicImport?: boolean | undefined; - supportsExportNamespaceFrom?: boolean | undefined; - supportsTopLevelAwait?: boolean | undefined; - // augment this with a "declare module '@babel/core' { ... }" if you need more keys -} - -export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any; - -export interface MatchPatternContext { - envName: string; - dirname: string; - caller: TransformCaller | undefined; -} -export type MatchPattern = string | RegExp | ((filename: string | undefined, context: MatchPatternContext) => boolean); - -/** - * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. - */ -export function transform(code: string, callback: FileResultCallback): void; - -/** - * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. - */ -export function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void; - -/** - * Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API. - */ -export function transform(code: string, opts?: TransformOptions): BabelFileResult | null; - -/** - * Transforms the passed in code. Returning an object with the generated code, source map, and AST. - */ -export function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null; - -/** - * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. - */ -export function transformAsync(code: string, opts?: TransformOptions): Promise; - -/** - * Asynchronously transforms the entire contents of a file. - */ -export function transformFile(filename: string, callback: FileResultCallback): void; - -/** - * Asynchronously transforms the entire contents of a file. - */ -export function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void; - -/** - * Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. - */ -export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null; - -/** - * Asynchronously transforms the entire contents of a file. - */ -export function transformFileAsync(filename: string, opts?: TransformOptions): Promise; - -/** - * Given an AST, transform it. - */ -export function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void; - -/** - * Given an AST, transform it. - */ -export function transformFromAst( - ast: Node, - code: string | undefined, - opts: TransformOptions | undefined, - callback: FileResultCallback, -): void; - -/** - * Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API. - */ -export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null; - -/** - * Given an AST, transform it. - */ -export function transformFromAstAsync( - ast: Node, - code?: string, - opts?: TransformOptions, -): Promise; - -// A babel plugin is a simple function which must return an object matching -// the following interface. Babel will throw if it finds unknown properties. -// The list of allowed plugin keys is here: -// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71 -export interface PluginObj { - name?: string | undefined; - manipulateOptions?(opts: any, parserOpts: any): void; - pre?(this: S, file: BabelFile): void; - visitor: Visitor; - post?(this: S, file: BabelFile): void; - inherits?: any; -} - -export interface BabelFile { - ast: t.File; - opts: TransformOptions; - hub: Hub; - metadata: object; - path: NodePath; - scope: Scope; - inputMap: object | null; - code: string; -} - -export interface PluginPass { - file: BabelFile; - key: string; - opts: object; - cwd: string; - filename: string | undefined; - get(key: unknown): any; - set(key: unknown, value: unknown): void; - [key: string]: unknown; -} - -export interface BabelFileResult { - ast?: t.File | null | undefined; - code?: string | null | undefined; - ignored?: boolean | undefined; - map?: - | { - version: number; - sources: string[]; - names: string[]; - sourceRoot?: string | undefined; - sourcesContent?: string[] | undefined; - mappings: string; - file: string; - } - | null - | undefined; - metadata?: BabelFileMetadata | undefined; -} - -export interface BabelFileMetadata { - usedHelpers: string[]; - marked: Array<{ - type: string; - message: string; - loc: object; - }>; - modules: BabelFileModulesMetadata; -} - -export interface BabelFileModulesMetadata { - imports: object[]; - exports: { - exported: object[]; - specifiers: object[]; - }; -} - -export type FileParseCallback = (err: Error | null, result: ParseResult | null) => any; - -/** - * Given some code, parse it using Babel's standard behavior. - * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. - */ -export function parse(code: string, callback: FileParseCallback): void; - -/** - * Given some code, parse it using Babel's standard behavior. - * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. - */ -export function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void; - -/** - * Given some code, parse it using Babel's standard behavior. - * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. - */ -export function parse(code: string, options?: TransformOptions): ParseResult | null; - -/** - * Given some code, parse it using Babel's standard behavior. - * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. - */ -export function parseSync(code: string, options?: TransformOptions): ParseResult | null; - -/** - * Given some code, parse it using Babel's standard behavior. - * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. - */ -export function parseAsync(code: string, options?: TransformOptions): Promise; - -/** - * Resolve Babel's options fully, resulting in an options object where: - * - * * opts.plugins is a full list of Plugin instances. - * * opts.presets is empty and all presets are flattened into opts. - * * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel - * will not make a second attempt to load config files. - * - * Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to - * use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to - * invalidate properly, but it is the best we have at the moment. - */ -export function loadOptions(options?: TransformOptions): object | null; - -/** - * To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and - * presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it - * as then see fit and pass it back to Babel again. - * - * * `babelrc: string | void` - The path of the `.babelrc` file, if there was one. - * * `babelignore: string | void` - The path of the `.babelignore` file, if there was one. - * * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back - * to Babel again. - * * `plugins: Array` - See below. - * * `presets: Array` - See below. - * * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to - * Babel will not make a second attempt to load config files. - * - * `ConfigItem` instances expose properties to introspect the values, but each item should be treated as - * immutable. If changes are desired, the item should be removed from the list and replaced with either a normal - * Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for - * information about `ConfigItem` fields. - */ -export function loadPartialConfig(options?: TransformOptions): Readonly | null; -export function loadPartialConfigAsync(options?: TransformOptions): Promise | null>; - -export interface PartialConfig { - options: TransformOptions; - babelrc?: string | undefined; - babelignore?: string | undefined; - config?: string | undefined; - hasFilesystemConfig: () => boolean; -} - -export interface ConfigItem { - /** - * The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]` - */ - name?: string | undefined; - - /** - * The resolved value of the plugin. - */ - value: object | ((...args: any[]) => any); - - /** - * The options object passed to the plugin. - */ - options?: object | false | undefined; - - /** - * The path that the options are relative to. - */ - dirname: string; - - /** - * Information about the plugin's file, if Babel knows it. - * * - */ - file?: - | { - /** - * The file that the user requested, e.g. `"@babel/env"` - */ - request: string; - - /** - * The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"` - */ - resolved: string; - } - | null - | undefined; -} - -export type PluginOptions = object | undefined | false; - -export type PluginTarget = string | object | ((...args: any[]) => any); - -export type PluginItem = - | ConfigItem - | PluginObj - | PluginTarget - | [PluginTarget, PluginOptions] - | [PluginTarget, PluginOptions, string | undefined]; - -export function resolvePlugin(name: string, dirname: string): string | null; -export function resolvePreset(name: string, dirname: string): string | null; - -export interface CreateConfigItemOptions { - dirname?: string | undefined; - type?: "preset" | "plugin" | undefined; -} - -/** - * Allows build tooling to create and cache config items up front. If this function is called multiple times for a - * given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected - * plugins and presets to inject, pre-constructing the config items would be recommended. - */ -export function createConfigItem( - value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], - options?: CreateConfigItemOptions, -): ConfigItem; - -// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't -/** - * @see https://babeljs.io/docs/en/next/config-files#config-function-api - */ -export interface ConfigAPI { - /** - * The version string for the Babel version that is loading the config file. - * - * @see https://babeljs.io/docs/en/next/config-files#apiversion - */ - version: string; - /** - * @see https://babeljs.io/docs/en/next/config-files#apicache - */ - cache: SimpleCacheConfigurator; - /** - * @see https://babeljs.io/docs/en/next/config-files#apienv - */ - env: EnvFunction; - // undocumented; currently hardcoded to return 'false' - // async(): boolean - /** - * This API is used as a way to access the `caller` data that has been passed to Babel. - * Since many instances of Babel may be running in the same process with different `caller` values, - * this API is designed to automatically configure `api.cache`, the same way `api.env()` does. - * - * The `caller` value is available as the first parameter of the callback function. - * It is best used with something like this to toggle configuration behavior - * based on a specific environment: - * - * @example - * function isBabelRegister(caller?: { name: string }) { - * return !!(caller && caller.name === "@babel/register") - * } - * api.caller(isBabelRegister) - * - * @see https://babeljs.io/docs/en/next/config-files#apicallercb - */ - caller(callerCallback: (caller: TransformOptions["caller"]) => T): T; - /** - * While `api.version` can be useful in general, it's sometimes nice to just declare your version. - * This API exposes a simple way to do that with: - * - * @example - * api.assertVersion(7) // major version only - * api.assertVersion("^7.2") - * - * @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange - */ - assertVersion(versionRange: number | string): boolean; - // NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types - // tokTypes: typeof tokTypes -} - -/** - * JS configs are great because they can compute a config on the fly, - * but the downside there is that it makes caching harder. - * Babel wants to avoid re-executing the config function every time a file is compiled, - * because then it would also need to re-execute any plugin and preset functions - * referenced in that config. - * - * To avoid this, Babel expects users of config functions to tell it how to manage caching - * within a config file. - * - * @see https://babeljs.io/docs/en/next/config-files#apicache - */ -export interface SimpleCacheConfigurator { - // there is an undocumented call signature that is a shorthand for forever()/never()/using(). - // (ever: boolean): void - // (callback: CacheCallback): T - /** - * Permacache the computed config and never call the function again. - */ - forever(): void; - /** - * Do not cache this config, and re-execute the function every time. - */ - never(): void; - /** - * Any time the using callback returns a value other than the one that was expected, - * the overall config function will be called again and a new entry will be added to the cache. - * - * @example - * api.cache.using(() => process.env.NODE_ENV) - */ - using(callback: SimpleCacheCallback): T; - /** - * Any time the using callback returns a value other than the one that was expected, - * the overall config function will be called again and all entries in the cache will - * be replaced with the result. - * - * @example - * api.cache.invalidate(() => process.env.NODE_ENV) - */ - invalidate(callback: SimpleCacheCallback): T; -} - -// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231 -export type SimpleCacheKey = string | boolean | number | null | undefined; -export type SimpleCacheCallback = () => T; - -/** - * Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function - * meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel - * was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set. - * - * @see https://babeljs.io/docs/en/next/config-files#apienv - */ -export interface EnvFunction { - /** - * @returns the current `envName` string - */ - (): string; - /** - * @returns `true` if the `envName` is `===` any of the given strings - */ - (envName: string | readonly string[]): boolean; - // the official documentation is misleading for this one... - // this just passes the callback to `cache.using` but with an additional argument. - // it returns its result instead of necessarily returning a boolean. - (envCallback: (envName: NonNullable) => T): T; -} - -export type ConfigFunction = (api: ConfigAPI) => TransformOptions; - -export as namespace babel; diff --git a/node_modules/@types/babel__core/package.json b/node_modules/@types/babel__core/package.json deleted file mode 100644 index 487e31cc1fb37eb5b0b21caa448b6ea1a4937c47..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__core/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "@types/babel__core", - "version": "7.20.5", - "description": "TypeScript definitions for @babel/core", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core", - "license": "MIT", - "contributors": [ - { - "name": "Troy Gerwien", - "githubUsername": "yortus", - "url": "https://github.com/yortus" - }, - { - "name": "Marvin Hagemeister", - "githubUsername": "marvinhagemeister", - "url": "https://github.com/marvinhagemeister" - }, - { - "name": "Melvin Groenhoff", - "githubUsername": "mgroenhoff", - "url": "https://github.com/mgroenhoff" - }, - { - "name": "Jessica Franco", - "githubUsername": "Jessidhia", - "url": "https://github.com/Jessidhia" - }, - { - "name": "Ifiok Jr.", - "githubUsername": "ifiokjr", - "url": "https://github.com/ifiokjr" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/babel__core" - }, - "scripts": {}, - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - }, - "typesPublisherContentHash": "3ece429b02ff9f70503a5644f2b303b04d10e6da7940c91a9eff5e52f2c76b91", - "typeScriptVersion": "4.5" -} \ No newline at end of file diff --git a/node_modules/@types/babel__generator/LICENSE b/node_modules/@types/babel__generator/LICENSE deleted file mode 100644 index 9e841e7a26e4eb057b24511e7b92d42b257a80e5..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__generator/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/babel__generator/README.md b/node_modules/@types/babel__generator/README.md deleted file mode 100644 index d11335c00c1d7d41ee8953022e949710ec40fb88..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__generator/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/babel__generator` - -# Summary -This package contains type definitions for @babel/generator (https://github.com/babel/babel/tree/master/packages/babel-generator). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator. - -### Additional Details - * Last updated: Sat, 16 Dec 2023 09:06:45 GMT - * Dependencies: [@babel/types](https://npmjs.com/package/@babel/types) - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Melvin Groenhoff](https://github.com/mgroenhoff), [Cameron Yan](https://github.com/khell), and [Lyanbin](https://github.com/Lyanbin). diff --git a/node_modules/@types/babel__generator/index.d.ts b/node_modules/@types/babel__generator/index.d.ts deleted file mode 100644 index f2c2af6ab1af47f077f1e279c6abe3aca6bb2591..0000000000000000000000000000000000000000 --- a/node_modules/@types/babel__generator/index.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -import * as t from "@babel/types"; - -export interface GeneratorOptions { - /** - * Optional string to add as a block comment at the start of the output file. - */ - auxiliaryCommentBefore?: string | undefined; - - /** - * Optional string to add as a block comment at the end of the output file. - */ - auxiliaryCommentAfter?: string | undefined; - - /** - * Function that takes a comment (as a string) and returns true if the comment should be included in the output. - * By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment - * contains `@preserve` or `@license`. - */ - shouldPrintComment?(comment: string): boolean; - - /** - * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces). - * Defaults to `false`. - */ - retainLines?: boolean | undefined; - - /** - * Retain parens around function expressions (could be used to change engine parsing behavior) - * Defaults to `false`. - */ - retainFunctionParens?: boolean | undefined; - - /** - * Should comments be included in output? Defaults to `true`. - */ - comments?: boolean | undefined; - - /** - * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`. - */ - compact?: boolean | "auto" | undefined; - - /** - * Should the output be minified. Defaults to `false`. - */ - minified?: boolean | undefined; - - /** - * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`. - */ - concise?: boolean | undefined; - - /** - * Used in warning messages - */ - filename?: string | undefined; - - /** - * Enable generating source maps. Defaults to `false`. - */ - sourceMaps?: boolean | undefined; - - /** - * A root for all relative URLs in the source map. - */ - sourceRoot?: string | undefined; - - /** - * The filename for the source code (i.e. the code in the `code` argument). - * This will only be used if `code` is a string. - */ - sourceFileName?: string | undefined; - - /** - * Set to true to run jsesc with "json": true to print "\u00A9" vs. "©"; - */ - jsonCompatibleStrings?: boolean | undefined; - - /** - * Set to true to enable support for experimental decorators syntax before module exports. - * Defaults to `false`. - */ - decoratorsBeforeExport?: boolean | undefined; - - /** - * The import attributes/assertions syntax to use. - * When not specified, @babel/generator will try to match the style in the input code based on the AST shape. - */ - importAttributesKeyword?: "with" | "assert" | "with-legacy"; - - /** - * Options for outputting jsesc representation. - */ - jsescOption?: { - /** - * The default value for the quotes option is 'single'. This means that any occurrences of ' in the input - * string are escaped as \', so that the output can be used in a string literal wrapped in single quotes. - */ - quotes?: "single" | "double" | "backtick" | undefined; - - /** - * The default value for the numbers option is 'decimal'. This means that any numeric values are represented - * using decimal integer literals. Other valid options are binary, octal, and hexadecimal, which result in - * binary integer literals, octal integer literals, and hexadecimal integer literals, respectively. - */ - numbers?: "binary" | "octal" | "decimal" | "hexadecimal" | undefined; - - /** - * The wrap option takes a boolean value (true or false), and defaults to false (disabled). When enabled, the - * output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through - * the quotes setting. - */ - wrap?: boolean | undefined; - - /** - * The es6 option takes a boolean value (true or false), and defaults to false (disabled). When enabled, any - * astral Unicode symbols in the input are escaped using ECMAScript 6 Unicode code point escape sequences - * instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5 - * environments is a concern, don’t enable this setting. If the json setting is enabled, the value for the es6 - * setting is ignored (as if it was false). - */ - es6?: boolean | undefined; - - /** - * The escapeEverything option takes a boolean value (true or false), and defaults to false (disabled). When - * enabled, all the symbols in the output are escaped — even printable ASCII symbols. - */ - escapeEverything?: boolean | undefined; - - /** - * The minimal option takes a boolean value (true or false), and defaults to false (disabled). When enabled, - * only a limited set of symbols in the output are escaped: \0, \b, \t, \n, \f, \r, \\, \u2028, \u2029. - */ - minimal?: boolean | undefined; - - /** - * The isScriptContext option takes a boolean value (true or false), and defaults to false (disabled). When - * enabled, occurrences of or - - - - - -
- -

decimal.js-light

- -

- The light version of decimal.js, an - arbitrary-precision Decimal type for JavaScript. -

-

Hosted on GitHub.

- -

API

- -

- See the README on GitHub for a quick-start - introduction. -

-

- In all examples below, var and semicolons are not shown, and if a commented-out - value is in quotes it means toString has been called on the preceding expression. -


-

- When the library is loaded, it defines a single function object, - Decimal, the constructor of Decimal instances. -

-

- - If necessary, multiple Decimal constructors can be created, each with their own independent - configuration, e.g. precision and range, which applies to all Decimal instances created from - it. - -

-

- - A new Decimal constructor is created by calling the clone - method of an already existing Decimal constructor. - -

- - - -

CONSTRUCTOR

- -
- DecimalDecimal(value) ⇒ Decimal -
-
-
value: number|string|Decimal
-
- Integer or float. -
-
- The number of digits is not limited, except by JavaScript's maximum array size and, in - practice, the processing time required. -
-
- The maximum permissible exponent magnitude is approximately 9007199254740991. -
-
- String values may be in exponential (floating-point), as well as normal (fixed-point) - notation. -
-
- In exponential notation, e or E defines a power-of-ten exponent. -
-
-

Returns a new Decimal object instance.

-

Throws on an invalid value.

-
-x = new Decimal(9)                       // '9'
-y = new Decimal(x)                       // '9'
-
-new Decimal('5032485723458348569331745.33434346346912144534543')
-new Decimal('4.321e+4')                  // '43210'
-new Decimal('-735.0918e-430')            // '-7.350918e-428'
-new Decimal('5.6700000')                 // '5.67'
-new Decimal('.5')                        // '0.5'
-
-new Decimal(0.046875)                    // '0.046875'
-new Decimal('0.046875000000')            // '0.046875'
-
-new Decimal(4.6875e-2)                   // '0.046875'
-new Decimal('468.75e-4')                 // '0.046875'
- - - -

Methods

-

The methods of a Decimal constructor.

- - - -
- clone - .clone([object]) ⇒ Decimal constructor -
-

object: object

-

- Returns a new independent Decimal constructor with configuration settings as described by - object (see config), or with the same - settings as this Decimal constructor if object is omitted. -

-
Decimal.config({ precision: 5 })
-D9 = Decimal.clone({ precision: 9 })
-
-a = new Decimal(1)
-b = new D9(1)
-
-a.div(3)                           // 0.33333
-b.div(3)                           // 0.333333333
-
-// D9 = Decimal.clone({ precision: 9 }) is equivalent to:
-D9 = Decimal.clone()
-D9.config({ precision: 9 })
-

- It is not inefficient in terms of memory usage to use multiple Decimal constructors as - functions are shared between them. -

- - - -
- config.set(object) ⇒ Decimal constructor -
-

object: object

-

- Configures the 'global' settings for this particular Decimal constructor, i.e. - the settings which apply to operations performed on the Decimal instances created by it. -

-

Returns this Decimal constructor.

-

- The configuration object, object, can contain some or all of the properties - described in detail at Properties and shown in the - example below. -

-

- The values of the configuration object properties are checked for validity and then stored as - equivalently-named properties of this Decimal constructor. -

-

Throws on an invalid object or configuration property value.

-
-// Defaults
-Decimal.config({
-    precision: 20,
-    rounding: 4,
-    toExpNeg: -7,
-    toExpPos: 21,
-    LN10: new Decimal('2.30258509299404568401799145468436...')
-})
-
-Decimal.set({ rounding: Decimal.ROUND_CEIL })
-
-

- The properties of a Decimal constructor can also be set by direct assignment, but that will - by-pass the validity checking that this method performs - which is not a problem if the user - knows that the checks are unnecessary. -

- - - -

Properties

-

The properties of a Decimal constructor.

- - - -
Configuration properties
-

- The values of the configuration properties precision, - rounding, toExpNeg - and toExpPos are set using the - config method. -

-

- As simple object properties they can be set directly without using - config, and it is fine to do so, but the values assigned - will not then be checked for validity. For example: -

-
Decimal.config({ precision: 0 })
-// '[DecimalError] Invalid argument: precision: 0'
-
-Decimal.precision = 0
-// No error is thrown and the results of calculations are unreliable
- - - -
precision
-

- number: integer, 1 to 1e+9 inclusive
- Default value: 20 -

-

The maximum number of significant digits of the result of an operation.

-

- All functions which return a Decimal will return the value to precision - significant digits except Decimal, - absoluteValue, - negated, toInteger, and - toDecimalPlaces. -

-
Decimal.config({ precision: 5 })
-Decimal.precision                  // 5
- - - -
rounding
-

- number: integer, 0 to 8 inclusive
- Default value: 4 (ROUND_HALF_UP) -

-

- The default rounding mode used by toInteger, - toDecimalPlaces, - toExponential, - toFixed, - toPrecision and - toSignificantDigits. -

-

- The rounding modes are available as enumerated properties of the - constructor. -

-
Decimal.config({ rounding: Decimal.ROUND_UP })
-Decimal.config({ rounding: 0 })    // equivalent
-Decimal.rounding                   // 0
- - - -
toExpNeg
-

- number: integer, -9e15 to 0 inclusive
- Default value: -7 -

-

- The negative exponent value at and below which toString - returns exponential notation. -

-
Decimal.config({ toExpNeg: -7 })
-Decimal.toExpNeg                   // -7
-new Decimal(0.00000123)            // '0.00000123'       e is -6
-new Decimal(0.000000123)           // '1.23e-7'
-
-// Always return exponential notation:
-Decimal.config({ toExpNeg: 0 })
-

- JavaScript numbers use exponential notation for negative exponents of -7 and - below. -

-

- Regardless of the value of toExpNeg, the - toFixed method will always return a value in normal - notation and the toExponential method will always - return a value in exponential form. -

- - - -
toExpPos
-

- number: integer, 0 to 9e15 inclusive
- Default value: 20 -

-

- The positive exponent value at and above which toString - returns exponential notation. -

-
Decimal.config({ toExpPos: 2 })
-Decimal.toExpPos                   // 2
-new Decimal(12.3)                  // '12.3'        e is 1
-new Decimal(123)                   // '1.23e+2'
-
-// Always return exponential notation:
-Decimal.config({ toExpPos: 0 })
-

- JavaScript numbers use exponential notation for positive exponents of 20 and - above. -

-

- Regardless of the value of toExpPos, the - toFixed method will always return a value in normal - notation and the toExponential method will always - return a value in exponential form. -

- - - -
LN10
-

- string|Decimal: the natural logarithm of 10
- The default value has 115 digits -

-

- The maximum precision of the naturalExponential, - naturalLogarithm, logarithm, - and toPower methods is determined by the precision of the - value of LN10. -

-

- The default value of LN10 enables a maximum precision of about 100 - digits. To increase this, assign a new value to LN10 using a string or Decimal - value with about 15 digits more than the maximum precision required. -

-

- An error will be thrown if the LN10 value does not have sufficient precision to - enable an operation to be performed. -

-
-Decimal.config({ LN10: '2.3025850929940456840179914546843642076011014886287729760333279009' })
-
-Decimal.LN10.toFixed(5)             // ''2.30259'
- - - -
Rounding modes
-

- The library's enumerated rounding modes are stored as properties of the Decimal constructor. -
They are not referenced internally by the library itself. -

-

Rounding modes 0 to 6 (inclusive) are the same as those of Java's BigDecimal class.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyValueDescription
ROUND_UP0Rounds away from zero
ROUND_DOWN1Rounds towards zero
ROUND_CEIL2Rounds towards Infinity
ROUND_FLOOR3Rounds towards -Infinity
ROUND_HALF_UP4Rounds towards nearest neighbour.
If equidistant, rounds away from zero
ROUND_HALF_DOWN5Rounds towards nearest neighbour.
If equidistant, rounds towards zero
ROUND_HALF_EVEN6 - Rounds towards nearest neighbour.
If equidistant, rounds towards even neighbour -
ROUND_HALF_CEIL7Rounds towards nearest neighbour.
If equidistant, rounds towards Infinity
ROUND_HALF_FLOOR8Rounds towards nearest neighbour.
If equidistant, rounds towards -Infinity
-
Decimal.config({ rounding: Decimal.ROUND_CEIL })
-Decimal.config({ rounding: 2 })    // equivalent
-Decimal.rounding                   // 2
- - - - -

INSTANCE

- -

Methods

-

The methods inherited by a Decimal instance from its constructor's prototype object.

-

A Decimal instance is immutable in the sense that it is not changed by its methods.

-

Methods that return a Decimal can be chained:

-
x = new Decimal(2).times('999.999999999999999').dividedBy(4).toFixed(2)
-

Methods do not round their arguments before execution.

-

- Many method names have a shorter alias. (Internally, the library always uses the shorter - method names.) -

- - - -
absoluteValue.abs() ⇒ Decimal
-

- Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of - this Decimal. -

-

- The return value is not affected by the value of the - precision setting. -

-
-x = new Decimal(-0.8)
-y = x.absoluteValue()         // '0.8'
-z = y.abs()                   // '0.8'
- - - -
comparedTo.cmp(x) ⇒ number
-

x: number|string|Decimal

- - - - - - - - - - - - - - -
Returns 
1if the value of this Decimal is greater than the value of x
-1if the value of this Decimal is less than the value of x
0if this Decimal and x have the same value
-
-x = new Decimal(4)
-y = new Decimal(5)
-x.comparedTo(y)                // -1
-x.comparedTo(x.plus(1))        // 0
- - - -
decimalPlaces.dp() ⇒ number
-

- Returns the number of decimal places, i.e. the number of digits after the decimal point, of - the value of this Decimal. -

-
-x = new Decimal(1.234)
-x.decimalPlaces()              // '3'
-y = new Decimal(987.654321)
-y.dp()                         // '6'
- - - -
dividedBy.div(x) ⇒ Decimal
-

x: number|string|Decimal

-

- Returns a new Decimal whose value is the value of this Decimal divided by x, - truncated to precision significant digits. -

-
-x = new Decimal(355)
-y = new Decimal(113)
-x.dividedBy(y)             // '3.14159292035398230088'
-x.div(5)                   // '71'
- - - -
- dividedToIntegerBy.idiv(x) ⇒ Decimal -
-

x: number|string|Decimal

-

- Return a new Decimal whose value is the integer part of dividing this Decimal by - x, truncated to precision significant - digits. -

-
-x = new Decimal(5)
-y = new Decimal(3)
-x.dividedToIntegerBy(y)     // '1'
-x.idiv(0.7)             // '7'
- - - -
equals.eq(x) ⇒ boolean
-

x: number|string|Decimal

-

- Returns true if the value of this Decimal equals the value of x, - otherwise returns false. -

-

Note: This method uses the cmp method internally.

-
-0 === 1e-324                     // true
-x = new Decimal(0)
-x.equals('1e-324')               // false
- - - -
exponent.exponent() ⇒ number
-

Returns the exponent value of this Decimal.

-
-x = new Decimal(1234.567)
-x.exponent()                     // 3
- - - -
greaterThan.gt(x) ⇒ boolean
-

x: number|string|Decimal

-

- Returns true if the value of this Decimal is greater than the value of - x, otherwise returns false. -

-

Note: This method uses the cmp method internally.

-
-0.1 > (0.3 - 0.2)                            // true
-x = new Decimal(0.1)
-x.greaterThan(Decimal(0.3).minus(0.2))       // false
-new Decimal(0).gt(x)                         // false
- - - -
- greaterThanOrEqualTo.gte(x) ⇒ boolean -
-

x: number|string|Decimal

-

- Returns true if the value of this Decimal is greater than or equal to the value - of x, otherwise returns false. -

-

Note: This method uses the cmp method internally.

-
-(0.3 - 0.2) >= 0.1                       // false
-x = new Decimal(0.3).minus(0.2)
-x.greaterThanOrEqualTo(0.1)              // true
-new Decimal(1).gte(x)                    // true
- - - -
isInteger.isint() ⇒ boolean
-

- Returns true if the value of this Decimal is a whole number, otherwise returns - false. -

-
-x = new Decimal(1)
-x.isInteger()                            // true
-y = new Decimal(123.456)
-y.isint()                                // false
- - - -
isNegative.isneg() ⇒ boolean
-

- Returns true if the value of this Decimal is negative, otherwise returns - false. -

-
-x = new Decimal(0)
-x.isNegative()                           // false
-y = new Decimal(2)
-y.isneg                                  // false
-

Note: n < 0 can be used if n <= -Number.MIN_VALUE.

- - - -
isPositive.ispos() ⇒ boolean
-

- Returns true if the value of this Decimal is positive, otherwise returns - false. -

-
-x = new Decimal(0)
-x.isPositive()                           // false
-y = new Decimal(-2)
-y.ispos                                  // false
-

Note: n < 0 can be used if n <= -Number.MIN_VALUE.

- - - -
isZero.isZero() ⇒ boolean
-

- Returns true if the value of this Decimal is zero or minus zero, otherwise - returns false. -

-
-x = new Decimal(0)
-x.isZero()                               // true
-

Note: n == 0 can be used if n >= Number.MIN_VALUE.

- - - -
lessThan.lt(x) ⇒ boolean
-

x: number|string|Decimal

-

- Returns true if the value of this Decimal is less than the value of - x, otherwise returns false. -

-

Note: This method uses the cmp method internally.

-
-(0.3 - 0.2) < 0.1                        // true
-x = new Decimal(0.3).minus(0.2)
-x.lessThan(0.1)                          // false
-new Decimal(0).lt(x)                     // true
- - - -
lessThanOrEqualTo.lte(x) ⇒ boolean
-

x: number|string|Decimal

-

- Returns true if the value of this Decimal is less than or equal to the value of - x, otherwise returns false. -

-

Note: This method uses the cmp method internally.

-
-0.1 <= (0.3 - 0.2)                              // false
-x = new Decimal(0.1)
-x.lessThanOrEqualTo(Decimal(0.3).minus(0.2))    // true
-new Decimal(-1).lte(x)                          // true
- - - -
logarithm.log(x) ⇒ Decimal
-

x: number|string|Decimal

-

- Returns a new Decimal whose value is the base x logarithm of the value of this - Decimal, truncated to precision significant digits. -

-

- If x is omitted, the base 10 logarithm of the value of this Decimal will be - returned. -

-
-x = new Decimal(1000)
-x.logarithm()                            // '3'
-y = new Decimal(256)
-y.log(2)                                 // '8'
-

The maximum error will be 1 ulp (unit in the last place).

-

Logarithms to base 2 or 10 will always be correct.

-

The performance of this method degrades exponentially with increasing digits.

- - - -
minus.minus(x) ⇒ Decimal
-

x: number|string|Decimal

-

- Returns a new Decimal whose value is the value of this Decimal minus x, truncated - to precision significant digits. -

-
-0.3 - 0.1                                // 0.19999999999999998
-x = new Decimal(0.3)
-x.minus(0.1)                             // '0.2'
- - - -
modulo.mod(x) ⇒ Decimal
-

x: number|string|Decimal

-

- Returns a new Decimal whose value is the value of this Decimal modulo x, - truncated to precision significant digits. -

-
-1 % 0.9                                  // 0.09999999999999998
-x = new Decimal(1)
-y = x.modulo(0.9)                            // '0.1'
- - - -
naturalExponential.exp() ⇒ Decimal
-

- Returns a new Decimal whose value is the base e (Euler's number, the base of the - natural logarithm) exponential of the value of this Decimal, truncated to - precision significant digits. -

-

- The naturalLogarithm function is the inverse of this function. -

-
-x = new Decimal(1)
-x.naturalExponential()                   // '2.7182818284590452354'
-y = new Decimal(2)
-y.exp()                                  // '7.3890560989306502272'
-

The maximum error will be 1 ulp (unit in the last place).

-

The performance of this method degrades exponentially with increasing digits.

- - - -
naturalLogarithm.ln() ⇒ Decimal
-

- Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, - truncated to precision significant digits. -

-

- The natural logarithm is the inverse of the naturalExponential - function. -

-
-x = new Decimal(10)
-x.naturalLogarithm()                     // '2.3026'
-y = new Decimal('1.23e+30')
-y.ln()                                   // '69.28'
-

- The mathematical result of the natural logarithm function is non-terminating, unless its - argument is 1. -

-

- The time-taken by this method increases exponentially with increasing digits. -

-

- See LN10 to configure the maximum precision available. -

- - - -
negated.neg() ⇒ Decimal
-

- Returns a new Decimal whose value is the value of this Decimal negated, i.e. multiplied by - -1. -

-

- The return value is not affected by the value of the - precision setting. -

-
-x = new Decimal(1.8)
-x.negated()                              // '-1.8'
-y = new Decimal(-1.3)
-y.neg()                                  // '1.3'
- - - -
plus.plus(x) ⇒ Decimal
-

x: number|string|Decimal

-

- Returns a new Decimal whose value is the value of this Decimal plus x, truncated - to precision significant digits. -

-
-0.1 + 0.2                                // 0.30000000000000004
-x = new Decimal(0.1)
-y = x.plus(0.2)                          // '0.3'
-new Decimal(0.7).plus(x).plus(y)         // '1.1'
- - - -
precision.sd([include_zeros]) ⇒ number
-

Returns the number of significant digits of the value of this Decimal.

-

- If include_zeros is true or 1 then any trailing zeros - of the integer part of a number are counted as significant digits, otherwise they are not. -

-
-x = new Decimal(1.234)
-x.precision()                            // '4'
-y = new Decimal(987000)
-y.sd()                                   // '3'
-y.sd(true)                               // '6'
- - - -
squareRoot.sqrt() ⇒ Decimal
-

- Returns a new Decimal whose value is the square root of this Decimal, truncated to - precision significant digits. -

-

- This method is much faster than using the toPower method with - an exponent of 0.5. -

-
-x = new Decimal(16)
-x.squareRoot()                           // '4'
-y = new Decimal(3)
-y.sqrt()                                 // '1.73205080756887729353'
-y.sqrt().eq( y.pow(0.5) )                // true
- - - -
times.times(x) ⇒ Decimal
-

x: number|string|Decimal

-

- Returns a new Decimal whose value is the value of this Decimal times x, - truncated to precision significant digits. -

-
-0.6 * 3                                  // 1.7999999999999998
-x = new Decimal(0.6)
-y = x.times(3)                           // '1.8'
-new Decimal('7e+500').times(y)           // '1.26e+501'
- - - -
- toDecimalPlaces.todp([dp [, rm]]) ⇒ Decimal -
-

- dp: number: integer, 0 to 1e+9 inclusive
- rm: number: integer, 0 to 8 inclusive. -

-

- Returns a new Decimal whose value is the value of this Decimal rounded to a maximum of - dp decimal places using rounding mode rm. -

-

- If dp is omitted, the return value will have the same value as this Decimal. -

-

- If rm is omitted, rounding mode rounding - is used. -

-

Throws on an invalid dp or rm value.

-
-x = new Decimal(12.24567)
-x.toDecimalPlaces(0)                // '12'
-x.toDecimalPlaces(1, 0)             // '12.3'
-
-y = new Decimal(9876.54321)
-y.todp(3)                           // '9876.543'
-y.todp(1, 0)                        // '9876.6'
-y.todp(1, Decimal.ROUND_DOWN)       // '9876.5'
- - - -
- toExponential.toExponential([dp [, rm]]) ⇒ string -
-

- dp: number: integer, 0 to 1e+9 inclusive
- rm: number: integer, 0 to 8 inclusive -

-

- Returns a string representing the value of this Decimal in exponential notation rounded - using rounding mode rm to dp decimal places, i.e with one digit - before the decimal point and dp digits after it. -

-

- If the value of this Decimal in exponential notation has fewer than dp fraction - digits, the return value will be appended with zeros accordingly. -

-

- If dp is omitted, the number of digits after the decimal point defaults to the - minimum number of digits necessary to represent the value exactly. -

-

- If rm is omitted, rounding mode rounding is - used. -

-

Throws on an invalid dp or rm value.

-
-x = 45.6
-b = new Decimal(x)
-x.toExponential()              // '4.56e+1'
-y.toExponential()              // '4.56e+1'
-x.toExponential(0)             // '5e+1'
-y.toExponential(0)             // '5e+1'
-x.toExponential(1)             // '4.6e+1'
-y.toExponential(1)             // '4.6e+1'
-y.toExponential(1, 1)          // '4.5e+1'  (ROUND_DOWN)
-x.toExponential(3)             // '4.560e+1'
-y.toExponential(3)             // '4.560e+1'
- - - -
- toFixed.toFixed([dp [, rm]]) ⇒ string -
-

- dp: number: integer, 0 to 1e+9 inclusive
- rm: number: integer, 0 to 8 inclusive -

-

- Returns a string representing the value of this Decimal in normal (fixed-point) notation - rounded to dp decimal places using rounding mode rm. -

-

- If the value of this Decimal in normal notation has fewer than dp fraction - digits, the return value will be appended with zeros accordingly. -

-

- Unlike Number.prototype.toFixed, which returns exponential notation if a number - is greater or equal to 1021, this method will always return normal - notation. -

-

- If dp is omitted, the return value will be unrounded and in normal notation. This - is unlike Number.prototype.toFixed, which returns the value to zero decimal - places, but is useful when because of the current - toExpNeg or - toExpNeg values, - toString returns exponential notation. -

-

- If rm is omitted, rounding mode rounding is - used. -

-

Throws on an invalid dp or rm value.

-
-x = 3.456
-b = new Decimal(x)
-x.toFixed()              // '3'
-y.toFixed()              // '3.456'
-y.toFixed(0)             // '3'
-x.toFixed(2)             // '3.46'
-y.toFixed(2)             // '3.46'
-y.toFixed(2, 1)          // '3.45'  (ROUND_DOWN)
-x.toFixed(5)             // '3.45600'
-y.toFixed(5)             // '3.45600'
- - - -
toInteger.toint() ⇒ Decimal
-

- Returns a new Decimal whose value is the value of this Decimal rounded to a whole number using - rounding mode rounding. -

-

- To emulate Math.round, set rounding to - 7, i.e. ROUND_HALF_CEIL. -

-
-Decimal.config({ rounding: 4 })
-x = 1234.5
-x.toInteger()                            // '1235'
-
-Decimal.rounding = Decimal.ROUND_DOWN
-x.toint()                                // '1234'
-x                                        // '1234.5'
- - - -
toJSON.toJSON() ⇒ string
-

As toString.

- - - -
toNumber.toNumber() ⇒ number
-

Returns the value of this Decimal converted to a primitive number.

-

- Type coercion with, for example, JavaScript's unary plus operator will also work, except that - a Decimal with the value minus zero will convert to positive zero. -

-
-x = new Decimal(456.789)
-x.toNumber()                   // 456.789
-+x                             // 456.789
-
-y = new Decimal('45987349857634085409857349856430985')
-y.toNumber()                   // 4.598734985763409e+34
- - - -
toPower.pow(x) ⇒ Decimal
-

x: number|string|Decimal: integer or non-integer

-

- Returns a new Decimal whose value is the value of this Decimal raised to the power - x, truncated to precision significant - digits. -

-

- The performance of this method degrades exponentially with increasing digits.
- For non-integer exponents in particular, the performance of this method may not be adequate. -

-

The maximum error will be 1 ulp (unit in the last place).

-
-Math.pow(0.7, 2)               // 0.48999999999999994
-x = new Decimal(0.7)
-x.toPower(2)                   // '0.49'
-new Decimal(3).pow(-2)         // '0.11111111111111111111'
-
-new Decimal(1217652.23).pow('98765.489305603941')
-// '4.8227010515242461181e+601039'
- - - - -
- toPrecision.toPrecision([sd [, rm]]) ⇒ string -
-

- sd: number: integer, 1 to 1e+9 inclusive
- rm: number: integer, 0 to 8 inclusive -

-

- Returns a string representing the value of this Decimal rounded to sd significant - digits using rounding mode rm. -

-

- If sd is less than the number of digits necessary to represent the integer part - of the value in normal (fixed-point) notation, then exponential notation is used. -

-

- If sd is omitted, the return value is the same as - toString. -

-

- If rm is omitted, rounding mode rounding is - used. -

-

Throws on an invalid sd or rm value.

-
-x = 45.6
-b = new Decimal(x)
-x.toPrecision()                          // '45.6'
-y.toPrecision()                          // '45.6'
-x.toPrecision(1)                         // '5e+1'
-y.toPrecision(1)                         // '5e+1'
-y.toPrecision(2, 0)                      // '4.6e+1'  (ROUND_UP)
-y.toPrecision(2, 1)                      // '4.5e+1'  (ROUND_DOWN)
-x.toPrecision(5)                         // '45.600'
-y.toPrecision(5)                         // '45.600'
- - - -
- toSignificantDigits.tosd([sd [, rm]]) ⇒ Decimal -
-

- sd: number: integer, 1 to 1e+9 inclusive.
- rm: number: integer, 0 to 8 inclusive. -

-

- Returns a new Decimal whose value is the value of this Decimal rounded to a maximum of - sd significant digits using rounding mode rm. -

-

- If sd is omitted, the return value will be rounded to - precision significant digits. -

-

- If rm is omitted, rounding mode rounding - will be used. -

-

Throws on an invalid sd or rm value.

-
-Decimal.config({ precision: 5, rounding: 4 })
-x = new Decimal(9876.54321)
-
-x.toSignificantDigits()                          // '9876.5'
-x.toSignificantDigits(6)                         // '9876.54'
-x.toSignificantDigits(6, Decimal.ROUND_UP)       // '9876.55'
-x.tosd(2)                                        // '9900'
-x.tosd(2, 1)                                     // '9800'
-x                                                // '9876.54321'
- - - -
toString.toString() ⇒ string
-

Returns a string representing the value of this Decimal.

-

- If this Decimal has a positive exponent that is equal to or greater than - toExpPos, or a negative exponent equal to or less than - toExpNeg, then exponential notation will be returned. -

-
-x = new Decimal(750000)
-x.toString()                             // '750000'
-Decimal.config({ toExpPos: 5 })
-x.toString()                             // '7.5e+5'
-
-Decimal.config({ precision: 4 });
-y = new Decimal('1.23456789')
-y.toString()                             // '1.23456789'
- - - -
valueOf.val() ⇒ string
-

As toString.

- - - - - -

Properties

-

- The value of a Decimal is stored in a normalised base 10000000 floating point - format. -

-

- A Decimal instance is an object with three properties: -

- - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyDescriptionTypeValue
ddigitsnumber[] Array of integers, each 0 - 1e7
eexponent*numberInteger, -1286742750677284 to 1286742750677284 inclusive
ssignnumber-1, 0, or 1
-

- *This is the exponent in base 10000000. To get the base 10 exponent, use the - exponent method. -

-

The properties are best considered to be read-only.

-

- As with JavaScript numbers, the original exponent and fractional trailing zeros of a number - are not preserved. -

-
-x = new Decimal(0.123)                   // '0.123'
-x.toExponential()                        // '1.23e-1'
-x.d                                      // [ 1230000 ]
-x.e                                      // -1
-x.s                                      // 1
-
-y = new Number(-123.4567000e+2)          // '-12345.67'
-y.toExponential()                        // '-1.234567e+4'
-z = new Decimal('-123.4567000e+2')       // '-12345.67'
-z.toExponential()                        // '-1.234567e+4'
-z.d                                      // [ 12345, 6700000 ]
-z.e                                      // 4
-z.s                                      // -1
- - - -

Errors

-

- The errors that are thrown are generic Error objects whose message - property begins with "[DecimalError]". -

-

To determine if an exception is a Decimal Error:

-
-try {
-    // ...
-} catch (e) {
-    if ( e instanceof Error && /DecimalError/.test(e.message) ) {
-        // ...
-    }
-}
- - - -

FAQ

-
Why are trailing fractional zeros removed from Decimals?
-

- Some arbitrary-precision libraries retain trailing fractional zeros as they can indicate the - precision of a value. This can be useful but the results of arithmetic operations can be - misleading. -

-
-x = new BigDecimal("1.0")
-y = new BigDecimal("1.1000")
-z = x.add(y)                      // 2.1000
-
-x = new BigDecimal("1.20")
-y = new BigDecimal("3.45000")
-z = x.multiply(y)                 // 4.1400000
-

- To specify the precision of a value is to specify that the value lies - within a certain range. -

-

- In the first example, x has a value of 1.0. The trailing zero shows - the precision of the value, implying that it is in the range 0.95 to - 1.05. Similarly, the precision indicated by the trailing zeros of y - indicates that the value is in the range 1.09995 to 1.10005. -

-

- If we add the two lowest values in the ranges we have, 0.95 + 1.09995 = 2.04995, - and if we add the two highest values we have, 1.05 + 1.10005 = 2.15005, so the - range of the result of the addition implied by the precision of its operands is - 2.04995 to 2.15005. -

-

- The result given by BigDecimal of 2.1000 however, indicates that the value is in - the range 2.09995 to 2.10005 and therefore the precision implied by - its trailing zeros may be misleading. -

-

- In the second example, the true range is 4.122744 to 4.157256 yet - the BigDecimal answer of 4.1400000 indicates a range of 4.13999995 - to 4.14000005. Again, the precision implied by the trailing zeros may be - misleading. -

-

- This library, like binary floating point and most calculators, does not retain trailing - fractional zeros. Instead, the toExponential, toFixed and - toPrecision methods enable trailing zeros to be added if and when required.
-

-
- - - diff --git a/node_modules/decimal.js-light/doc/decimal.js.map b/node_modules/decimal.js-light/doc/decimal.js.map deleted file mode 100644 index 2a4be94d976ccca77d63f93a024b988739a9ef7a..0000000000000000000000000000000000000000 --- a/node_modules/decimal.js-light/doc/decimal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decimal.min.js","sources":["decimal.js"],"names":["globalScope","add","x","y","carry","d","e","i","k","len","xd","yd","Ctor","constructor","pr","precision","s","external","round","slice","length","Math","ceil","LOG_BASE","reverse","push","BASE","unshift","pop","checkInt32","min","max","Error","invalidArgument","digitsToString","ws","indexOfLastWord","str","w","getZeroString","exp","sd","denominator","guard","pow","sum","t","wpr","getBase10Exponent","exponentOutOfRange","ONE","abs","gte","times","log","mathpow","LN10","plus","divide","getLn10","decimalError","zs","ln","c","c0","numerator","x2","n","eq","charAt","minus","parseDecimal","indexOf","replace","search","substring","charCodeAt","mathfloor","MAX_E","rm","j","rd","doRound","xdi","subtract","xe","xLTy","shift","toString","isExp","truncate","arr","clone","obj","Decimal","value","this","isDecimal","test","p","ps","prototype","P","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","config","set","hasOwnProperty","v","MAX_DIGITS","rounding","toExpNeg","toExpPos","floor","MAX_SAFE_INTEGER","absoluteValue","comparedTo","cmp","xdL","ydL","decimalPlaces","dp","dividedBy","div","dividedToIntegerBy","idiv","equals","exponent","greaterThan","gt","greaterThanOrEqualTo","isInteger","isint","isNegative","isneg","isPositive","ispos","isZero","lessThan","lt","lessThanOrEqualTo","lte","logarithm","base","r","sub","modulo","mod","q","naturalExponential","naturalLogarithm","negated","neg","z","squareRoot","sqrt","toExponential","mul","rL","toDecimalPlaces","todp","toFixed","toInteger","toint","toNumber","toPower","sign","yIsInt","yn","toPrecision","toSignificantDigits","tosd","valueOf","val","toJSON","multiplyInteger","temp","compare","a","b","aL","bL","prod","prodL","qd","rem","remL","rem0","xi","xL","yd0","yL","yz","define","amd","module","exports","self","Function"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/decimal.js-light/package.json b/node_modules/decimal.js-light/package.json deleted file mode 100644 index 5cb2fdb6be0578fda8f69cfb5b083c31ff627977..0000000000000000000000000000000000000000 --- a/node_modules/decimal.js-light/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "decimal.js-light", - "description": "An arbitrary-precision Decimal type for JavaScript.", - "version": "2.5.1", - "keywords": [ - "arbitrary", - "precision", - "arithmetic", - "big", - "number", - "decimal", - "float", - "biginteger", - "bigdecimal", - "bignumber", - "bigint", - "bignum" - ], - "repository" : { - "type": "git", - "url": "https://github.com/MikeMcl/decimal.js-light.git" - }, - "main": "decimal", - "module": "decimal.mjs", - "browser": "decimal.js", - "types": "decimal.d.ts", - "author": { - "name": "Michael Mclaughlin", - "email": "M8ch88l@gmail.com" - }, - "license": "MIT", - "scripts": { - "test": "node ./test/test.js", - "build": "uglifyjs decimal.js --source-map doc/decimal.js.map -c -m -o decimal.min.js --preamble \"/* decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */\"" - } -} diff --git a/node_modules/define-data-property/.eslintrc b/node_modules/define-data-property/.eslintrc deleted file mode 100644 index 75443e81ee0f6180b9ceee33bc69fa8696162783..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/.eslintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "complexity": 0, - "id-length": 0, - "new-cap": ["error", { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - }, - - "overrides": [ - { - "files": "test/**", - "rules": { - "max-lines-per-function": "off", - }, - }, - ], -} diff --git a/node_modules/define-data-property/.github/FUNDING.yml b/node_modules/define-data-property/.github/FUNDING.yml deleted file mode 100644 index 3e17725ddfc684e0a254b7eed5adb8d05bfdeaa5..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/define-data-property -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/define-data-property/.nycrc b/node_modules/define-data-property/.nycrc deleted file mode 100644 index 1826526e091b89c896e7099ccd891db79165e329..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/define-data-property/CHANGELOG.md b/node_modules/define-data-property/CHANGELOG.md deleted file mode 100644 index 4eed75ea9096735ec95f1158a6f30461cec02430..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.1.4](https://github.com/ljharb/define-data-property/compare/v1.1.3...v1.1.4) - 2024-02-13 - -### Commits - -- [Refactor] use `es-define-property` [`90f2f4c`](https://github.com/ljharb/define-data-property/commit/90f2f4cc20298401e71c28e1e08888db12021453) -- [Dev Deps] update `@types/object.getownpropertydescriptors` [`cd929d9`](https://github.com/ljharb/define-data-property/commit/cd929d9a04f5f2fdcfa9d5be140940b91a083153) - -## [v1.1.3](https://github.com/ljharb/define-data-property/compare/v1.1.2...v1.1.3) - 2024-02-12 - -### Commits - -- [types] hand-write d.ts instead of emitting it [`0cbc988`](https://github.com/ljharb/define-data-property/commit/0cbc988203c105f2d97948327c7167ebd33bd318) -- [meta] simplify `exports` [`690781e`](https://github.com/ljharb/define-data-property/commit/690781eed28bbf2d6766237efda0ba6dd591609e) -- [Dev Deps] update `hasown`; clean up DT packages [`6cdfd1c`](https://github.com/ljharb/define-data-property/commit/6cdfd1cb2d91d791bfd18cda5d5cab232fd5d8fc) -- [actions] cleanup [`3142bc6`](https://github.com/ljharb/define-data-property/commit/3142bc6a4bc406a51f5b04f31e98562a27f35ffd) -- [meta] add `funding` [`8474423`](https://github.com/ljharb/define-data-property/commit/847442391a79779af3e0f1bf0b5bb923552b7804) -- [Deps] update `get-intrinsic` [`3e9be00`](https://github.com/ljharb/define-data-property/commit/3e9be00e07784ba34e7c77d8bc0fdbc832ad61de) - -## [v1.1.2](https://github.com/ljharb/define-data-property/compare/v1.1.1...v1.1.2) - 2024-02-05 - -### Commits - -- [Dev Deps] update @types packages, `object-inspect`, `tape`, `typescript` [`df41bf8`](https://github.com/ljharb/define-data-property/commit/df41bf84ca3456be6226055caab44e38e3a7fd2f) -- [Dev Deps] update DT packages, `aud`, `npmignore`, `tape`, typescript` [`fab0e4e`](https://github.com/ljharb/define-data-property/commit/fab0e4ec709ee02b79f42d6db3ee5f26e0a34b8a) -- [Dev Deps] use `hasown` instead of `has` [`aa51ef9`](https://github.com/ljharb/define-data-property/commit/aa51ef93f6403d49d9bb72a807bcdb6e418978c0) -- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`d89be50`](https://github.com/ljharb/define-data-property/commit/d89be50571175888d391238605122679f7e65ffc) -- [Deps] update `has-property-descriptors` [`7af887c`](https://github.com/ljharb/define-data-property/commit/7af887c9083b59b195b0079e04815cfed9fcee2b) -- [Deps] update `get-intrinsic` [`bb8728e`](https://github.com/ljharb/define-data-property/commit/bb8728ec42cd998505a7157ae24853a560c20646) - -## [v1.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12 - -### Commits - -- [Tests] fix tests in ES3 engines [`5c6920e`](https://github.com/ljharb/define-data-property/commit/5c6920edd1f52f675b02f417e539c28135b43f94) -- [Dev Deps] update `@types/es-value-fixtures`, `@types/for-each`, `@types/gopd`, `@types/has-property-descriptors`, `tape`, `typescript` [`7d82dfc`](https://github.com/ljharb/define-data-property/commit/7d82dfc20f778b4465bba06335dd53f6f431aea3) -- [Fix] IE 8 has a broken `Object.defineProperty` [`0672e1a`](https://github.com/ljharb/define-data-property/commit/0672e1af2a9fcc787e7c23b96dea60d290df5548) -- [meta] emit types on prepack [`73acb1f`](https://github.com/ljharb/define-data-property/commit/73acb1f903c21b314ec7156bf10f73c7910530c0) -- [Dev Deps] update `tape`, `typescript` [`9489a77`](https://github.com/ljharb/define-data-property/commit/9489a7738bf2ecf0ac71d5b78ec4ca6ad7ba0142) - -## [v1.1.0](https://github.com/ljharb/define-data-property/compare/v1.0.1...v1.1.0) - 2023-09-13 - -### Commits - -- [New] add `loose` arg [`155235a`](https://github.com/ljharb/define-data-property/commit/155235a4c4d7741f6de01cd87c99599a56654b72) -- [New] allow `null` to be passed for the non* args [`7d2fa5f`](https://github.com/ljharb/define-data-property/commit/7d2fa5f06be0392736c13b126f7cd38979f34792) - -## [v1.0.1](https://github.com/ljharb/define-data-property/compare/v1.0.0...v1.0.1) - 2023-09-12 - -### Commits - -- [meta] add TS types [`43d763c`](https://github.com/ljharb/define-data-property/commit/43d763c6c883f652de1c9c02ef6216ee507ffa69) -- [Dev Deps] update `@types/tape`, `typescript` [`f444985`](https://github.com/ljharb/define-data-property/commit/f444985811c36f3e6448a03ad2f9b7898917f4c7) -- [meta] add `safe-publish-latest`, [`172bb10`](https://github.com/ljharb/define-data-property/commit/172bb10890896ebb160e64398f6ee55760107bee) - -## v1.0.0 - 2023-09-12 - -### Commits - -- Initial implementation, tests, readme [`5b43d6b`](https://github.com/ljharb/define-data-property/commit/5b43d6b44e675a904810467a7d4e0adb7efc3196) -- Initial commit [`35e577a`](https://github.com/ljharb/define-data-property/commit/35e577a6ba59a98befa97776d70d90f3bea9009d) -- npm init [`82a0a04`](https://github.com/ljharb/define-data-property/commit/82a0a04a321ca7de220af02d41e2745e8a9962ed) -- Only apps should have lockfiles [`96df244`](https://github.com/ljharb/define-data-property/commit/96df244a3c6f426f9a2437be825d1c6f5dd7158e) -- [meta] use `npmignore` to autogenerate an npmignore file [`a87ff18`](https://github.com/ljharb/define-data-property/commit/a87ff18cb79e14c2eb5720486c4759fd9a189375) diff --git a/node_modules/define-data-property/LICENSE b/node_modules/define-data-property/LICENSE deleted file mode 100644 index b4213ac640ad53446325d2dab2c2bc8620406b72..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/define-data-property/README.md b/node_modules/define-data-property/README.md deleted file mode 100644 index f2304daef9b105844c4495414f1b8164d86befa2..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# define-data-property [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Define a data property on an object. Will fall back to assignment in an engine without descriptors. - -The three `non*` argument can also be passed `null`, which will use the existing state if available. - -The `loose` argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment. - -## Usage - -```javascript -var defineDataProperty = require('define-data-property'); -var assert = require('assert'); - -var obj = {}; -defineDataProperty(obj, 'key', 'value'); -defineDataProperty( - obj, - 'key2', - 'value', - true, // nonEnumerable, optional - false, // nonWritable, optional - true, // nonConfigurable, optional - false // loose, optional -); - -assert.deepEqual( - Object.getOwnPropertyDescriptors(obj), - { - key: { - configurable: true, - enumerable: true, - value: 'value', - writable: true, - }, - key2: { - configurable: false, - enumerable: false, - value: 'value', - writable: true, - }, - } -); -``` - -[package-url]: https://npmjs.org/package/define-data-property -[npm-version-svg]: https://versionbadg.es/ljharb/define-data-property.svg -[deps-svg]: https://david-dm.org/ljharb/define-data-property.svg -[deps-url]: https://david-dm.org/ljharb/define-data-property -[dev-deps-svg]: https://david-dm.org/ljharb/define-data-property/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/define-data-property#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/define-data-property.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/define-data-property.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/define-data-property.svg -[downloads-url]: https://npm-stat.com/charts.html?package=define-data-property -[codecov-image]: https://codecov.io/gh/ljharb/define-data-property/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/define-data-property/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-data-property -[actions-url]: https://github.com/ljharb/define-data-property/actions diff --git a/node_modules/define-data-property/index.d.ts b/node_modules/define-data-property/index.d.ts deleted file mode 100644 index b56a77da820232226188558bb7c86772c5b2c834..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ - -declare function defineDataProperty( - obj: Record, - property: keyof typeof obj, - value: typeof obj[typeof property], - nonEnumerable?: boolean | null, - nonWritable?: boolean | null, - nonConfigurable?: boolean | null, - loose?: boolean -): void; - -export = defineDataProperty; \ No newline at end of file diff --git a/node_modules/define-data-property/index.js b/node_modules/define-data-property/index.js deleted file mode 100644 index e1a38c07bb14bb1ca31acdf7b9d677abff94d34b..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/index.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -var $defineProperty = require('es-define-property'); - -var $SyntaxError = require('es-errors/syntax'); -var $TypeError = require('es-errors/type'); - -var gopd = require('gopd'); - -/** @type {import('.')} */ -module.exports = function defineDataProperty( - obj, - property, - value -) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new $TypeError('`obj` must be an object or a function`'); - } - if (typeof property !== 'string' && typeof property !== 'symbol') { - throw new $TypeError('`property` must be a string or a symbol`'); - } - if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { - throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); - } - if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { - throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); - } - if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { - throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); - } - if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { - throw new $TypeError('`loose`, if provided, must be a boolean'); - } - - var nonEnumerable = arguments.length > 3 ? arguments[3] : null; - var nonWritable = arguments.length > 4 ? arguments[4] : null; - var nonConfigurable = arguments.length > 5 ? arguments[5] : null; - var loose = arguments.length > 6 ? arguments[6] : false; - - /* @type {false | TypedPropertyDescriptor} */ - var desc = !!gopd && gopd(obj, property); - - if ($defineProperty) { - $defineProperty(obj, property, { - configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, - enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, - value: value, - writable: nonWritable === null && desc ? desc.writable : !nonWritable - }); - } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { - // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable - obj[property] = value; // eslint-disable-line no-param-reassign - } else { - throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); - } -}; diff --git a/node_modules/define-data-property/package.json b/node_modules/define-data-property/package.json deleted file mode 100644 index eec40971ebb115846a8c6f7d2d8a880b6fb92bfe..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "define-data-property", - "version": "1.1.4", - "description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.", - "main": "index.js", - "types": "./index.d.ts", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "sideEffects": false, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "tsc": "tsc -p .", - "prelint": "evalmd README.md", - "lint": "eslint --ext=js,mjs .", - "postlint": "npm run tsc", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/define-data-property.git" - }, - "keywords": [ - "define", - "data", - "property", - "object", - "accessor", - "javascript", - "ecmascript", - "enumerable", - "configurable", - "writable" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/define-data-property/issues" - }, - "homepage": "https://github.com/ljharb/define-data-property#readme", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", - "@types/call-bind": "^1.0.5", - "@types/define-properties": "^1.1.5", - "@types/es-value-fixtures": "^1.4.4", - "@types/for-each": "^0.3.3", - "@types/get-intrinsic": "^1.2.2", - "@types/gopd": "^1.0.3", - "@types/has-property-descriptors": "^1.0.3", - "@types/object-inspect": "^1.8.4", - "@types/object.getownpropertydescriptors": "^2.1.4", - "@types/tape": "^5.6.4", - "aud": "^2.0.4", - "auto-changelog": "^2.4.0", - "es-value-fixtures": "^1.4.2", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.3", - "hasown": "^2.0.1", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "object-inspect": "^1.13.1", - "object.getownpropertydescriptors": "^2.1.7", - "reflect.ownkeys": "^1.1.4", - "safe-publish-latest": "^2.0.0", - "tape": "^5.7.4", - "typescript": "next" - }, - "engines": { - "node": ">= 0.4" - }, - "testling": { - "files": "test/index.js" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows", - "types/reflect.ownkeys" - ] - } -} diff --git a/node_modules/define-data-property/test/index.js b/node_modules/define-data-property/test/index.js deleted file mode 100644 index 68204c66b26697b2d2b1ae9ef97eb5de63c55e2d..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/test/index.js +++ /dev/null @@ -1,392 +0,0 @@ -'use strict'; - -var test = require('tape'); -var v = require('es-value-fixtures'); -var forEach = require('for-each'); -var inspect = require('object-inspect'); -var hasOwn = require('hasown'); -var hasPropertyDescriptors = require('has-property-descriptors')(); -var getOwnPropertyDescriptors = require('object.getownpropertydescriptors'); -var ownKeys = require('reflect.ownkeys'); - -var defineDataProperty = require('../'); - -test('defineDataProperty', function (t) { - t.test('argument validation', function (st) { - forEach(v.primitives, function (nonObject) { - st['throws']( - // @ts-expect-error - function () { defineDataProperty(nonObject, 'key', 'value'); }, - TypeError, - 'throws on non-object input: ' + inspect(nonObject) - ); - }); - - forEach(v.nonPropertyKeys, function (nonPropertyKey) { - st['throws']( - // @ts-expect-error - function () { defineDataProperty({}, nonPropertyKey, 'value'); }, - TypeError, - 'throws on non-PropertyKey input: ' + inspect(nonPropertyKey) - ); - }); - - forEach(v.nonBooleans, function (nonBoolean) { - if (nonBoolean !== null) { - st['throws']( - // @ts-expect-error - function () { defineDataProperty({}, 'key', 'value', nonBoolean); }, - TypeError, - 'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean) - ); - - st['throws']( - // @ts-expect-error - function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); }, - TypeError, - 'throws on non-boolean nonWritable: ' + inspect(nonBoolean) - ); - - st['throws']( - // @ts-expect-error - function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); }, - TypeError, - 'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean) - ); - } - }); - - st.end(); - }); - - t.test('normal data property', function (st) { - /** @type {Record} */ - var obj = { existing: 'existing property' }; - st.ok(hasOwn(obj, 'existing'), 'has initial own property'); - st.equal(obj.existing, 'existing property', 'has expected initial value'); - - var res = defineDataProperty(obj, 'added', 'added property'); - st.equal(res, void undefined, 'returns `undefined`'); - st.ok(hasOwn(obj, 'added'), 'has expected own property'); - st.equal(obj.added, 'added property', 'has expected value'); - - defineDataProperty(obj, 'existing', 'new value'); - st.ok(hasOwn(obj, 'existing'), 'still has expected own property'); - st.equal(obj.existing, 'new value', 'has new expected value'); - - defineDataProperty(obj, 'explicit1', 'new value', false); - st.ok(hasOwn(obj, 'explicit1'), 'has expected own property (explicit enumerable)'); - st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)'); - - defineDataProperty(obj, 'explicit2', 'new value', false, false); - st.ok(hasOwn(obj, 'explicit2'), 'has expected own property (explicit writable)'); - st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)'); - - defineDataProperty(obj, 'explicit3', 'new value', false, false, false); - st.ok(hasOwn(obj, 'explicit3'), 'has expected own property (explicit configurable)'); - st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)'); - - st.end(); - }); - - t.test('loose mode', { skip: !hasPropertyDescriptors }, function (st) { - var obj = { existing: 'existing property' }; - - defineDataProperty(obj, 'added', 'added value 1', true, null, null, true); - st.deepEqual( - getOwnPropertyDescriptors(obj), - { - existing: { - configurable: true, - enumerable: true, - value: 'existing property', - writable: true - }, - added: { - configurable: true, - enumerable: !hasPropertyDescriptors, - value: 'added value 1', - writable: true - } - }, - 'in loose mode, obj still adds property 1' - ); - - defineDataProperty(obj, 'added', 'added value 2', false, true, null, true); - st.deepEqual( - getOwnPropertyDescriptors(obj), - { - existing: { - configurable: true, - enumerable: true, - value: 'existing property', - writable: true - }, - added: { - configurable: true, - enumerable: true, - value: 'added value 2', - writable: !hasPropertyDescriptors - } - }, - 'in loose mode, obj still adds property 2' - ); - - defineDataProperty(obj, 'added', 'added value 3', false, false, true, true); - st.deepEqual( - getOwnPropertyDescriptors(obj), - { - existing: { - configurable: true, - enumerable: true, - value: 'existing property', - writable: true - }, - added: { - configurable: !hasPropertyDescriptors, - enumerable: true, - value: 'added value 3', - writable: true - } - }, - 'in loose mode, obj still adds property 3' - ); - - st.end(); - }); - - t.test('non-normal data property, ES3', { skip: hasPropertyDescriptors }, function (st) { - /** @type {Record} */ - var obj = { existing: 'existing property' }; - - st['throws']( - function () { defineDataProperty(obj, 'added', 'added value', true); }, - SyntaxError, - 'nonEnumerable throws a Syntax Error' - ); - - st['throws']( - function () { defineDataProperty(obj, 'added', 'added value', false, true); }, - SyntaxError, - 'nonWritable throws a Syntax Error' - ); - - st['throws']( - function () { defineDataProperty(obj, 'added', 'added value', false, false, true); }, - SyntaxError, - 'nonWritable throws a Syntax Error' - ); - - st.deepEqual( - ownKeys(obj), - ['existing'], - 'obj still has expected keys' - ); - st.equal(obj.existing, 'existing property', 'obj still has expected values'); - - st.end(); - }); - - t.test('new non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) { - /** @type {Record} */ - var obj = { existing: 'existing property' }; - - defineDataProperty(obj, 'nonEnum', null, true); - defineDataProperty(obj, 'nonWrit', null, false, true); - defineDataProperty(obj, 'nonConf', null, false, false, true); - - st.deepEqual( - getOwnPropertyDescriptors(obj), - { - existing: { - configurable: true, - enumerable: true, - value: 'existing property', - writable: true - }, - nonEnum: { - configurable: true, - enumerable: false, - value: null, - writable: true - }, - nonWrit: { - configurable: true, - enumerable: true, - value: null, - writable: false - }, - nonConf: { - configurable: false, - enumerable: true, - value: null, - writable: true - } - }, - 'obj has expected property descriptors' - ); - - st.end(); - }); - - t.test('existing non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) { - // test case changing an existing non-normal property - - /** @type {Record} */ - var obj = {}; - Object.defineProperty(obj, 'nonEnum', { configurable: true, enumerable: false, value: null, writable: true }); - Object.defineProperty(obj, 'nonWrit', { configurable: true, enumerable: true, value: null, writable: false }); - Object.defineProperty(obj, 'nonConf', { configurable: false, enumerable: true, value: null, writable: true }); - - st.deepEqual( - getOwnPropertyDescriptors(obj), - { - nonEnum: { - configurable: true, - enumerable: false, - value: null, - writable: true - }, - nonWrit: { - configurable: true, - enumerable: true, - value: null, - writable: false - }, - nonConf: { - configurable: false, - enumerable: true, - value: null, - writable: true - } - }, - 'obj initially has expected property descriptors' - ); - - defineDataProperty(obj, 'nonEnum', 'new value', false); - defineDataProperty(obj, 'nonWrit', 'new value', false, false); - st['throws']( - function () { defineDataProperty(obj, 'nonConf', 'new value', false, false, false); }, - TypeError, - 'can not alter a nonconfigurable property' - ); - - st.deepEqual( - getOwnPropertyDescriptors(obj), - { - nonEnum: { - configurable: true, - enumerable: true, - value: 'new value', - writable: true - }, - nonWrit: { - configurable: true, - enumerable: true, - value: 'new value', - writable: true - }, - nonConf: { - configurable: false, - enumerable: true, - value: null, - writable: true - } - }, - 'obj ends up with expected property descriptors' - ); - - st.end(); - }); - - t.test('frozen object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { - var frozen = Object.freeze({ existing: true }); - - st['throws']( - function () { defineDataProperty(frozen, 'existing', 'new value'); }, - TypeError, - 'frozen object can not modify an existing property' - ); - - st['throws']( - function () { defineDataProperty(frozen, 'new', 'new property'); }, - TypeError, - 'frozen object can not add a new property' - ); - - st.end(); - }); - - t.test('sealed object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { - var sealed = Object.seal({ existing: true }); - st.deepEqual( - Object.getOwnPropertyDescriptor(sealed, 'existing'), - { - configurable: false, - enumerable: true, - value: true, - writable: true - }, - 'existing value on sealed object has expected descriptor' - ); - - defineDataProperty(sealed, 'existing', 'new value'); - - st.deepEqual( - Object.getOwnPropertyDescriptor(sealed, 'existing'), - { - configurable: false, - enumerable: true, - value: 'new value', - writable: true - }, - 'existing value on sealed object has changed descriptor' - ); - - st['throws']( - function () { defineDataProperty(sealed, 'new', 'new property'); }, - TypeError, - 'sealed object can not add a new property' - ); - - st.end(); - }); - - t.test('nonextensible object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { - var nonExt = Object.preventExtensions({ existing: true }); - - st.deepEqual( - Object.getOwnPropertyDescriptor(nonExt, 'existing'), - { - configurable: true, - enumerable: true, - value: true, - writable: true - }, - 'existing value on non-extensible object has expected descriptor' - ); - - defineDataProperty(nonExt, 'existing', 'new value', true); - - st.deepEqual( - Object.getOwnPropertyDescriptor(nonExt, 'existing'), - { - configurable: true, - enumerable: false, - value: 'new value', - writable: true - }, - 'existing value on non-extensible object has changed descriptor' - ); - - st['throws']( - function () { defineDataProperty(nonExt, 'new', 'new property'); }, - TypeError, - 'non-extensible object can not add a new property' - ); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/define-data-property/tsconfig.json b/node_modules/define-data-property/tsconfig.json deleted file mode 100644 index 69f060dccdff2bc2089bd1056026de02fe6c760a..0000000000000000000000000000000000000000 --- a/node_modules/define-data-property/tsconfig.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - - /* Language and Environment */ - "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - "noEmit": true, /* Disable emitting files from a compilation. */ - - /* Interop Constraints */ - "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - - /* Completeness */ - // "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "exclude": [ - "coverage" - ] -} diff --git a/node_modules/depd/History.md b/node_modules/depd/History.md deleted file mode 100644 index cd9ebaaa9963f794167f74e00a37d9ceb42e7b91..0000000000000000000000000000000000000000 --- a/node_modules/depd/History.md +++ /dev/null @@ -1,103 +0,0 @@ -2.0.0 / 2018-10-26 -================== - - * Drop support for Node.js 0.6 - * Replace internal `eval` usage with `Function` constructor - * Use instance methods on `process` to check for listeners - -1.1.2 / 2018-01-11 -================== - - * perf: remove argument reassignment - * Support Node.js 0.6 to 9.x - -1.1.1 / 2017-07-27 -================== - - * Remove unnecessary `Buffer` loading - * Support Node.js 0.6 to 8.x - -1.1.0 / 2015-09-14 -================== - - * Enable strict mode in more places - * Support io.js 3.x - * Support io.js 2.x - * Support web browser loading - - Requires bundler like Browserify or webpack - -1.0.1 / 2015-04-07 -================== - - * Fix `TypeError`s when under `'use strict'` code - * Fix useless type name on auto-generated messages - * Support io.js 1.x - * Support Node.js 0.12 - -1.0.0 / 2014-09-17 -================== - - * No changes - -0.4.5 / 2014-09-09 -================== - - * Improve call speed to functions using the function wrapper - * Support Node.js 0.6 - -0.4.4 / 2014-07-27 -================== - - * Work-around v8 generating empty stack traces - -0.4.3 / 2014-07-26 -================== - - * Fix exception when global `Error.stackTraceLimit` is too low - -0.4.2 / 2014-07-19 -================== - - * Correct call site for wrapped functions and properties - -0.4.1 / 2014-07-19 -================== - - * Improve automatic message generation for function properties - -0.4.0 / 2014-07-19 -================== - - * Add `TRACE_DEPRECATION` environment variable - * Remove non-standard grey color from color output - * Support `--no-deprecation` argument - * Support `--trace-deprecation` argument - * Support `deprecate.property(fn, prop, message)` - -0.3.0 / 2014-06-16 -================== - - * Add `NO_DEPRECATION` environment variable - -0.2.0 / 2014-06-15 -================== - - * Add `deprecate.property(obj, prop, message)` - * Remove `supports-color` dependency for node.js 0.8 - -0.1.0 / 2014-06-15 -================== - - * Add `deprecate.function(fn, message)` - * Add `process.on('deprecation', fn)` emitter - * Automatically generate message when omitted from `deprecate()` - -0.0.1 / 2014-06-15 -================== - - * Fix warning for dynamic calls at singe call site - -0.0.0 / 2014-06-15 -================== - - * Initial implementation diff --git a/node_modules/depd/LICENSE b/node_modules/depd/LICENSE deleted file mode 100644 index 248de7af2bd16cc7f2b4d8017bbeb9e7a0b2ccd6..0000000000000000000000000000000000000000 --- a/node_modules/depd/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2018 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/depd/Readme.md b/node_modules/depd/Readme.md deleted file mode 100644 index 043d1ca28403a9460a22fcd403b559b90244458f..0000000000000000000000000000000000000000 --- a/node_modules/depd/Readme.md +++ /dev/null @@ -1,280 +0,0 @@ -# depd - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -Deprecate all the things - -> With great modules comes great responsibility; mark things deprecated! - -## Install - -This module is installed directly using `npm`: - -```sh -$ npm install depd -``` - -This module can also be bundled with systems like -[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), -though by default this module will alter it's API to no longer display or -track deprecations. - -## API - - - -```js -var deprecate = require('depd')('my-module') -``` - -This library allows you to display deprecation messages to your users. -This library goes above and beyond with deprecation warnings by -introspection of the call stack (but only the bits that it is interested -in). - -Instead of just warning on the first invocation of a deprecated -function and never again, this module will warn on the first invocation -of a deprecated function per unique call site, making it ideal to alert -users of all deprecated uses across the code base, rather than just -whatever happens to execute first. - -The deprecation warnings from this module also include the file and line -information for the call into the module that the deprecated function was -in. - -**NOTE** this library has a similar interface to the `debug` module, and -this module uses the calling file to get the boundary for the call stacks, -so you should always create a new `deprecate` object in each file and not -within some central file. - -### depd(namespace) - -Create a new deprecate function that uses the given namespace name in the -messages and will display the call site prior to the stack entering the -file this function was called from. It is highly suggested you use the -name of your module as the namespace. - -### deprecate(message) - -Call this function from deprecated code to display a deprecation message. -This message will appear once per unique caller site. Caller site is the -first call site in the stack in a different file from the caller of this -function. - -If the message is omitted, a message is generated for you based on the site -of the `deprecate()` call and will display the name of the function called, -similar to the name displayed in a stack trace. - -### deprecate.function(fn, message) - -Call this function to wrap a given function in a deprecation message on any -call to the function. An optional message can be supplied to provide a custom -message. - -### deprecate.property(obj, prop, message) - -Call this function to wrap a given property on object in a deprecation message -on any accessing or setting of the property. An optional message can be supplied -to provide a custom message. - -The method must be called on the object where the property belongs (not -inherited from the prototype). - -If the property is a data descriptor, it will be converted to an accessor -descriptor in order to display the deprecation message. - -### process.on('deprecation', fn) - -This module will allow easy capturing of deprecation errors by emitting the -errors as the type "deprecation" on the global `process`. If there are no -listeners for this type, the errors are written to STDERR as normal, but if -there are any listeners, nothing will be written to STDERR and instead only -emitted. From there, you can write the errors in a different format or to a -logging source. - -The error represents the deprecation and is emitted only once with the same -rules as writing to STDERR. The error has the following properties: - - - `message` - This is the message given by the library - - `name` - This is always `'DeprecationError'` - - `namespace` - This is the namespace the deprecation came from - - `stack` - This is the stack of the call to the deprecated thing - -Example `error.stack` output: - -``` -DeprecationError: my-cool-module deprecated oldfunction - at Object. ([eval]-wrapper:6:22) - at Module._compile (module.js:456:26) - at evalScript (node.js:532:25) - at startup (node.js:80:7) - at node.js:902:3 -``` - -### process.env.NO_DEPRECATION - -As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` -is provided as a quick solution to silencing deprecation warnings from being -output. The format of this is similar to that of `DEBUG`: - -```sh -$ NO_DEPRECATION=my-module,othermod node app.js -``` - -This will suppress deprecations from being output for "my-module" and "othermod". -The value is a list of comma-separated namespaces. To suppress every warning -across all namespaces, use the value `*` for a namespace. - -Providing the argument `--no-deprecation` to the `node` executable will suppress -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not suppress the deperecations given to any "deprecation" -event listeners, just the output to STDERR. - -### process.env.TRACE_DEPRECATION - -As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` -is provided as a solution to getting more detailed location information in deprecation -warnings by including the entire stack trace. The format of this is the same as -`NO_DEPRECATION`: - -```sh -$ TRACE_DEPRECATION=my-module,othermod node app.js -``` - -This will include stack traces for deprecations being output for "my-module" and -"othermod". The value is a list of comma-separated namespaces. To trace every -warning across all namespaces, use the value `*` for a namespace. - -Providing the argument `--trace-deprecation` to the `node` executable will trace -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. - -## Display - -![message](files/message.png) - -When a user calls a function in your library that you mark deprecated, they -will see the following written to STDERR (in the given colors, similar colors -and layout to the `debug` module): - -``` -bright cyan bright yellow -| | reset cyan -| | | | -▼ ▼ ▼ ▼ -my-cool-module deprecated oldfunction [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ -| | | | -namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -If the user redirects their STDERR to a file or somewhere that does not support -colors, they see (similar layout to the `debug` module): - -``` -Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ ▲ -| | | | | -timestamp of message namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -## Examples - -### Deprecating all calls to a function - -This will display a deprecated message about "oldfunction" being deprecated -from "my-module" on STDERR. - -```js -var deprecate = require('depd')('my-cool-module') - -// message automatically derived from function name -// Object.oldfunction -exports.oldfunction = deprecate.function(function oldfunction () { - // all calls to function are deprecated -}) - -// specific message -exports.oldfunction = deprecate.function(function () { - // all calls to function are deprecated -}, 'oldfunction') -``` - -### Conditionally deprecating a function call - -This will display a deprecated message about "weirdfunction" being deprecated -from "my-module" on STDERR when called with less than 2 arguments. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } -} -``` - -When calling `deprecate` as a function, the warning is counted per call site -within your own module, so you can display different deprecations depending -on different situations and the users will still get all the warnings: - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } else if (typeof arguments[0] !== 'string') { - // calls with non-string first argument are deprecated - deprecate('weirdfunction non-string first arg') - } -} -``` - -### Deprecating property access - -This will display a deprecated message about "oldprop" being deprecated -from "my-module" on STDERR when accessed. A deprecation will be displayed -when setting the value and when getting the value. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.oldprop = 'something' - -// message automatically derives from property name -deprecate.property(exports, 'oldprop') - -// explicit message -deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') -``` - -## License - -[MIT](LICENSE) - -[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/nodejs-depd/master?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd -[coveralls-image]: https://badgen.net/coveralls/c/github/dougwilson/nodejs-depd/master -[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master -[node-image]: https://badgen.net/npm/node/depd -[node-url]: https://nodejs.org/en/download/ -[npm-downloads-image]: https://badgen.net/npm/dm/depd -[npm-url]: https://npmjs.org/package/depd -[npm-version-image]: https://badgen.net/npm/v/depd -[travis-image]: https://badgen.net/travis/dougwilson/nodejs-depd/master?label=linux -[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd diff --git a/node_modules/depd/index.js b/node_modules/depd/index.js deleted file mode 100644 index 1bf2fcfdeffc984e5ad792eec08744c29d4a4590..0000000000000000000000000000000000000000 --- a/node_modules/depd/index.js +++ /dev/null @@ -1,538 +0,0 @@ -/*! - * depd - * Copyright(c) 2014-2018 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var relative = require('path').relative - -/** - * Module exports. - */ - -module.exports = depd - -/** - * Get the path to base files on. - */ - -var basePath = process.cwd() - -/** - * Determine if namespace is contained in the string. - */ - -function containsNamespace (str, namespace) { - var vals = str.split(/[ ,]+/) - var ns = String(namespace).toLowerCase() - - for (var i = 0; i < vals.length; i++) { - var val = vals[i] - - // namespace contained - if (val && (val === '*' || val.toLowerCase() === ns)) { - return true - } - } - - return false -} - -/** - * Convert a data descriptor to accessor descriptor. - */ - -function convertDataDescriptorToAccessor (obj, prop, message) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - var value = descriptor.value - - descriptor.get = function getter () { return value } - - if (descriptor.writable) { - descriptor.set = function setter (val) { return (value = val) } - } - - delete descriptor.value - delete descriptor.writable - - Object.defineProperty(obj, prop, descriptor) - - return descriptor -} - -/** - * Create arguments string to keep arity. - */ - -function createArgumentsString (arity) { - var str = '' - - for (var i = 0; i < arity; i++) { - str += ', arg' + i - } - - return str.substr(2) -} - -/** - * Create stack string from stack. - */ - -function createStackString (stack) { - var str = this.name + ': ' + this.namespace - - if (this.message) { - str += ' deprecated ' + this.message - } - - for (var i = 0; i < stack.length; i++) { - str += '\n at ' + stack[i].toString() - } - - return str -} - -/** - * Create deprecate for namespace in caller. - */ - -function depd (namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - var stack = getStack() - var site = callSiteLocation(stack[1]) - var file = site[0] - - function deprecate (message) { - // call to self as log - log.call(deprecate, message) - } - - deprecate._file = file - deprecate._ignored = isignored(namespace) - deprecate._namespace = namespace - deprecate._traced = istraced(namespace) - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Determine if event emitter has listeners of a given type. - * - * The way to do this check is done three different ways in Node.js >= 0.8 - * so this consolidates them into a minimal set using instance methods. - * - * @param {EventEmitter} emitter - * @param {string} type - * @returns {boolean} - * @private - */ - -function eehaslisteners (emitter, type) { - var count = typeof emitter.listenerCount !== 'function' - ? emitter.listeners(type).length - : emitter.listenerCount(type) - - return count > 0 -} - -/** - * Determine if namespace is ignored. - */ - -function isignored (namespace) { - if (process.noDeprecation) { - // --no-deprecation support - return true - } - - var str = process.env.NO_DEPRECATION || '' - - // namespace ignored - return containsNamespace(str, namespace) -} - -/** - * Determine if namespace is traced. - */ - -function istraced (namespace) { - if (process.traceDeprecation) { - // --trace-deprecation support - return true - } - - var str = process.env.TRACE_DEPRECATION || '' - - // namespace traced - return containsNamespace(str, namespace) -} - -/** - * Display deprecation message. - */ - -function log (message, site) { - var haslisteners = eehaslisteners(process, 'deprecation') - - // abort early if no destination - if (!haslisteners && this._ignored) { - return - } - - var caller - var callFile - var callSite - var depSite - var i = 0 - var seen = false - var stack = getStack() - var file = this._file - - if (site) { - // provided site - depSite = site - callSite = callSiteLocation(stack[1]) - callSite.name = depSite.name - file = callSite[0] - } else { - // get call site - i = 2 - depSite = callSiteLocation(stack[i]) - callSite = depSite - } - - // get caller of deprecated thing in relation to file - for (; i < stack.length; i++) { - caller = callSiteLocation(stack[i]) - callFile = caller[0] - - if (callFile === file) { - seen = true - } else if (callFile === this._file) { - file = this._file - } else if (seen) { - break - } - } - - var key = caller - ? depSite.join(':') + '__' + caller.join(':') - : undefined - - if (key !== undefined && key in this._warned) { - // already warned - return - } - - this._warned[key] = true - - // generate automatic message from call site - var msg = message - if (!msg) { - msg = callSite === depSite || !callSite.name - ? defaultMessage(depSite) - : defaultMessage(callSite) - } - - // emit deprecation if listeners exist - if (haslisteners) { - var err = DeprecationError(this._namespace, msg, stack.slice(i)) - process.emit('deprecation', err) - return - } - - // format and write message - var format = process.stderr.isTTY - ? formatColor - : formatPlain - var output = format.call(this, msg, caller, stack.slice(i)) - process.stderr.write(output + '\n', 'utf8') -} - -/** - * Get call site location as array. - */ - -function callSiteLocation (callSite) { - var file = callSite.getFileName() || '' - var line = callSite.getLineNumber() - var colm = callSite.getColumnNumber() - - if (callSite.isEval()) { - file = callSite.getEvalOrigin() + ', ' + file - } - - var site = [file, line, colm] - - site.callSite = callSite - site.name = callSite.getFunctionName() - - return site -} - -/** - * Generate a default message from the site. - */ - -function defaultMessage (site) { - var callSite = site.callSite - var funcName = site.name - - // make useful anonymous name - if (!funcName) { - funcName = '' - } - - var context = callSite.getThis() - var typeName = context && callSite.getTypeName() - - // ignore useless type name - if (typeName === 'Object') { - typeName = undefined - } - - // make useful type name - if (typeName === 'Function') { - typeName = context.name || typeName - } - - return typeName && callSite.getMethodName() - ? typeName + '.' + funcName - : funcName -} - -/** - * Format deprecation message without color. - */ - -function formatPlain (msg, caller, stack) { - var timestamp = new Date().toUTCString() - - var formatted = timestamp + - ' ' + this._namespace + - ' deprecated ' + msg - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n at ' + stack[i].toString() - } - - return formatted - } - - if (caller) { - formatted += ' at ' + formatLocation(caller) - } - - return formatted -} - -/** - * Format deprecation message with color. - */ - -function formatColor (msg, caller, stack) { - var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan - ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow - ' \x1b[0m' + msg + '\x1b[39m' // reset - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan - } - - return formatted - } - - if (caller) { - formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan - } - - return formatted -} - -/** - * Format call site location. - */ - -function formatLocation (callSite) { - return relative(basePath, callSite[0]) + - ':' + callSite[1] + - ':' + callSite[2] -} - -/** - * Get the stack as array of call sites. - */ - -function getStack () { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = Math.max(10, limit) - - // capture the stack - Error.captureStackTrace(obj) - - // slice this function off the top - var stack = obj.stack.slice(1) - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack -} - -/** - * Capture call site stack from v8. - */ - -function prepareObjectStackTrace (obj, stack) { - return stack -} - -/** - * Return a wrapped function in a deprecation message. - */ - -function wrapfunction (fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - var args = createArgumentsString(fn.length) - var stack = getStack() - var site = callSiteLocation(stack[1]) - - site.name = fn.name - - // eslint-disable-next-line no-new-func - var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', - '"use strict"\n' + - 'return function (' + args + ') {' + - 'log.call(deprecate, message, site)\n' + - 'return fn.apply(this, arguments)\n' + - '}')(fn, log, this, message, site) - - return deprecatedfn -} - -/** - * Wrap property in a deprecation message. - */ - -function wrapproperty (obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } - - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - // set site name - site.name = prop - - // convert data descriptor - if ('value' in descriptor) { - descriptor = convertDataDescriptorToAccessor(obj, prop, message) - } - - var get = descriptor.get - var set = descriptor.set - - // wrap getter - if (typeof get === 'function') { - descriptor.get = function getter () { - log.call(deprecate, message, site) - return get.apply(this, arguments) - } - } - - // wrap setter - if (typeof set === 'function') { - descriptor.set = function setter () { - log.call(deprecate, message, site) - return set.apply(this, arguments) - } - } - - Object.defineProperty(obj, prop, descriptor) -} - -/** - * Create DeprecationError for deprecation - */ - -function DeprecationError (namespace, message, stack) { - var error = new Error() - var stackString - - Object.defineProperty(error, 'constructor', { - value: DeprecationError - }) - - Object.defineProperty(error, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }) - - Object.defineProperty(error, 'name', { - enumerable: false, - configurable: true, - value: 'DeprecationError', - writable: true - }) - - Object.defineProperty(error, 'namespace', { - configurable: true, - enumerable: false, - value: namespace, - writable: true - }) - - Object.defineProperty(error, 'stack', { - configurable: true, - enumerable: false, - get: function () { - if (stackString !== undefined) { - return stackString - } - - // prepare stack trace - return (stackString = createStackString.call(this, stack)) - }, - set: function setter (val) { - stackString = val - } - }) - - return error -} diff --git a/node_modules/depd/lib/browser/index.js b/node_modules/depd/lib/browser/index.js deleted file mode 100644 index 6be45cc20b33f20dcdc580b9709f1a4a20bb87a1..0000000000000000000000000000000000000000 --- a/node_modules/depd/lib/browser/index.js +++ /dev/null @@ -1,77 +0,0 @@ -/*! - * depd - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = depd - -/** - * Create deprecate for namespace in caller. - */ - -function depd (namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - function deprecate (message) { - // no-op in browser - } - - deprecate._file = undefined - deprecate._ignored = true - deprecate._namespace = namespace - deprecate._traced = false - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Return a wrapped function in a deprecation message. - * - * This is a no-op version of the wrapper, which does nothing but call - * validation. - */ - -function wrapfunction (fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - return fn -} - -/** - * Wrap property in a deprecation message. - * - * This is a no-op version of the wrapper, which does nothing but call - * validation. - */ - -function wrapproperty (obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } -} diff --git a/node_modules/depd/package.json b/node_modules/depd/package.json deleted file mode 100644 index 3857e199184a0a3f0d921e740525278af0f86ff3..0000000000000000000000000000000000000000 --- a/node_modules/depd/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "depd", - "description": "Deprecate all the things", - "version": "2.0.0", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "deprecate", - "deprecated" - ], - "repository": "dougwilson/nodejs-depd", - "browser": "lib/browser/index.js", - "devDependencies": { - "benchmark": "2.1.4", - "beautify-benchmark": "0.2.4", - "eslint": "5.7.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.14.0", - "eslint-plugin-markdown": "1.0.0-beta.7", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", - "eslint-plugin-standard": "4.0.0", - "istanbul": "0.4.5", - "mocha": "5.2.0", - "safe-buffer": "5.1.2", - "uid-safe": "2.1.5" - }, - "files": [ - "lib/", - "History.md", - "LICENSE", - "index.js", - "Readme.md" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail test/", - "test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary", - "test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary" - } -} diff --git a/node_modules/destroy/LICENSE b/node_modules/destroy/LICENSE deleted file mode 100644 index 0e2c35f0ea23b51310f40689c96e3f8e1da8d3d4..0000000000000000000000000000000000000000 --- a/node_modules/destroy/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com -Copyright (c) 2015-2022 Douglas Christopher Wilson doug@somethingdoug.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/destroy/README.md b/node_modules/destroy/README.md deleted file mode 100644 index e7701aee746cafca9d5d09056d0b91071b4b5dc3..0000000000000000000000000000000000000000 --- a/node_modules/destroy/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# destroy - -[![NPM version][npm-image]][npm-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -Destroy a stream. - -This module is meant to ensure a stream gets destroyed, handling different APIs -and Node.js bugs. - -## API - -```js -var destroy = require('destroy') -``` - -### destroy(stream [, suppress]) - -Destroy the given stream, and optionally suppress any future `error` events. - -In most cases, this is identical to a simple `stream.destroy()` call. The rules -are as follows for a given stream: - - 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` - and add a listener to the `open` event to call `stream.close()` if it is - fired. This is for a Node.js bug that will leak a file descriptor if - `.destroy()` is called before `open`. - 2. If the `stream` is an instance of a zlib stream, then call `stream.destroy()` - and close the underlying zlib handle if open, otherwise call `stream.close()`. - This is for consistency across Node.js versions and a Node.js bug that will - leak a native zlib handle. - 3. If the `stream` is not an instance of `Stream`, then nothing happens. - 4. If the `stream` has a `.destroy()` method, then call it. - -The function returns the `stream` passed in as the argument. - -## Example - -```js -var destroy = require('destroy') - -var fs = require('fs') -var stream = fs.createReadStream('package.json') - -// ... and later -destroy(stream) -``` - -[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square -[npm-url]: https://npmjs.org/package/destroy -[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square -[github-url]: https://github.com/stream-utils/destroy/tags -[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master -[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/destroy -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/stream-utils/destroy/ci/master?label=ci&style=flat-square -[github-actions-ci-url]: https://github.com/stream-utils/destroy/actions/workflows/ci.yml diff --git a/node_modules/destroy/index.js b/node_modules/destroy/index.js deleted file mode 100644 index 7fd5c09363796a9276e332ce6bb225d238fb0a85..0000000000000000000000000000000000000000 --- a/node_modules/destroy/index.js +++ /dev/null @@ -1,209 +0,0 @@ -/*! - * destroy - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var EventEmitter = require('events').EventEmitter -var ReadStream = require('fs').ReadStream -var Stream = require('stream') -var Zlib = require('zlib') - -/** - * Module exports. - * @public - */ - -module.exports = destroy - -/** - * Destroy the given stream, and optionally suppress any future `error` events. - * - * @param {object} stream - * @param {boolean} suppress - * @public - */ - -function destroy (stream, suppress) { - if (isFsReadStream(stream)) { - destroyReadStream(stream) - } else if (isZlibStream(stream)) { - destroyZlibStream(stream) - } else if (hasDestroy(stream)) { - stream.destroy() - } - - if (isEventEmitter(stream) && suppress) { - stream.removeAllListeners('error') - stream.addListener('error', noop) - } - - return stream -} - -/** - * Destroy a ReadStream. - * - * @param {object} stream - * @private - */ - -function destroyReadStream (stream) { - stream.destroy() - - if (typeof stream.close === 'function') { - // node.js core bug work-around - stream.on('open', onOpenClose) - } -} - -/** - * Close a Zlib stream. - * - * Zlib streams below Node.js 4.5.5 have a buggy implementation - * of .close() when zlib encountered an error. - * - * @param {object} stream - * @private - */ - -function closeZlibStream (stream) { - if (stream._hadError === true) { - var prop = stream._binding === null - ? '_binding' - : '_handle' - - stream[prop] = { - close: function () { this[prop] = null } - } - } - - stream.close() -} - -/** - * Destroy a Zlib stream. - * - * Zlib streams don't have a destroy function in Node.js 6. On top of that - * simply calling destroy on a zlib stream in Node.js 8+ will result in a - * memory leak. So until that is fixed, we need to call both close AND destroy. - * - * PR to fix memory leak: https://github.com/nodejs/node/pull/23734 - * - * In Node.js 6+8, it's important that destroy is called before close as the - * stream would otherwise emit the error 'zlib binding closed'. - * - * @param {object} stream - * @private - */ - -function destroyZlibStream (stream) { - if (typeof stream.destroy === 'function') { - // node.js core bug work-around - // istanbul ignore if: node.js 0.8 - if (stream._binding) { - // node.js < 0.10.0 - stream.destroy() - if (stream._processing) { - stream._needDrain = true - stream.once('drain', onDrainClearBinding) - } else { - stream._binding.clear() - } - } else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) { - // node.js >= 12, ^11.1.0, ^10.15.1 - stream.destroy() - } else if (stream._destroy && typeof stream.close === 'function') { - // node.js 7, 8 - stream.destroyed = true - stream.close() - } else { - // fallback - // istanbul ignore next - stream.destroy() - } - } else if (typeof stream.close === 'function') { - // node.js < 8 fallback - closeZlibStream(stream) - } -} - -/** - * Determine if stream has destroy. - * @private - */ - -function hasDestroy (stream) { - return stream instanceof Stream && - typeof stream.destroy === 'function' -} - -/** - * Determine if val is EventEmitter. - * @private - */ - -function isEventEmitter (val) { - return val instanceof EventEmitter -} - -/** - * Determine if stream is fs.ReadStream stream. - * @private - */ - -function isFsReadStream (stream) { - return stream instanceof ReadStream -} - -/** - * Determine if stream is Zlib stream. - * @private - */ - -function isZlibStream (stream) { - return stream instanceof Zlib.Gzip || - stream instanceof Zlib.Gunzip || - stream instanceof Zlib.Deflate || - stream instanceof Zlib.DeflateRaw || - stream instanceof Zlib.Inflate || - stream instanceof Zlib.InflateRaw || - stream instanceof Zlib.Unzip -} - -/** - * No-op function. - * @private - */ - -function noop () {} - -/** - * On drain handler to clear binding. - * @private - */ - -// istanbul ignore next: node.js 0.8 -function onDrainClearBinding () { - this._binding.clear() -} - -/** - * On open handler to close stream. - * @private - */ - -function onOpenClose () { - if (typeof this.fd === 'number') { - // actually close down the fd - this.close() - } -} diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json deleted file mode 100644 index c85e438378a65c39b3ccd4e0316d1855cf5b7887..0000000000000000000000000000000000000000 --- a/node_modules/destroy/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "destroy", - "description": "destroy a stream if possible", - "version": "1.2.0", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com", - "twitter": "https://twitter.com/jongleberry" - }, - "contributors": [ - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "stream-utils/destroy", - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.2", - "nyc": "15.1.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - }, - "files": [ - "index.js", - "LICENSE" - ], - "keywords": [ - "stream", - "streams", - "destroy", - "cleanup", - "leak", - "fd" - ] -} diff --git a/node_modules/detect-node-es/LICENSE b/node_modules/detect-node-es/LICENSE deleted file mode 100644 index 31133564faa539d06a66d467163a5b42931c2e1d..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Ilya Kantor - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/detect-node-es/Readme.md b/node_modules/detect-node-es/Readme.md deleted file mode 100644 index ca47dfd44fce141d40f35a14829c3303ade93929..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/Readme.md +++ /dev/null @@ -1,39 +0,0 @@ -## detect-node -> This is a fork of `detect-node`. - -Differences: -- uses named export {isNode} -- has d.ts integrated -- supports ESM - -### Install - -```shell -npm install --save detect-node-es -``` - -### Usage: - -```diff --var isNode = require('detect-node'); -+var {isNode} = require('detect-node-es'); - -if (isNode) { - console.log("Running under Node.JS"); -} else { - alert("Hello from browser (or whatever not-a-node env)"); -} -``` - -The check is performed as: -```js -module.exports = false; - -// Only Node.JS has a process variable that is of [[Class]] process -try { - module.exports = Object.prototype.toString.call(global.process) === '[object process]' -} catch(e) {} - -``` - -Thanks to Ingvar Stepanyan for the initial idea. This check is both **the most reliable I could find** and it does not use `process` env directly, which would cause browserify to include it into the build. diff --git a/node_modules/detect-node-es/es5/browser.js b/node_modules/detect-node-es/es5/browser.js deleted file mode 100644 index b82dc83ff9be92ae0a56ccadf6ac6c6c2c9cba7f..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/es5/browser.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports.isNode = false; - diff --git a/node_modules/detect-node-es/es5/node.d.ts b/node_modules/detect-node-es/es5/node.d.ts deleted file mode 100644 index 99a0ad753ffdac9586ea786d6f71144daac868d5..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/es5/node.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * returns true if the current environment is NodeJS - */ -export declare const isNode: boolean; \ No newline at end of file diff --git a/node_modules/detect-node-es/es5/node.js b/node_modules/detect-node-es/es5/node.js deleted file mode 100644 index 13f9217c4bda8910c67d3b687d402e90d9a6b536..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/es5/node.js +++ /dev/null @@ -1,2 +0,0 @@ -// Only Node.JS has a process variable that is of [[Class]] process -module.exports.isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; diff --git a/node_modules/detect-node-es/esm/browser.js b/node_modules/detect-node-es/esm/browser.js deleted file mode 100644 index 10742b61f76cacf6489fd2f84da8d7d4108117da..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/esm/browser.js +++ /dev/null @@ -1,2 +0,0 @@ -export const isNode = false; - diff --git a/node_modules/detect-node-es/esm/node.js b/node_modules/detect-node-es/esm/node.js deleted file mode 100644 index 8b245b5d2c1ba6262d61fca2998df29da6e7280a..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/esm/node.js +++ /dev/null @@ -1,2 +0,0 @@ -// Only Node.JS has a process variable that is of [[Class]] process -export const isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; diff --git a/node_modules/detect-node-es/package.json b/node_modules/detect-node-es/package.json deleted file mode 100644 index 7fe4441bd56e4cfcc0efce7b45f7c4f2a365227d..0000000000000000000000000000000000000000 --- a/node_modules/detect-node-es/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "detect-node-es", - "version": "1.1.0", - "description": "Detect Node.JS (as opposite to browser environment). ESM modification", - "main": "es5/node.js", - "module": "esm/node.js", - "browser": { - "./es5/node.js": "./es5/browser.js", - "./esm/node.js": "./esm/browser.js" - }, - "types": "es5/node.d.ts", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/thekashey/detect-node" - }, - "keywords": [ - "detect", - "node" - ], - "author": "Ilya Kantor", - "license": "MIT", - "bugs": { - "url": "https://github.com/thekashey/detect-node/issues" - }, - "homepage": "https://github.com/thekashey/detect-node" -} diff --git a/node_modules/dom-helpers/LICENSE b/node_modules/dom-helpers/LICENSE deleted file mode 100644 index 284f555dbe2e5ab732871bcf74ddcb4444c83ea0..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jason Quense - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/node_modules/dom-helpers/README.md b/node_modules/dom-helpers/README.md deleted file mode 100644 index 1ae4dd1d5b5257513d35d55bafb1ce8b7e08b6b3..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# dom-helpers - -tiny modular DOM lib for ie9+ - -## Install - -```sh -npm i -S dom-helpers -``` - -Mostly just naive wrappers around common DOM API inconsistencies, Cross browser work is minimal and mostly taken from jQuery. This library doesn't do a lot to normalize behavior across browsers, it mostly seeks to provide a common interface, and eliminate the need to write the same damn `if (ie9)` statements in every project. - -For example `on()` works in all browsers ie9+ but it uses the native event system so actual event oddities will continue to exist. If you need **robust** cross-browser support, use jQuery. If you are just tired of rewriting: - -```js -if (document.addEventListener) - return (node, eventName, handler, capture) => - node.addEventListener(eventName, handler, capture || false) -else if (document.attachEvent) - return (node, eventName, handler) => - node.attachEvent('on' + eventName, handler) -``` - -over and over again, or you need a ok `getComputedStyle` polyfill but don't want to include all of jQuery, use this. - -dom-helpers does expect certain, polyfillable, es5 features to be present for which you can use `es5-shim` where needed - -The real advantage to this collection is that any method can be required individually, meaning bundlers like webpack will only include the exact methods you use. This is great for environments where jQuery doesn't make sense, such as `React` where you only occasionally need to do direct DOM manipulation. - -All methods are exported as a flat namesapce - -```js -var helpers = require('dom-helpers') -var offset = require('dom-helpers/offset') - -// style is a function -require('dom-helpers/css')(node, { width: '40px' }) -``` - -- dom-helpers - - `ownerDocument(element)`: returns the element's document owner - - `ownerWindow(element)`: returns the element's document window - - `activeElement`: return focused element safely - - `querySelectorAll(element, selector)`: optimized qsa, uses `getElementBy{Id|TagName|ClassName}` if it can. - - `contains(container, element)` - - `height(element, useClientHeight)` - - `width(element, useClientWidth)` - - `matches(element, selector)` - - `offset(element)` -> `{ top: Number, left: Number, height: Number, width: Number}` - - `offsetParent(element)`: return the parent node that the element is offset from - - `position(element, [offsetParent]`: return "offset" of the node to its offsetParent, optionally you can specify the offset parent if different than the "real" one - - `scrollTop(element, [value])` - - `scrollLeft(element, [value])` - - `scrollParent(element)` - - `addClass(element, className)` - - `removeClass(element, className)` - - `hasClass(element, className)` - - `toggleClass(element, className)` - - `style(element, propName)` or `style(element, objectOfPropValues)` - - `getComputedStyle(element)` -> `getPropertyValue(name)` - - `animate(node, properties, duration, easing, callback)` programmatically start css transitions - - `transitionEnd(node, handler, [duration], [padding])` listens for transition end, and ensures that the handler if called even if the transition fails to fire its end event. Will attempt to read duration from the element, otherwise one can be provided - - `addEventListener(node, eventName, handler, [options])`: - - `removeEventListener(node, eventName, handler, [options])`: - - `listen(node, eventName, handler, [options])`: wraps `addEventlistener` and returns a function that calls `removeEventListener` for you - - `filter(selector, fn)`: returns a function handler that only fires when the target matches or is contained in the selector ex: `on(list, 'click', filter('li > a', handler))` - - `requestAnimationFrame(cb)` returns an ID for canceling - - `cancelAnimationFrame(id)` - - `scrollbarSize([recalc])` returns the scrollbar's width size in pixels - - `scrollTo(element, [scrollParent])` diff --git a/node_modules/dom-helpers/activeElement/package.json b/node_modules/dom-helpers/activeElement/package.json deleted file mode 100644 index 1cc9b1ced305da9953d19ba9465159504ab6123b..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/activeElement/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/activeElement", - "private": true, - "main": "../cjs/activeElement.js", - "module": "../esm/activeElement.js", - "types": "../esm/activeElement.d.ts" -} diff --git a/node_modules/dom-helpers/addClass/package.json b/node_modules/dom-helpers/addClass/package.json deleted file mode 100644 index 5193754fe2aba52620710823030c84a7f7f2d2dc..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/addClass/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/addClass", - "private": true, - "main": "../cjs/addClass.js", - "module": "../esm/addClass.js", - "types": "../esm/addClass.d.ts" -} diff --git a/node_modules/dom-helpers/addEventListener/package.json b/node_modules/dom-helpers/addEventListener/package.json deleted file mode 100644 index cd6a6baa5e7bb510a8c107160b8a7c6a634ed195..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/addEventListener/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/addEventListener", - "private": true, - "main": "../cjs/addEventListener.js", - "module": "../esm/addEventListener.js", - "types": "../esm/addEventListener.d.ts" -} diff --git a/node_modules/dom-helpers/animate/package.json b/node_modules/dom-helpers/animate/package.json deleted file mode 100644 index e2e90c4af3ac3b556a2a7c45dc2e5554feb750e9..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/animate/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/animate", - "private": true, - "main": "../cjs/animate.js", - "module": "../esm/animate.js", - "types": "../esm/animate.d.ts" -} diff --git a/node_modules/dom-helpers/animationFrame/package.json b/node_modules/dom-helpers/animationFrame/package.json deleted file mode 100644 index c6539610c794e0adf55c7850ef8301e3faee2d45..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/animationFrame/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/animationFrame", - "private": true, - "main": "../cjs/animationFrame.js", - "module": "../esm/animationFrame.js", - "types": "../esm/animationFrame.d.ts" -} diff --git a/node_modules/dom-helpers/attribute/package.json b/node_modules/dom-helpers/attribute/package.json deleted file mode 100644 index b3257bbd9994183adec173da696315c7b57350a3..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/attribute/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/attribute", - "private": true, - "main": "../cjs/attribute.js", - "module": "../esm/attribute.js", - "types": "../esm/attribute.d.ts" -} diff --git a/node_modules/dom-helpers/camelize/package.json b/node_modules/dom-helpers/camelize/package.json deleted file mode 100644 index 0dc66908e3f8fa4c43dd483789314cf6e287e0a8..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/camelize/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/camelize", - "private": true, - "main": "../cjs/camelize.js", - "module": "../esm/camelize.js", - "types": "../esm/camelize.d.ts" -} diff --git a/node_modules/dom-helpers/camelizeStyle/package.json b/node_modules/dom-helpers/camelizeStyle/package.json deleted file mode 100644 index 91efff44648906fe9bd24ce337ec2f851dc503f4..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/camelizeStyle/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/camelizeStyle", - "private": true, - "main": "../cjs/camelizeStyle.js", - "module": "../esm/camelizeStyle.js", - "types": "../esm/camelizeStyle.d.ts" -} diff --git a/node_modules/dom-helpers/canUseDOM/package.json b/node_modules/dom-helpers/canUseDOM/package.json deleted file mode 100644 index bc756a5301396e89130291a96834ae482ad66be0..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/canUseDOM/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/canUseDOM", - "private": true, - "main": "../cjs/canUseDOM.js", - "module": "../esm/canUseDOM.js", - "types": "../esm/canUseDOM.d.ts" -} diff --git a/node_modules/dom-helpers/childElements/package.json b/node_modules/dom-helpers/childElements/package.json deleted file mode 100644 index bfb8581fb1673ad47f6f721a62066f8e4a50f110..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/childElements/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/childElements", - "private": true, - "main": "../cjs/childElements.js", - "module": "../esm/childElements.js", - "types": "../esm/childElements.d.ts" -} diff --git a/node_modules/dom-helpers/childNodes/package.json b/node_modules/dom-helpers/childNodes/package.json deleted file mode 100644 index e1129133acf3471f17f336938d898f9fbaae819a..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/childNodes/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "dom-helpers/childNodes", - "private": true, - "main": "../cjs/childNodes.js", - "module": "../esm/childNodes.js", - "types": "../esm/childNodes.d.ts" -} diff --git a/node_modules/dom-helpers/cjs/activeElement.d.ts b/node_modules/dom-helpers/cjs/activeElement.d.ts deleted file mode 100644 index 9862eef69133eb88f43ccaffb3c2ad79e57b1c72..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/cjs/activeElement.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Returns the actively focused element safely. - * - * @param doc the document to check - */ -export default function activeElement(doc?: Document): Element | null; diff --git a/node_modules/dom-helpers/cjs/activeElement.js b/node_modules/dom-helpers/cjs/activeElement.js deleted file mode 100644 index 5c83c80f9cc245a88dffdef8909adf29e5362adb..0000000000000000000000000000000000000000 --- a/node_modules/dom-helpers/cjs/activeElement.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -exports.__esModule = true; -exports.default = activeElement; - -var _ownerDocument = _interopRequireDefault(require("./ownerDocument")); - -/** - * Returns the actively focused element safely. - * - * @param doc the document to check - */ -function activeElement(doc) { - if (doc === void 0) { - doc = (0, _ownerDocument.default)(); - } - - // Support: IE 9 only - // IE9 throws an "Unspecified error" accessing document.activeElement from an