docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"setters.mjs","sources":["../../../../src/render/utils/setters.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n"],"names":[],"mappings":";;;;AAWA;;;AAGG;AACH,SAAS,cAAc,CACnB,aAA4B,EAC5B,GAAW,EACX,KAA0B,EAAA;AAE1B,IAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC7B,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,KAAK,CAAC;IAC3C;SAAO;QACH,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACnD;AACJ;AAEA,SAAS,4BAA4B,CACjC,CAA2B,EAAA;;IAG3B,OAAO,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1D;AAEM,SAAU,SAAS,CACrB,aAA4B,EAC5B,UAA+B,EAAA;IAE/B,MAAM,QAAQ,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,CAAC;AAC1D,IAAA,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,QAAQ,IAAI,EAAE;IAEvE,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE;AAExC,IAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,4BAA4B,CACtC,MAAM,CAAC,GAA0B,CAAQ,CAC5C;AACD,QAAA,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,KAA4B,CAAC;IACpE;AACJ;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"copyright.js","sources":["../../../src/icons/copyright.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Copyright\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTQuODMgMTQuODNhNCA0IDAgMSAxIDAtNS42NiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/copyright\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Copyright = createLucideIcon('Copyright', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M14.83 14.83a4 4 0 1 1 0-5.66', key: '1i56pz' }],\n]);\n\nexport default Copyright;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,15 @@
import { Children, isValidElement } from 'react';
const getChildKey = (child) => child.key || "";
function onlyElements(children) {
const filtered = [];
// We use forEach here instead of map as map mutates the component key by preprending `.$`
Children.forEach(children, (child) => {
if (isValidElement(child))
filtered.push(child);
});
return filtered;
}
export { getChildKey, onlyElements };
//# sourceMappingURL=utils.mjs.map
@@ -0,0 +1,52 @@
import { removeBrackets, camelcaseOptionName } from "./utils.ts";
interface OptionConfig {
default?: any;
type?: any[];
}
export default class Option {
/** Option name */
name: string;
/** Option name and aliases */
names: string[];
isBoolean?: boolean; // `required` will be a boolean for options with brackets
required?: boolean;
config: OptionConfig;
negated: boolean;
constructor(public rawName: string, public description: string, config?: OptionConfig) {
this.config = Object.assign({}, config); // You may use cli.option('--env.* [value]', 'desc') to denote a dot-nested option
rawName = rawName.replace(/\.\*/g, '');
this.negated = false;
this.names = removeBrackets(rawName).split(',').map((v: string) => {
let name = v.trim().replace(/^-{1,2}/, '');
if (name.startsWith('no-')) {
this.negated = true;
name = name.replace(/^no-/, '');
}
return camelcaseOptionName(name);
}).sort((a, b) => a.length > b.length ? 1 : -1); // Sort names
// Use the longest name (last one) as actual option name
this.name = this.names[this.names.length - 1];
if (this.negated && this.config.default == null) {
this.config.default = true;
}
if (rawName.includes('<')) {
this.required = true;
} else if (rawName.includes('[')) {
this.required = false;
} else {
// No arg needed, it's boolean flag
this.isBoolean = true;
}
}
}
export type { OptionConfig };
@@ -0,0 +1,106 @@
"use strict";
const format = require("date-manip/dist/format");
const isWhatType = require("is-what-type");
const compilePattern = require("./compilePattern.js");
const formatMessage = require("./formatMessage.js");
const pad = require("./pad.js");
function literalConverter(text) {
return () => text;
}
function dateConverter(dateFormat = "ISO") {
return (event) => {
return format(event.timestamp, dateFormat);
};
}
function levelConverter(minWidth = 0, alignLeft = true) {
return (event) => {
return pad(event.levelName, minWidth, alignLeft);
};
}
function loggerConverter(minWidth = 0, alignLeft = true) {
return (event) => {
const { loggerName } = event;
return pad(loggerName, minWidth, alignLeft);
};
}
function messageConverter(minWidth = 0, maxLength = 0, alignLeft = true) {
return (event) => {
return formatMessage(event.message, (msg) => {
if (maxLength > 0 && msg.length > maxLength) {
msg = `${msg.substring(0, maxLength)}...`;
}
return pad(msg, minWidth, alignLeft);
});
};
}
function threadConverter() {
return () => {
return `PID:${process.pid}`;
};
}
function mdcConverter(key, minWidth = 0, alignLeft = true) {
return (event) => {
const value = event.context[key] || "";
return pad(String(value), minWidth, alignLeft);
};
}
class PatternLayout {
/**
* Constructor (构造函数)
* @param pattern Pattern string (模版字符串)
*/
constructor(pattern = "[%d{YYYY-MM-DD HH:mm:ss.SSSZ}] %p %c - %m", createConverter) {
this.converters = compilePattern(
pattern,
(specifier, alignLeft, minWidth, maxLength, format2) => {
if (isWhatType.isFunction(createConverter)) {
const converter = createConverter(
specifier,
alignLeft,
minWidth,
maxLength,
format2
);
if (isWhatType.isFunction(converter)) {
return converter;
}
}
switch (specifier.toLowerCase()) {
case "%":
return literalConverter("%");
case "d":
return dateConverter(format2);
case "p":
return levelConverter(minWidth, alignLeft);
case "c":
return loggerConverter(minWidth, alignLeft);
case "m":
return messageConverter(minWidth, maxLength, alignLeft);
case "t":
return threadConverter();
case "x":
return mdcConverter(format2 || "", minWidth, alignLeft);
default:
return literalConverter(`%${specifier}`);
}
},
literalConverter
);
}
/**
* Add a converter (添加转换器)
* @param fn Converter function (转换器函数)
*/
use(fn) {
this.converters.push(fn);
return this;
}
/**
* Format a log event (格式化日志事件)
* @param event Log event (日志事件)
*/
format(event) {
return this.converters.map((converter) => converter(event)).join("");
}
}
module.exports = PatternLayout;
@@ -0,0 +1,65 @@
import { type KDFInput, type TArg, type TRet } from './utils.ts';
/**
* Scrypt options:
* - `N` is cpu/mem work factor (power of 2 e.g. `2**18`)
* - `r` is block size (8 is common), fine-tunes sequential memory read size and performance
* - `p` is parallelization factor (1 is common)
* - `dkLen` is output key length in bytes e.g. 32, and must be `>= 1` per RFC 7914 §2.
* - `asyncTick` - (default: 10) max time in ms for which async function can block execution
* - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt
* - `onProgress` - callback function that would be executed for progress report
*/
export type ScryptOpts = {
/** CPU and memory work factor. Must be a power of two. */
N: number;
/** Block size parameter. */
r: number;
/** Parallelization factor. */
p: number;
/** Desired derived key length in bytes, must be `>= 1` per RFC 7914 §2. */
dkLen?: number;
/** Max scheduler block time in milliseconds for the async variant. */
asyncTick?: number;
/** Maximum temporary memory budget in bytes. */
maxmem?: number;
/**
* Optional progress callback invoked during long-running derivations.
* param progress - completion fraction in the `0..1` range
*/
onProgress?: (progress: number) => void;
};
/**
* Scrypt KDF from RFC 7914. See {@link ScryptOpts}.
* @param password - password or key material to derive from;
* JS string inputs are UTF-8 encoded first
* @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first
* @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,
* must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}.
* @returns Derived key bytes.
* @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}
* @example
* Derive a key with scrypt.
* ```ts
* scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });
* ```
*/
export declare function scrypt(password: TArg<KDFInput>, salt: TArg<KDFInput>, opts: TArg<ScryptOpts>): TRet<Uint8Array>;
/**
* Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}.
* @param password - password or key material to derive from;
* JS string inputs are UTF-8 encoded first
* @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first
* @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,
* must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local
* scheduler-yield control for this JS wrapper, not part of RFC 7914.
* See {@link ScryptOpts}.
* @returns Promise resolving to derived key bytes.
* @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}
* @example
* Derive a key with scrypt asynchronously.
* ```ts
* await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });
* ```
*/
export declare function scryptAsync(password: TArg<KDFInput>, salt: TArg<KDFInput>, opts: TArg<ScryptOpts>): Promise<TRet<Uint8Array>>;
//# sourceMappingURL=scrypt.d.ts.map
@@ -0,0 +1,49 @@
'use strict';
var KEYWORDS = [
'multipleOf',
'maximum',
'exclusiveMaximum',
'minimum',
'exclusiveMinimum',
'maxLength',
'minLength',
'pattern',
'additionalItems',
'maxItems',
'minItems',
'uniqueItems',
'maxProperties',
'minProperties',
'required',
'additionalProperties',
'enum',
'format',
'const'
];
module.exports = function (metaSchema, keywordsJsonPointers) {
for (var i=0; i<keywordsJsonPointers.length; i++) {
metaSchema = JSON.parse(JSON.stringify(metaSchema));
var segments = keywordsJsonPointers[i].split('/');
var keywords = metaSchema;
var j;
for (j=1; j<segments.length; j++)
keywords = keywords[segments[j]];
for (j=0; j<KEYWORDS.length; j++) {
var key = KEYWORDS[j];
var schema = keywords[key];
if (schema) {
keywords[key] = {
anyOf: [
schema,
{ $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
]
};
}
}
}
return metaSchema;
};
@@ -0,0 +1,13 @@
import { batch, createAsyncAtom, createAtom, flush, toObserver } from "./atom.js";
import { ReadonlyStore, Store, createStore } from "./store.js";
export {
ReadonlyStore,
Store,
batch,
createAsyncAtom,
createAtom,
createStore,
flush,
toObserver
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
This directory is a fallback for `exports["./client"]` in the root `framer-motion` `package.json`.
@@ -0,0 +1 @@
{"version":3,"file":"otpauth.node.min.mjs","sources":["../src/internal/encoding/uint.js","../src/internal/global-scope.js","../src/internal/crypto/hmac-digest.js","../src/internal/encoding/base32.js","../src/internal/encoding/hex.js","../src/internal/encoding/latin1.js","../src/internal/encoding/utf8.js","../src/secret.js","../src/internal/crypto/random-bytes.js","../src/hotp.js","../src/internal/crypto/timing-safe-equal.js","../src/totp.js","../src/uri.js","../src/version.js"],"sourcesContent":["/**\n * Converts an integer to an Uint8Array.\n * @param {number} num Integer.\n * @returns {Uint8Array} Uint8Array.\n */\nconst uintDecode = (num) => {\n const buf = new ArrayBuffer(8);\n const arr = new Uint8Array(buf);\n let acc = num;\n\n for (let i = 7; i >= 0; i--) {\n if (acc === 0) break;\n arr[i] = acc & 255;\n acc -= arr[i];\n acc /= 256;\n }\n\n return arr;\n};\n\n/**\n * Converts an Uint8Array to an integer.\n * @param {Uint8Array} arr Uint8Array.\n * @returns {number} Integer.\n */\nconst uintEncode = (arr) => {\n let num = 0;\n\n for (let i = 0; i < arr.length; i++) {\n num *= 256;\n num += arr[i];\n }\n\n return num;\n};\n\nexport { uintDecode, uintEncode };\n","/**\n * \"globalThis\" ponyfill.\n * @see [A horrifying globalThis polyfill in universal JavaScript](https://mathiasbynens.be/notes/globalthis)\n * @type {Object.<string, *>}\n */\nconst globalScope = (() => {\n if (typeof globalThis === \"object\") return globalThis;\n else {\n Object.defineProperty(Object.prototype, \"__GLOBALTHIS__\", {\n get() {\n return this;\n },\n configurable: true,\n });\n try {\n // @ts-expect-error\n // eslint-disable-next-line no-undef\n if (typeof __GLOBALTHIS__ !== \"undefined\") return __GLOBALTHIS__;\n } finally {\n // @ts-expect-error\n delete Object.prototype.__GLOBALTHIS__;\n }\n }\n\n // Still unable to determine \"globalThis\", fall back to a naive method.\n if (typeof self !== \"undefined\") return self;\n else if (typeof window !== \"undefined\") return window;\n else if (typeof global !== \"undefined\") return global;\n\n return undefined;\n})();\n\nexport { globalScope };\n","import * as crypto from \"node:crypto\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { sha1 } from \"@noble/hashes/legacy.js\";\nimport { sha224, sha256, sha384, sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_224, sha3_256, sha3_384, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport { globalScope } from \"../global-scope.js\";\n\n/**\n * @noble/hashes hash functions.\n * @type {Object.<string, sha1|sha224|sha256|sha384|sha512|sha3_224|sha3_256|sha3_384|sha3_512>}\n */\nconst nobleHashes = {\n SHA1: sha1,\n SHA224: sha224,\n SHA256: sha256,\n SHA384: sha384,\n SHA512: sha512,\n \"SHA3-224\": sha3_224,\n \"SHA3-256\": sha3_256,\n \"SHA3-384\": sha3_384,\n \"SHA3-512\": sha3_512,\n};\n\n/**\n * Canonicalizes a hash algorithm name.\n * @param {string} algorithm Hash algorithm name.\n * @returns {\"SHA1\"|\"SHA224\"|\"SHA256\"|\"SHA384\"|\"SHA512\"|\"SHA3-224\"|\"SHA3-256\"|\"SHA3-384\"|\"SHA3-512\"} Canonicalized hash algorithm name.\n */\nconst canonicalizeAlgorithm = (algorithm) => {\n switch (true) {\n case /^(?:SHA-?1|SSL3-SHA1)$/i.test(algorithm):\n return \"SHA1\";\n case /^SHA(?:2?-)?224$/i.test(algorithm):\n return \"SHA224\";\n case /^SHA(?:2?-)?256$/i.test(algorithm):\n return \"SHA256\";\n case /^SHA(?:2?-)?384$/i.test(algorithm):\n return \"SHA384\";\n case /^SHA(?:2?-)?512$/i.test(algorithm):\n return \"SHA512\";\n case /^SHA3-224$/i.test(algorithm):\n return \"SHA3-224\";\n case /^SHA3-256$/i.test(algorithm):\n return \"SHA3-256\";\n case /^SHA3-384$/i.test(algorithm):\n return \"SHA3-384\";\n case /^SHA3-512$/i.test(algorithm):\n return \"SHA3-512\";\n default:\n throw new TypeError(`Unknown hash algorithm: ${algorithm}`);\n }\n};\n\n/**\n * Calculates an HMAC digest.\n * @param {string} algorithm Algorithm.\n * @param {Uint8Array} key Key.\n * @param {Uint8Array} message Message.\n * @returns {Uint8Array} Digest.\n */\nconst hmacDigest = (algorithm, key, message) => {\n if (crypto?.createHmac) {\n const hmac = crypto.createHmac(algorithm, globalScope.Buffer.from(key));\n hmac.update(globalScope.Buffer.from(message));\n return hmac.digest();\n } else if (hmac) {\n const hash = nobleHashes[algorithm] ?? nobleHashes[canonicalizeAlgorithm(algorithm)];\n return hmac(hash, key, message);\n } else {\n throw new Error(\"Missing HMAC function\");\n }\n};\n\nexport { canonicalizeAlgorithm, hmacDigest };\n","/**\n * RFC 4648 base32 alphabet without pad.\n * @type {string}\n */\nconst ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";\n\n/**\n * Converts a base32 string to an Uint8Array (RFC 4648).\n * @see [LinusU/base32-decode](https://github.com/LinusU/base32-decode)\n * @param {string} str Base32 Line truncated
@@ -0,0 +1,52 @@
type ModeWriter = (doc: Doc, modes: { execution: "sync" | "async" }) => void;
export class Doc {
args: string[];
/** Bindings the compiled function closes over, by name. */
closed: Record<string, unknown>;
content: string[] = [];
indent = 0;
constructor(args: string[] = [], closed: Record<string, unknown> = {}) {
this.args = args;
this.closed = closed;
}
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
indented(fn: (doc: Doc) => void) {
this.indent += 1;
try {
fn(this);
} finally {
this.indent -= 1;
}
}
write(fn: ModeWriter): void;
write(line: string): void;
write(arg: any) {
if (typeof arg === "function") {
(arg as ModeWriter)(this, { execution: "sync" });
(arg as ModeWriter)(this, { execution: "async" });
return;
}
const content = arg as string;
const lines = content.split("\n").filter((x) => x);
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
for (const line of dedented) {
this.content.push(line);
}
}
compile(): any {
const F = Function;
const content = this?.content ?? [``];
const factory = new F(
...Object.keys(this.closed),
`return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`
);
return factory(...Object.values(this.closed)) as any;
}
}
@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const additionalItems_1 = require("./additionalItems");
const prefixItems_1 = require("./prefixItems");
const items_1 = require("./items");
const items2020_1 = require("./items2020");
const contains_1 = require("./contains");
const dependencies_1 = require("./dependencies");
const propertyNames_1 = require("./propertyNames");
const additionalProperties_1 = require("./additionalProperties");
const properties_1 = require("./properties");
const patternProperties_1 = require("./patternProperties");
const not_1 = require("./not");
const anyOf_1 = require("./anyOf");
const oneOf_1 = require("./oneOf");
const allOf_1 = require("./allOf");
const if_1 = require("./if");
const thenElse_1 = require("./thenElse");
function getApplicator(draft2020 = false) {
const applicator = [
// any
not_1.default,
anyOf_1.default,
oneOf_1.default,
allOf_1.default,
if_1.default,
thenElse_1.default,
// object
propertyNames_1.default,
additionalProperties_1.default,
dependencies_1.default,
properties_1.default,
patternProperties_1.default,
];
// array
if (draft2020)
applicator.push(prefixItems_1.default, items2020_1.default);
else
applicator.push(additionalItems_1.default, items_1.default);
applicator.push(contains_1.default);
return applicator;
}
exports.default = getApplicator;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
'use strict';
var decompress = require('@zxcvbn-ts/dictionary-compression/decompress');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var decompress__default = /*#__PURE__*/_interopDefault(decompress);
var wikipedia = decompress__default.default("AtheAofAandAinAwasAisAforAasAonAwithAbyAheAatAfromAhisAanAwereAareAwhichAdocAhttpsAalsoAorAhasCdAfirstAoneAtheirAitsAafterAnewAwhoAtheyBwoAherAsheAbeenAotherAwhenAtimeAduringAintoAschoolAmoreBayAyearsAoverBnlyAyearAmostAwouldCrldAcityAsomeAwhereAbetweenAlaterAthreeAstateBuchAthenAnationalAusedAmadeAknownAunderAmanyAuniversityDtedAwhileApartAseasonAteamBheseAamericanAthanAfilmAsecondAbornAsouthAbecameAstatesAwarAthroughAbeingAincludingAbothBeforeAnorthAhighBoweverApeopleAfamilyAearlyAhistoryAalbumBreaAseriesAagainstAuntilAsinceAdistrictAcountyAnameAworkAlifeAgroupAmusicAfollowingAnumberAcompanyAseveralAfourAcalledAplayedAreleasedAcareerAleagueAgameBovernmentAhouseAeachAbasedAdayAsameAwonAuseAstationAclubAinternationalAtownAlocatedApopulationAgeneralAcollegeAeastAfoundAageAmarchAendAseptemberAbeganAhomeApublicAchurchAlineAjuneAriverAmemberAsystemAplaceAcenturyAbandAjulyAyorkAjanuaryAoctoberAsongAaugustAbestAformerAbritishApartyAnamedAheldAvillageAshowAlocalAnovemberAtookAserviceAdecemberAbuiltAanotherAmajorAwithinAalongAmembersAfiveAsingleAdueAalthoughAsmallAoldAleftAfinalAlargeAincludeAbuildingAservedApresidentAreceivedAgamesAdeathAfebruaryAmainAthirdAsetAchildrenAownBrderAspeciesAparkAlawAairApublishedAroadAdiedAbookAmenAwomenAarmyAoftenAaccordingAeducationAcentralBountryAdivisionAenglishAtopAincludedAdevelopmentAfrenchAcommunityAamongAwaterAplayAsideAlistAtimesAnearAlateAformAoriginalAdifferentAcenterApowerAledAstudentsAgermanAmovedAcourtAsixAlandAcouncilAislandAu.s.ArecordAmillionAresearchAartAestablishedAawardAstreetAmilitaryAtelevisionAgivenAregionAsupportAwesternAproductionAnonApoliticalCintAcupAperiodAbusinessAtitleAstartedAvariousAelectionAusingAenglandAroleAproducedAbecomeAprogramAworksAfieldAtotalAofficeAclassAwrittenAassociationAradioAunionAlevelAchampionshipAdirectorAfewBorceAcreatedAdepartmentAfoundedAservicesAmarriedAthoughAperAn'tAsiteAopenAactAshortBocietyAversionAroyalApresentAnorthernAworkedAprofessionalAfullAreturnedAjoinedAstoryAfranceAeuropeanAcurrentlyAlanguageAsocialAcaliforniaAindiaAdesignAst.AfurtherAroundAaustraliaAwroteAsanAprojectAcontrolAsouthernArailwayAboardApopularAcontinuedAfreeAbattleAconsideredAvideoAcommonApositionAlivingAhalfAplayingArecordedCdApostAdescribedAaverageArecordsAspecialAmodernAappearedBnnouncedBreasArockBeleaseAelectedAothersAexampleAtermAopenedAsimilarAformedArouteAcensusBurrentAschoolsAoriginallyAlakeAdevelopedAraceAhimselfAforcesAadditionAinformationAuponAprovinceAmatchAeventAsongsAresultAeventsAwinAeasternAtrackAleadAteamsAscienceAhumanAconstructionAministerAgermanyAawardsBvailableAthroughoutBrainingAstyleAbodyAmuseumAaustralianAhealthAsevenBignedAchiefAeventuallyAappointedAseaAcentreAdebutAtourApointsAmediaAlightArangeAcharacterAacrossAfeaturesBamiliesAlargestAindianAnetworkAlessAperformanceBlayersAreferAeuropeAsoldAfestivalAusuallyAtakenAdespiteDignedAcommitteeAprocessAreturnAofficialAepisodeAinstituteAstageAfollowedAperformedAjapaneseApersonalAthusAartsAspaceAlowAmonthsAincludesAchinaAstudyAmiddleBagazineAleadingAjapanAgroupsAaircraftAfeaturedCderalAcivilArightsAmodelAcoachBanadianAbooksAremainedAeightAtypeAindependentAcompletedBapitalAacademyAinsteadAkingdomAorganizationAcountriesAstudiesAcompetitionAsportsBizeAaboveAsectionAfinishedAgoldAinvolvedAreportedAmanagementAsystemsAindustryAdirectedAmarketAfourthAmovementAtechnologyAbankAgroundAcampaignAbaseAlowerAsentAratherAaddedAprovidedAcoastAgrandAhistoricAvalleyAconferenceAbridgeAwinningAapproximatelyAfilmsAchineseAawardedAdegreeArussianAshowsAnativeAfemaleAreplacedAmunicipalityAsquareBtudioAmedicalAdataAafricanAsuccessfulAmidAbayAattackApreviousAoperationsAspanishAtheatreAstudentArepublicAbeginningAprovideAshipAprimaryAownedAwritingAtournamentAcultureAintroducedAtexasArelatedAnaturalApartsAgovernorAreachedAirelandAunitsAseniorAdecidedAitalianAwhoseAhigherAafricaAstandardAincomeAprofessorBlacedAregionalAlosAbuildingsAchampionshipsAactiveAnovelAenergyAgenerallyAinterestAviaAeconomicApreviouslyAstatedAitselfAchannelAbelowAoperationAleaderAtraditionalEeAstructureAlimitedArunsApriorAregularAfamousAsaintAnavyAforeignAlistedAartistAcatholicAairportAresultsAparliamentAcollectionAunitAofficerAgoalAattendedAcommandAstaffAcommissionAlivedBocationAplaysAcommercialAplacesAfoundationAsignificantAolderAmedalAselfBcoredAcompaniesAhighwayAactivitiesAprogramsAwideAmusicalAnotableAlibraryAnumerousAparisAtowardsAindividualAallowedAplantBropertyAannualAcontractAwhomAhighestAinitiallyArequiredAearlierAassemblyBrtistsAruralAseatApracticeAdefeatedAendedAsovietAlengthAspentAmanagerApressAassociatedButhorAissuesAadditionalAcharactersAzealandApolicyAengineAtownshipAnotedAhistoricalAcompleteAfinancialAreligiousAmissionAcontainsAnineArecentCpresentedApennsylvaniaAadministrationAopeningAsecretaryAlinesAreportAexecutiveAyouthAclosedAtheoryAwriterAitalyAangelesBppearanceAfeatureAqueenAlaunchedBegalAtermsAenteredAissueAeditionAsingerAgreekAmajorityAbackgroundAsourceAantiAculturalBomplexBhLine truncated
module.exports = wikipedia;
//# sourceMappingURL=wikipedia.json.cjs.map
@@ -0,0 +1,614 @@
import { SetArray, put, remove } from './set-array';
import {
encode,
// encodeGeneratedRanges,
// encodeOriginalScopes
} from '@jridgewell/sourcemap-codec';
import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';
import {
COLUMN,
SOURCES_INDEX,
SOURCE_LINE,
SOURCE_COLUMN,
NAMES_INDEX,
} from './sourcemap-segment';
import type { SourceMapInput } from '@jridgewell/trace-mapping';
// import type { OriginalScope, GeneratedRange } from '@jridgewell/sourcemap-codec';
import type { SourceMapSegment } from './sourcemap-segment';
import type {
DecodedSourceMap,
EncodedSourceMap,
Pos,
Mapping,
// BindingExpressionRange,
// OriginalPos,
// OriginalScopeInfo,
// GeneratedRangeInfo,
} from './types';
export type { DecodedSourceMap, EncodedSourceMap, Mapping };
export type Options = {
file?: string | null;
sourceRoot?: string | null;
};
const NO_NAME = -1;
/**
* Provides the state to generate a sourcemap.
*/
export class GenMapping {
declare private _names: SetArray<string>;
declare private _sources: SetArray<string>;
declare private _sourcesContent: (string | null)[];
declare private _mappings: SourceMapSegment[][];
// private declare _originalScopes: OriginalScope[][];
// private declare _generatedRanges: GeneratedRange[];
declare private _ignoreList: SetArray<number>;
declare file: string | null | undefined;
declare sourceRoot: string | null | undefined;
constructor({ file, sourceRoot }: Options = {}) {
this._names = new SetArray();
this._sources = new SetArray();
this._sourcesContent = [];
this._mappings = [];
// this._originalScopes = [];
// this._generatedRanges = [];
this.file = file;
this.sourceRoot = sourceRoot;
this._ignoreList = new SetArray();
}
}
interface PublicMap {
_names: GenMapping['_names'];
_sources: GenMapping['_sources'];
_sourcesContent: GenMapping['_sourcesContent'];
_mappings: GenMapping['_mappings'];
// _originalScopes: GenMapping['_originalScopes'];
// _generatedRanges: GenMapping['_generatedRanges'];
_ignoreList: GenMapping['_ignoreList'];
}
/**
* Typescript doesn't allow friend access to private fields, so this just casts the map into a type
* with public access modifiers.
*/
function cast(map: unknown): PublicMap {
return map as any;
}
/**
* A low-level API to associate a generated position with an original source position. Line and
* column here are 0-based, unlike `addMapping`.
*/
export function addSegment(
map: GenMapping,
genLine: number,
genColumn: number,
source?: null,
sourceLine?: null,
sourceColumn?: null,
name?: null,
content?: null,
): void;
export function addSegment(
map: GenMapping,
genLine: number,
genColumn: number,
source: string,
sourceLine: number,
sourceColumn: number,
name?: null,
content?: string | null,
): void;
export function addSegment(
map: GenMapping,
genLine: number,
genColumn: number,
source: string,
sourceLine: number,
sourceColumn: number,
name: string,
content?: string | null,
): void;
export function addSegment(
map: GenMapping,
genLine: number,
genColumn: number,
source?: string | null,
sourceLine?: number | null,
sourceColumn?: number | null,
name?: string | null,
content?: string | null,
): void {
return addSegmentInternal(
false,
map,
genLine,
genColumn,
source,
sourceLine,
sourceColumn,
name,
content,
);
}
/**
* A high-level API to associate a generated position with an original source position. Line is
* 1-based, but column is 0-based, due to legacy behavior in `source-map` library.
*/
export function addMapping(
map: GenMapping,
mapping: {
generated: Pos;
source?: null;
original?: null;
name?: null;
content?: null;
},
): void;
export function addMapping(
map: GenMapping,
mapping: {
generated: Pos;
source: string;
original: Pos;
name?: null;
content?: string | null;
},
): void;
export function addMapping(
map: GenMapping,
mapping: {
generated: Pos;
source: string;
original: Pos;
name: string;
content?: string | null;
},
): void;
export function addMapping(
map: GenMapping,
mapping: {
generated: Pos;
source?: string | null;
original?: Pos | null;
name?: string | null;
content?: string | null;
},
): void {
return addMappingInternal(false, map, mapping as Parameters<typeof addMappingInternal>[2]);
}
/**
* Same as `addSegment`, but will only add the segment if it generates useful information in the
* resulting map. This only works correctly if segments are added **in order**, meaning you should
* not add a segment with a lower generated line/column than one that came before.
*/
export const maybeAddSegment: typeof addSegment = (
map,
genLine,
genColumn,
source,
sourceLine,
sourceColumn,
name,
content,
) => {
return addSegmentInternal(
true,
map,
genLine,
genColumn,
source,
sourceLine,
sourceColumn,
name,
content,
);
};
/**
* Same as `addMapping`, but will only add the mapping if it generates useful information in the
* resulting map. This only works correctly if mappings are added **in order**, meaning you should
* not add a mapping with a lower generated line/column than one that came before.
*/
export const maybeAddMapping: typeof addMapping = (map, mapping) => {
return addMappingInternal(true, map, mapping as Parameters<typeof addMappingInternal>[2]);
};
/**
* Adds/removes the content of the source file to the source map.
*/
export function setSourceContent(map: GenMapping, source: string, content: string | null): void {
const {
_sources: sources,
_sourcesContent: sourcesContent,
// _originalScopes: originalScopes,
} = cast(map);
const index = put(sources, source);
sourcesContent[index] = content;
// if (index === originalScopes.length) originalScopes[index] = [];
}
export function setIgnore(map: GenMapping, source: string, ignore = true) {
const {
_sources: sources,
_sourcesContent: sourcesContent,
_ignoreList: ignoreList,
// _originalScopes: originalScopes,
} = cast(map);
const index = put(sources, source);
if (index === sourcesContent.length) sourcesContent[index] = null;
// if (index === originalScopes.length) originalScopes[index] = [];
if (ignore) put(ignoreList, index);
else remove(ignoreList, index);
}
/**
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function toDecodedMap(map: GenMapping): DecodedSourceMap {
const {
_mappings: mappings,
_sources: sources,
_sourcesContent: sourcesContent,
_names: names,
_ignoreList: ignoreList,
// _originalScopes: originalScopes,
// _generatedRanges: generatedRanges,
} = cast(map);
removeEmptyFinalLines(mappings);
return {
version: 3,
file: map.file || undefined,
names: names.array,
sourceRoot: map.sourceRoot || undefined,
sources: sources.array,
sourcesContent,
mappings,
// originalScopes,
// generatedRanges,
ignoreList: ignoreList.array,
};
}
/**
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function toEncodedMap(map: GenMapping): EncodedSourceMap {
const decoded = toDecodedMap(map);
return Object.assign({}, decoded, {
// originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
// generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
mappings: encode(decoded.mappings as SourceMapSegment[][]),
});
}
/**
* Constructs a new GenMapping, using the already present mappings of the input.
*/
export function fromMap(input: SourceMapInput): GenMapping {
const map = new TraceMap(input);
const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
putAll(cast(gen)._names, map.names);
putAll(cast(gen)._sources, map.sources as string[]);
cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
cast(gen)._mappings = decodedMappings(map) as GenMapping['_mappings'];
// TODO: implement originalScopes/generatedRanges
if (map.ignoreList) putAll(cast(gen)._ignoreList, map.ignoreList);
return gen;
}
/**
* Returns an array of high-level mapping objects for every recorded segment, which could then be
* passed to the `source-map` library.
*/
export function allMappings(map: GenMapping): Mapping[] {
const out: Mapping[] = [];
const { _mappings: mappings, _sources: sources, _names: names } = cast(map);
for (let i = 0; i < mappings.length; i++) {
const line = mappings[i];
for (let j = 0; j < line.length; j++) {
const seg = line[j];
const generated = { line: i + 1, column: seg[COLUMN] };
let source: string | undefined = undefined;
let original: Pos | undefined = undefined;
let name: string | undefined = undefined;
if (seg.length !== 1) {
source = sources.array[seg[SOURCES_INDEX]];
original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];
}
out.push({ generated, source, original, name } as Mapping);
}
}
return out;
}
// This split declaration is only so that terser can elminiate the static initialization block.
function addSegmentInternal<S extends string | null | undefined>(
skipable: boolean,
map: GenMapping,
genLine: number,
genColumn: number,
source: S,
sourceLine: S extends string ? number : null | undefined,
sourceColumn: S extends string ? number : null | undefined,
name: S extends string ? string | null | undefined : null | undefined,
content: S extends string ? string | null | undefined : null | undefined,
): void {
const {
_mappings: mappings,
_sources: sources,
_sourcesContent: sourcesContent,
_names: names,
// _originalScopes: originalScopes,
} = cast(map);
const line = getIndex(mappings, genLine);
const index = getColumnIndex(line, genColumn);
if (!source) {
if (skipable && skipSourceless(line, index)) return;
return insert(line, index, [genColumn]);
}
// Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source
// isn't nullish.
assert<number>(sourceLine);
assert<number>(sourceColumn);
const sourcesIndex = put(sources, source);
const namesIndex = name ? put(names, name) : NO_NAME;
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;
// if (sourcesIndex === originalScopes.length) originalScopes[sourcesIndex] = [];
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
return;
}
return insert(
line,
index,
name
? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
: [genColumn, sourcesIndex, sourceLine, sourceColumn],
);
}
function assert<T>(_val: unknown): asserts _val is T {
// noop.
}
function getIndex<T>(arr: T[][], index: number): T[] {
for (let i = arr.length; i <= index; i++) {
arr[i] = [];
}
return arr[index];
}
function getColumnIndex(line: SourceMapSegment[], genColumn: number): number {
let index = line.length;
for (let i = index - 1; i >= 0; index = i--) {
const current = line[i];
if (genColumn >= current[COLUMN]) break;
}
return index;
}
function insert<T>(array: T[], index: number, value: T) {
for (let i = array.length; i > index; i--) {
array[i] = array[i - 1];
}
array[index] = value;
}
function removeEmptyFinalLines(mappings: SourceMapSegment[][]) {
const { length } = mappings;
let len = length;
for (let i = len - 1; i >= 0; len = i, i--) {
if (mappings[i].length > 0) break;
}
if (len < length) mappings.length = len;
}
function putAll<T extends string | number>(setarr: SetArray<T>, array: T[]) {
for (let i = 0; i < array.length; i++) put(setarr, array[i]);
}
function skipSourceless(line: SourceMapSegment[], index: number): boolean {
// The start of a line is already sourceless, so adding a sourceless segment to the beginning
// doesn't generate any useful information.
if (index === 0) return true;
const prev = line[index - 1];
// If the previous segment is also sourceless, then adding another sourceless segment doesn't
// genrate any new information. Else, this segment will end the source/named segment and point to
// a sourceless position, which is useful.
return prev.length === 1;
}
function skipSource(
line: SourceMapSegment[],
index: number,
sourcesIndex: number,
sourceLine: number,
sourceColumn: number,
namesIndex: number,
): boolean {
// A source/named segment at the start of a line gives position at that genColumn
if (index === 0) return false;
const prev = line[index - 1];
// If the previous segment is sourceless, then we're transitioning to a source.
if (prev.length === 1) return false;
// If the previous segment maps to the exact same source position, then this segment doesn't
// provide any new position information.
return (
sourcesIndex === prev[SOURCES_INDEX] &&
sourceLine === prev[SOURCE_LINE] &&
sourceColumn === prev[SOURCE_COLUMN] &&
namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)
);
}
function addMappingInternal<S extends string | null | undefined>(
skipable: boolean,
map: GenMapping,
mapping: {
generated: Pos;
source: S;
original: S extends string ? Pos : null | undefined;
name: S extends string ? string | null | undefined : null | undefined;
content: S extends string ? string | null | undefined : null | undefined;
},
) {
const { generated, source, original, name, content } = mapping;
if (!source) {
return addSegmentInternal(
skipable,
map,
generated.line - 1,
generated.column,
null,
null,
null,
null,
null,
);
}
assert<Pos>(original);
return addSegmentInternal(
skipable,
map,
generated.line - 1,
generated.column,
source as string,
original.line - 1,
original.column,
name,
content,
);
}
/*
export function addOriginalScope(
map: GenMapping,
data: {
start: Pos;
end: Pos;
source: string;
kind: string;
name?: string;
variables?: string[];
},
): OriginalScopeInfo {
const { start, end, source, kind, name, variables } = data;
const {
_sources: sources,
_sourcesContent: sourcesContent,
_originalScopes: originalScopes,
_names: names,
} = cast(map);
const index = put(sources, source);
if (index === sourcesContent.length) sourcesContent[index] = null;
if (index === originalScopes.length) originalScopes[index] = [];
const kindIndex = put(names, kind);
const scope: OriginalScope = name
? [start.line - 1, start.column, end.line - 1, end.column, kindIndex, put(names, name)]
: [start.line - 1, start.column, end.line - 1, end.column, kindIndex];
if (variables) {
scope.vars = variables.map((v) => put(names, v));
}
const len = originalScopes[index].push(scope);
return [index, len - 1, variables];
}
*/
// Generated Ranges
/*
export function addGeneratedRange(
map: GenMapping,
data: {
start: Pos;
isScope: boolean;
originalScope?: OriginalScopeInfo;
callsite?: OriginalPos;
},
): GeneratedRangeInfo {
const { start, isScope, originalScope, callsite } = data;
const {
_originalScopes: originalScopes,
_sources: sources,
_sourcesContent: sourcesContent,
_generatedRanges: generatedRanges,
} = cast(map);
const range: GeneratedRange = [
start.line - 1,
start.column,
0,
0,
originalScope ? originalScope[0] : -1,
originalScope ? originalScope[1] : -1,
];
if (originalScope?.[2]) {
range.bindings = originalScope[2].map(() => [[-1]]);
}
if (callsite) {
const index = put(sources, callsite.source);
if (index === sourcesContent.length) sourcesContent[index] = null;
if (index === originalScopes.length) originalScopes[index] = [];
range.callsite = [index, callsite.line - 1, callsite.column];
}
if (isScope) range.isScope = true;
generatedRanges.push(range);
return [range, originalScope?.[2]];
}
export function setEndPosition(range: GeneratedRangeInfo, pos: Pos) {
range[0][2] = pos.line - 1;
range[0][3] = pos.column;
}
export function addBinding(
map: GenMapping,
range: GeneratedRangeInfo,
variable: string,
expression: string | BindingExpressionRange,
) {
const { _names: names } = cast(map);
const bindings = (range[0].bindings ||= []);
const vars = range[1];
const index = vars!.indexOf(variable);
const binding = getIndex(bindings, index);
if (typeof expression === 'string') binding[0] = [put(names, expression)];
else {
const { start } = expression;
binding.push([put(names, expression.expression), start.line - 1, start.column]);
}
}
*/
@@ -0,0 +1,12 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_RouterClient = require("./RouterClient.cjs");
exports.RouterClient = require_RouterClient.RouterClient;
var _tanstack_router_core_ssr_client = require("@tanstack/router-core/ssr/client");
Object.keys(_tanstack_router_core_ssr_client).forEach(function(k) {
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function() {
return _tanstack_router_core_ssr_client[k];
}
});
});
@@ -0,0 +1,6 @@
parserOptions:
ecmaVersion: 6
globals:
beforeEach: false
describe: false
it: false
@@ -0,0 +1,159 @@
/** The Standard interface. */
export interface StandardTypedV1<Input = unknown, Output = Input> {
/** The Standard properties. */
readonly "~standard": StandardTypedV1.Props<Input, Output>;
}
export declare namespace StandardTypedV1 {
/** The Standard properties interface. */
export interface Props<Input = unknown, Output = Input> {
/** The version number of the standard. */
readonly version: 1;
/** The vendor name of the schema library. */
readonly vendor: string;
/** Inferred types associated with the schema. */
readonly types?: Types<Input, Output> | undefined;
}
/** The Standard types interface. */
export interface Types<Input = unknown, Output = Input> {
/** The input type of the schema. */
readonly input: Input;
/** The output type of the schema. */
readonly output: Output;
}
/** Infers the input type of a Standard. */
export type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
/** Infers the output type of a Standard. */
export type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
}
/** The Standard Schema interface. */
export interface StandardSchemaV1<Input = unknown, Output = Input> {
/** The Standard Schema properties. */
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
}
export declare namespace StandardSchemaV1 {
/** The Standard Schema properties interface. */
export interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
/** Validates unknown input values. */
readonly validate: (
value: unknown,
options?: StandardSchemaV1.Options | undefined
) => Result<Output> | Promise<Result<Output>>;
}
/** The result interface of the validate function. */
export type Result<Output> = SuccessResult<Output> | FailureResult;
/** The result interface if validation succeeds. */
export interface SuccessResult<Output> {
/** The typed output value. */
readonly value: Output;
/** The absence of issues indicates success. */
readonly issues?: undefined;
}
export interface Options {
/** Implicit support for additional vendor-specific parameters, if needed. */
readonly libraryOptions?: Record<string, unknown> | undefined;
}
/** The result interface if validation fails. */
export interface FailureResult {
/** The issues of failed validation. */
readonly issues: ReadonlyArray<Issue>;
}
/** The issue interface of the failure output. */
export interface Issue {
/** The error message of the issue. */
readonly message: string;
/** The path of the issue, if any. */
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
}
/** The path segment interface of the issue. */
export interface PathSegment {
/** The key representing a path segment. */
readonly key: PropertyKey;
}
/** The Standard types interface. */
export interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
/** Infers the input type of a Standard. */
export type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
/** Infers the output type of a Standard. */
export type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
}
/** The Standard JSON Schema interface. */
export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
/** The Standard JSON Schema properties. */
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
}
export declare namespace StandardJSONSchemaV1 {
/** The Standard JSON Schema properties interface. */
export interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
/** Methods for generating the input/output JSON Schema. */
readonly jsonSchema: Converter;
}
/** The Standard JSON Schema converter interface. */
export interface Converter {
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
}
/** The target version of the generated JSON Schema.
*
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
*
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
*
* All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
*/
export type Target =
| "draft-2020-12"
| "draft-07"
| "openapi-3.0"
// Accepts any string for future targets while preserving autocomplete
| ({} & string);
/** The options for the input/output methods. */
export interface Options {
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
readonly target: Target;
/** Implicit support for additional vendor-specific parameters, if needed. */
readonly libraryOptions?: Record<string, unknown> | undefined;
}
/** The Standard types interface. */
export interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
/** Infers the input type of a Standard. */
export type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
/** Infers the output type of a Standard. */
export type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
}
export interface StandardSchemaWithJSONProps<Input = unknown, Output = Input>
extends StandardSchemaV1.Props<Input, Output>,
StandardJSONSchemaV1.Props<Input, Output> {}
/**
* An interface that combines StandardJSONSchema and StandardSchema.
*/
export interface StandardSchemaWithJSON<Input = unknown, Output = Input> {
"~standard": StandardSchemaWithJSONProps<Input, Output>;
}
@@ -0,0 +1 @@
{"version":3,"file":"wifi.js","sources":["../../../src/icons/wifi.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Wifi\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjBoLjAxIiAvPgogIDxwYXRoIGQ9Ik0yIDguODJhMTUgMTUgMCAwIDEgMjAgMCIgLz4KICA8cGF0aCBkPSJNNSAxMi44NTlhMTAgMTAgMCAwIDEgMTQgMCIgLz4KICA8cGF0aCBkPSJNOC41IDE2LjQyOWE1IDUgMCAwIDEgNyAwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/wifi\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Wifi = createLucideIcon('Wifi', [\n ['path', { d: 'M12 20h.01', key: 'zekei9' }],\n ['path', { d: 'M2 8.82a15 15 0 0 1 20 0', key: 'dnpr2z' }],\n ['path', { d: 'M5 12.859a10 10 0 0 1 14 0', key: '1x1e6c' }],\n ['path', { d: 'M8.5 16.429a5 5 0 0 1 7 0', key: '1bycff' }],\n]);\n\nexport default Wifi;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={C:{"4":0.01612,"113":0.00403,"115":0.0282,"120":0.72522,"121":1.44641,"122":0.00403,"123":0.01209,"124":0.02015,"125":0.00806,"127":0.00403,"131":0.00403,"132":0.00403,"133":0.00403,"134":0.00403,"135":0.00403,"136":0.00403,"138":0.00403,"140":0.01612,"141":0.00403,"142":0.00403,"143":0.00403,"145":0.00403,"146":0.00806,"147":0.00403,"148":0.00403,"150":0.01612,"151":0.00403,"152":0.05238,"153":0.01612,"154":0.08461,"155":0.26591,"156":0.28606,"157":0.00806,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 126 128 129 130 137 139 144 149 158 159 160 3.5 3.6"},D:{"38":0.00403,"63":0.00403,"65":0.00403,"66":0.00403,"68":0.00403,"70":0.00403,"71":0.00403,"74":0.00403,"79":0.01209,"87":0.00806,"97":0.00806,"101":0.00403,"102":0.00806,"103":0.20145,"104":0.19742,"105":0.19742,"106":0.20145,"107":0.19339,"108":0.19742,"109":0.54392,"110":0.19742,"111":0.23368,"112":0.19742,"114":0.00403,"116":0.42305,"117":0.19339,"118":0.99113,"119":1.44238,"120":1.65189,"121":0.01612,"122":0.04835,"123":0.02015,"124":0.20951,"125":0.00403,"126":0.00806,"127":0.01209,"128":0.06044,"129":0.00403,"130":0.01209,"131":0.41096,"132":0.00806,"133":0.54794,"134":0.16519,"135":0.16519,"136":0.16922,"137":0.17325,"138":0.21354,"139":0.17728,"140":0.19742,"141":0.19742,"142":0.60838,"143":0.07655,"144":0.06044,"145":0.19339,"146":0.46736,"147":0.03626,"148":0.14102,"149":0.26994,"150":0.39081,"151":1.24093,"152":5.89443,"153":6.28524,"154":1.4867,"155":0.01612,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 64 67 69 72 73 75 76 77 78 80 81 83 84 85 86 88 89 90 91 92 93 94 95 96 98 99 100 113 115 156 157"},F:{"54":0.00403,"55":0.00403,"56":0.00403,"95":0.00806,"101":0.00403,"105":0.00806,"106":0.01209,"107":0.00806,"114":0.00403,"115":0.00403,"116":0.00403,"118":0.00403,"119":0.00403,"120":0.00403,"121":0.00403,"122":0.00403,"123":0.00403,"131":0.00403,"133":0.00403,"134":0.25383,"135":1.12409,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 102 103 104 108 109 110 111 112 113 117 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00403,"109":0.00806,"119":0.71716,"120":0.71716,"122":0.01612,"123":0.00403,"124":0.00403,"131":0.00403,"132":0.00403,"133":0.00403,"134":0.00403,"135":0.00403,"136":0.00403,"137":0.00403,"138":0.00806,"139":0.00403,"140":0.00806,"143":0.00403,"144":0.00403,"145":0.01612,"146":0.00806,"147":0.01612,"148":0.02015,"149":0.02015,"150":0.10475,"151":0.16519,"152":1.31748,"153":1.65592,"154":0.45125,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 125 126 127 128 129 130 141 142"},E:{"27":0.07655,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 17.0 27.1 27.2 TP","13.1":0.00806,"15.6":0.01612,"16.3":0.00403,"16.5":0.00403,"16.6":0.03223,"17.1":0.04029,"17.2":0.00403,"17.3":0.00403,"17.4":0.00403,"17.5":0.01209,"17.6":0.04029,"18.0":0.00403,"18.1":0.00403,"18.2":0.00403,"18.3":0.00806,"18.4":0.00806,"18.5-18.7":0.00806,"26.0":0.00403,"26.1":0.0282,"26.2":0.01612,"26.3":0.02015,"26.4":0.03223,"26.5":0.09267,"26.6":0.41902},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00074,"5.0-5.1":0.00074,"6.0-6.1":0,"7.0-7.1":0.00148,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00741,"11.0-11.2":0.00074,"11.3-11.4":0.00148,"12.0-12.1":0,"12.2-12.5":0.01927,"13.0-13.1":0,"13.2":0.00371,"13.3":0,"13.4-13.7":0.00074,"14.0-14.4":0.00296,"14.5-14.8":0.00445,"15.0-15.1":0.00445,"15.2-15.3":0.00296,"15.4":0.00371,"15.5":0.00445,"15.6-15.8":0.09633,"16.0":0.00741,"16.1":0.01334,"16.2":0.00741,"16.3":0.0163,"16.4":0.00371,"16.5":0.00593,"16.6-16.7":0.13412,"17.0":0.00519,"17.1":0.00741,"17.2":0.00741,"17.3":0.01112,"17.4":0.01556,"17.5":0.03038,"17.6-17.7":0.07855,"18.0":0.0163,"18.1":0.0326,"18.2":0.04446,"18.3":0.07706,"18.4":0.04817,"18.5-18.7":0.99516,"26.0":0.04817,"26.1":0.04891,"26.2":0.12745,"26.3":0.13783,"26.4":0.10078,"26.5":0.67505,"26.6":4.16517,"27.0":0.31937,"27.1":0,"27.2":0.00815},P:{"4":0.00996,"21":0.00996,"22":0.01991,"23":0.01991,"24":0.01991,"25":0.01991,"26":0.07966,"27":0.04979,"28":0.14936,"29":0.17923,"30":3.1066,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01991},I:{"0":0.0179,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,Line truncated
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classApplyDescriptorDestructureSet;
function _classApplyDescriptorDestructureSet(receiver, descriptor) {
if (descriptor.set) {
if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = {
set value(v) {
descriptor.set.call(receiver, v);
}
};
}
return descriptor.__destrObj;
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
//# sourceMappingURL=classApplyDescriptorDestructureSet.js.map
@@ -0,0 +1,21 @@
import * as React from 'react';
import { Primitive } from '@radix-ui/react-primitive';
declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
type Orientation = (typeof ORIENTATIONS)[number];
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
interface SeparatorProps extends PrimitiveDivProps {
/**
* Either `vertical` or `horizontal`. Defaults to `horizontal`.
*/
orientation?: Orientation;
/**
* Whether or not the component is purely decorative. When true, accessibility-related attributes
* are updated so that that the rendered element is removed from the accessibility tree.
*/
decorative?: boolean;
}
declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
declare const Root: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
export { Root, Separator, type SeparatorProps };
@@ -0,0 +1,257 @@
import { stat, lstat, readdir, realpath } from 'node:fs/promises';
import { Readable } from 'node:stream';
import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from 'node:path';
export const EntryTypes = {
FILE_TYPE: 'files',
DIR_TYPE: 'directories',
FILE_DIR_TYPE: 'files_directories',
EVERYTHING_TYPE: 'all',
};
const defaultOptions = {
root: '.',
fileFilter: (_entryInfo) => true,
directoryFilter: (_entryInfo) => true,
type: EntryTypes.FILE_TYPE,
lstat: false,
depth: 2147483648,
alwaysStat: false,
highWaterMark: 4096,
};
Object.freeze(defaultOptions);
const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);
const ALL_TYPES = [
EntryTypes.DIR_TYPE,
EntryTypes.EVERYTHING_TYPE,
EntryTypes.FILE_DIR_TYPE,
EntryTypes.FILE_TYPE,
];
const DIR_TYPES = new Set([
EntryTypes.DIR_TYPE,
EntryTypes.EVERYTHING_TYPE,
EntryTypes.FILE_DIR_TYPE,
]);
const FILE_TYPES = new Set([
EntryTypes.EVERYTHING_TYPE,
EntryTypes.FILE_DIR_TYPE,
EntryTypes.FILE_TYPE,
]);
const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
const wantBigintFsStats = process.platform === 'win32';
const emptyFn = (_entryInfo) => true;
const normalizeFilter = (filter) => {
if (filter === undefined)
return emptyFn;
if (typeof filter === 'function')
return filter;
if (typeof filter === 'string') {
const fl = filter.trim();
return (entry) => entry.basename === fl;
}
if (Array.isArray(filter)) {
const trItems = filter.map((item) => item.trim());
return (entry) => trItems.some((f) => entry.basename === f);
}
return emptyFn;
};
/** Readable readdir stream, emitting new files as they're being listed. */
export class ReaddirpStream extends Readable {
constructor(options = {}) {
super({
objectMode: true,
autoDestroy: true,
highWaterMark: options.highWaterMark,
});
const opts = { ...defaultOptions, ...options };
const { root, type } = opts;
this._fileFilter = normalizeFilter(opts.fileFilter);
this._directoryFilter = normalizeFilter(opts.directoryFilter);
const statMethod = opts.lstat ? lstat : stat;
// Use bigint stats if it's windows and stat() supports options (node 10+).
if (wantBigintFsStats) {
this._stat = (path) => statMethod(path, { bigint: true });
}
else {
this._stat = statMethod;
}
this._maxDepth = opts.depth ?? defaultOptions.depth;
this._wantsDir = type ? DIR_TYPES.has(type) : false;
this._wantsFile = type ? FILE_TYPES.has(type) : false;
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
this._root = presolve(root);
this._isDirent = !opts.alwaysStat;
this._statsProp = this._isDirent ? 'dirent' : 'stats';
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
// Launch stream with one parent, the root dir.
this.parents = [this._exploreDir(root, 1)];
this.reading = false;
this.parent = undefined;
}
async _read(batch) {
if (this.reading)
return;
this.reading = true;
try {
while (!this.destroyed && batch > 0) {
const par = this.parent;
const fil = par && par.files;
if (fil && fil.length > 0) {
const { path, depth } = par;
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
const awaited = await Promise.all(slice);
for (const entry of awaited) {
if (!entry)
continue;
if (this.destroyed)
return;
const entryType = await this._getEntryType(entry);
if (entryType === 'directory' && this._directoryFilter(entry)) {
if (depth <= this._maxDepth) {
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
}
if (this._wantsDir) {
this.push(entry);
batch--;
}
}
else if ((entryType === 'file' || this._includeAsFile(entry)) &&
this._fileFilter(entry)) {
if (this._wantsFile) {
this.push(entry);
batch--;
}
}
}
}
else {
const parent = this.parents.pop();
if (!parent) {
this.push(null);
break;
}
this.parent = await parent;
if (this.destroyed)
return;
}
}
}
catch (error) {
this.destroy(error);
}
finally {
this.reading = false;
}
}
async _exploreDir(path, depth) {
let files;
try {
files = await readdir(path, this._rdOptions);
}
catch (error) {
this._onError(error);
}
return { files, depth, path };
}
async _formatEntry(dirent, path) {
let entry;
const basename = this._isDirent ? dirent.name : dirent;
try {
const fullPath = presolve(pjoin(path, basename));
entry = { path: prelative(this._root, fullPath), fullPath, basename };
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
}
catch (err) {
this._onError(err);
return;
}
return entry;
}
_onError(err) {
if (isNormalFlowError(err) && !this.destroyed) {
this.emit('warn', err);
}
else {
this.destroy(err);
}
}
async _getEntryType(entry) {
// entry may be undefined, because a warning or an error were emitted
// and the statsProp is undefined
if (!entry && this._statsProp in entry) {
return '';
}
const stats = entry[this._statsProp];
if (stats.isFile())
return 'file';
if (stats.isDirectory())
return 'directory';
if (stats && stats.isSymbolicLink()) {
const full = entry.fullPath;
try {
const entryRealPath = await realpath(full);
const entryRealPathStats = await lstat(entryRealPath);
if (entryRealPathStats.isFile()) {
return 'file';
}
if (entryRealPathStats.isDirectory()) {
const len = entryRealPath.length;
if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
// @ts-ignore
recursiveError.code = RECURSIVE_ERROR_CODE;
return this._onError(recursiveError);
}
return 'directory';
}
}
catch (error) {
this._onError(error);
return '';
}
}
}
_includeAsFile(entry) {
const stats = entry && entry[this._statsProp];
return stats && this._wantsEverything && !stats.isDirectory();
}
}
/**
* Streaming version: Reads all files and directories in given root recursively.
* Consumes ~constant small amount of RAM.
* @param root Root directory
* @param options Options to specify root (start directory), filters and recursion depth
*/
export function readdirp(root, options = {}) {
// @ts-ignore
let type = options.entryType || options.type;
if (type === 'both')
type = EntryTypes.FILE_DIR_TYPE; // backwards-compatibility
if (type)
options.type = type;
if (!root) {
throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
}
else if (typeof root !== 'string') {
throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
}
else if (type && !ALL_TYPES.includes(type)) {
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
}
options.root = root;
return new ReaddirpStream(options);
}
/**
* Promise version: Reads all files and directories in given root recursively.
* Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed.
* @returns array of paths and their entry infos
*/
export function readdirpPromise(root, options = {}) {
return new Promise((resolve, reject) => {
const files = [];
readdirp(root, options)
.on('data', (entry) => files.push(entry))
.on('end', () => resolve(files))
.on('error', (error) => reject(error));
});
}
export default readdirp;
@@ -0,0 +1,288 @@
import type { StrictEqualUsingTSInternalIdenticalToOperator, IsNever, UnionToIntersection, UnionToTuple } from './utils';
/**
* The simple(ish) way to get overload info from a function
* {@linkcode FunctionType}. Recent versions of TypeScript will match any
* function against a generic 10-overload type, filling in slots with
* duplicates of the function. So, we can just match against a single type
* and get all the overloads.
*
* For older versions of TypeScript, we'll need to painstakingly do
* ten separate matches.
*/
export type TSPost53OverloadsInfoUnion<FunctionType> = FunctionType extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
(...args: infer A7): infer R7;
(...args: infer A8): infer R8;
(...args: infer A9): infer R9;
(...args: infer A10): infer R10;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) | ((...p: A6) => R6) | ((...p: A7) => R7) | ((...p: A8) => R8) | ((...p: A9) => R9) | ((...p: A10) => R10) : never;
/**
* A function with `unknown` parameters and return type.
*/
export type UnknownFunction = (...args: unknown[]) => unknown;
/**
* `true` iff {@linkcode FunctionType} is
* equivalent to `(...args: unknown[]) => unknown`,
* which is what an overload variant looks like for a non-existent overload.
* This is useful because older versions of TypeScript end up with
* 9 "useless" overloads and one real one for parameterless/generic functions.
*
* @see {@link https://github.com/microsoft/TypeScript/issues/28867 | Related}
*/
export type IsUselessOverloadInfo<FunctionType> = StrictEqualUsingTSInternalIdenticalToOperator<FunctionType, UnknownFunction>;
/**
* Old versions of TypeScript can sometimes seem to refuse to separate out
* union members unless you put them each in a pointless tuple and add an
* extra `infer X` expression. There may be a better way to work around this
* problem, but since it's not a problem in newer versions of TypeScript,
* it's not a priority right now.
*/
export type Tuplify<Union> = Union extends infer X ? [X] : never;
/**
* For older versions of TypeScript, we need two separate workarounds
* to get overload info. First, we need need to use
* {@linkcode DecreasingOverloadsInfoUnion} to get the overload info for
* functions with 1-10 overloads. Then, we need to filter out the
* "useless" overloads that are present in older versions of TypeScript,
* for parameterless functions. To do this we use
* {@linkcode IsUselessOverloadInfo} to remove useless overloads.
*
* @see {@link https://github.com/microsoft/TypeScript/issues/28867 | Related}
*/
export type TSPre53OverloadsInfoUnion<FunctionType> = Tuplify<DecreasingOverloadsInfoUnion<FunctionType>> extends infer Tup ? Tup extends [infer Fn] ? IsUselessOverloadInfo<Fn> extends true ? never : Fn : never : never;
/**
* For versions of TypeScript below 5.3, we need to check for 10 overloads,
* then 9, then 8, etc., to get a union of the overload variants.
*/
export type DecreasingOverloadsInfoUnion<F> = F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
(...args: infer A7): infer R7;
(...args: infer A8): infer R8;
(...args: infer A9): infer R9;
(...args: infer A10): infer R10;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) | ((...p: A6) => R6) | ((...p: A7) => R7) | ((...p: A8) => R8) | ((...p: A9) => R9) | ((...p: A10) => R10) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
(...args: infer A7): infer R7;
(...args: infer A8): infer R8;
(...args: infer A9): infer R9;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) | ((...p: A6) => R6) | ((...p: A7) => R7) | ((...p: A8) => R8) | ((...p: A9) => R9) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
(...args: infer A7): infer R7;
(...args: infer A8): infer R8;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) | ((...p: A6) => R6) | ((...p: A7) => R7) | ((...p: A8) => R8) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
(...args: infer A7): infer R7;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) | ((...p: A6) => R6) | ((...p: A7) => R7) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) | ((...p: A6) => R6) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) | ((...p: A5) => R5) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) | ((...p: A4) => R4) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) | ((...p: A3) => R3) : F extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
} ? ((...p: A1) => R1) | ((...p: A2) => R2) : F extends (...args: infer A1) => infer R1 ? ((...p: A1) => R1) : never;
/**
* Get a union of overload variants for a function {@linkcode FunctionType}.
* Does a check for whether we can do the one-shot
* 10-overload matcher (which works for ts\>5.3), and if not,
* falls back to the more complicated utility.
*/
export type OverloadsInfoUnion<FunctionType> = IsNever<TSPost53OverloadsInfoUnion<(a: 1) => 2>> extends true ? TSPre53OverloadsInfoUnion<FunctionType> : TSPost53OverloadsInfoUnion<FunctionType>;
/**
* Allows inferring any function using the `infer` keyword.
*/
export type InferFunctionType<FunctionType extends (...args: any) => any> = FunctionType;
/**
* A union type of the parameters allowed for any
* overload of function {@linkcode FunctionType}.
*/
export type OverloadParameters<FunctionType> = OverloadsInfoUnion<FunctionType> extends InferFunctionType<infer Fn> ? Parameters<Fn> : never;
/**
* A union type of the return types for any overload of
* function {@linkcode FunctionType}.
*/
export type OverloadReturnTypes<FunctionType> = OverloadsInfoUnion<FunctionType> extends InferFunctionType<infer Fn> ? ReturnType<Fn> : never;
/**
* Takes an overload variants {@linkcode Union},
* produced from {@linkcode OverloadsInfoUnion} and rejects
* the ones incompatible with parameters {@linkcode Args}.
*/
export type SelectOverloadsInfo<Union extends UnknownFunction, Args extends unknown[]> = Union extends InferFunctionType<infer Fn> ? (Args extends Parameters<Fn> ? Fn : never) : never;
/**
* Creates a new overload (an intersection type) from an existing one,
* which only includes variant(s) which can accept
* {@linkcode Args} as parameters.
*/
export type OverloadsNarrowedByParameters<FunctionType, Args extends OverloadParameters<FunctionType>> = UnionToIntersection<SelectOverloadsInfo<OverloadsInfoUnion<FunctionType>, Args>>;
/**
* The simple(ish) way to get overload info from a constructor
* {@linkcode ConstructorType}. Recent versions of TypeScript will match any
* constructor against a generic 10-overload type, filling in slots with
* duplicates of the constructor. So, we can just match against a single type
* and get all the overloads.
*
* For older versions of TypeScript,
* we'll need to painstakingly do ten separate matches.
*/
export type TSPost53ConstructorOverloadsInfoUnion<ConstructorType> = ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
new (...args: infer A6): infer R6;
new (...args: infer A7): infer R7;
new (...args: infer A8): infer R8;
new (...args: infer A9): infer R9;
new (...args: infer A10): infer R10;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) | (new (...p: A6) => R6) | (new (...p: A7) => R7) | (new (...p: A8) => R8) | (new (...p: A9) => R9) | (new (...p: A10) => R10) : never;
/**
* A constructor function with `unknown` parameters and return type.
*/
export type UnknownConstructor = new (...args: unknown[]) => unknown;
/**
* Same as {@linkcode IsUselessOverloadInfo}, but for constructors.
*/
export type IsUselessConstructorOverloadInfo<FunctionType> = StrictEqualUsingTSInternalIdenticalToOperator<FunctionType, UnknownConstructor>;
/**
* For older versions of TypeScript, we need two separate workarounds to
* get constructor overload info. First, we need need to use
* {@linkcode DecreasingConstructorOverloadsInfoUnion} to get the overload
* info for constructors with 1-10 overloads. Then, we need to filter out the
* "useless" overloads that are present in older versions of TypeScript,
* for parameterless constructors. To do this we use
* {@linkcode IsUselessConstructorOverloadInfo} to remove useless overloads.
*
* @see {@link https://github.com/microsoft/TypeScript/issues/28867 | Related}
*/
export type TSPre53ConstructorOverloadsInfoUnion<ConstructorType> = Tuplify<DecreasingConstructorOverloadsInfoUnion<ConstructorType>> extends infer Tup ? Tup extends [infer Ctor] ? IsUselessConstructorOverloadInfo<Ctor> extends true ? never : Ctor : never : never;
/**
* For versions of TypeScript below 5.3, we need to check for 10 overloads,
* then 9, then 8, etc., to get a union of the overload variants.
*/
export type DecreasingConstructorOverloadsInfoUnion<ConstructorType> = ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
new (...args: infer A6): infer R6;
new (...args: infer A7): infer R7;
new (...args: infer A8): infer R8;
new (...args: infer A9): infer R9;
new (...args: infer A10): infer R10;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) | (new (...p: A6) => R6) | (new (...p: A7) => R7) | (new (...p: A8) => R8) | (new (...p: A9) => R9) | (new (...p: A10) => R10) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
new (...args: infer A6): infer R6;
new (...args: infer A7): infer R7;
new (...args: infer A8): infer R8;
new (...args: infer A9): infer R9;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) | (new (...p: A6) => R6) | (new (...p: A7) => R7) | (new (...p: A8) => R8) | (new (...p: A9) => R9) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
new (...args: infer A6): infer R6;
new (...args: infer A7): infer R7;
new (...args: infer A8): infer R8;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) | (new (...p: A6) => R6) | (new (...p: A7) => R7) | (new (...p: A8) => R8) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
new (...args: infer A6): infer R6;
new (...args: infer A7): infer R7;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) | (new (...p: A6) => R6) | (new (...p: A7) => R7) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
new (...args: infer A6): infer R6;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) | (new (...p: A6) => R6) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
new (...args: infer A5): infer R5;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) | (new (...p: A5) => R5) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
new (...args: infer A4): infer R4;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) | (new (...p: A4) => R4) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
new (...args: infer A3): infer R3;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) | (new (...p: A3) => R3) : ConstructorType extends {
new (...args: infer A1): infer R1;
new (...args: infer A2): infer R2;
} ? (new (...p: A1) => R1) | (new (...p: A2) => R2) : ConstructorType extends new (...args: infer A1) => infer R1 ? (new (...p: A1) => R1) : never;
/**
* Get a union of overload variants for a constructor
* {@linkcode ConstructorType}. Does a check for whether we can do the
* one-shot 10-overload matcher (which works for ts\>5.3), and if not,
* falls back to the more complicated utility.
*/
export type ConstructorOverloadsUnion<ConstructorType> = IsNever<TSPost53ConstructorOverloadsInfoUnion<new (a: 1) => any>> extends true ? TSPre53ConstructorOverloadsInfoUnion<ConstructorType> : TSPost53ConstructorOverloadsInfoUnion<ConstructorType>;
/**
* Allows inferring any constructor using the `infer` keyword.
*/
export type InferConstructor<ConstructorType extends new (...args: any) => any> = ConstructorType;
/**
* A union type of the parameters allowed for any overload
* of constructor {@linkcode ConstructorType}.
*/
export type ConstructorOverloadParameters<ConstructorType> = ConstructorOverloadsUnion<ConstructorType> extends InferConstructor<infer Ctor> ? ConstructorParameters<Ctor> : never;
/**
* Calculates the number of overloads for a given function type.
*/
export type NumOverloads<FunctionType> = UnionToTuple<OverloadsInfoUnion<FunctionType>>['length'];
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Barcode = createLucideIcon("Barcode", [
["path", { d: "M3 5v14", key: "1nt18q" }],
["path", { d: "M8 5v14", key: "1ybrkv" }],
["path", { d: "M12 5v14", key: "s699le" }],
["path", { d: "M17 5v14", key: "ycjyhj" }],
["path", { d: "M21 5v14", key: "nzette" }]
]);
export { Barcode as default };
//# sourceMappingURL=barcode.js.map
@@ -0,0 +1,9 @@
import { Parser, Printer } from "../index.js";
export declare const parsers: {
graphql: Parser;
};
export declare const printers: {
graphql: Printer;
};
@@ -0,0 +1,34 @@
import {SourceLocation} from './source_location';
/**
* A span of text within a source file.
*
* @category Logger
*/
export interface SourceSpan {
/** The beginning of this span, inclusive. */
start: SourceLocation;
/**
* The end of this span, exclusive.
*
* If {@link start} and {@link end} refer to the same location, the span has
* zero length and refers to the point immediately after {@link start} and
* before the next character.
*/
end: SourceLocation;
/** The canonical URL of the file this span refers to. */
url?: URL;
/** The text covered by the span. */
text: string;
/**
* Text surrounding the span.
*
* If this is set, it must include only whole lines, and it must include at
* least all line(s) which are partially covered by this span.
*/
context?: string;
}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './cloud-upload.js';
//# sourceMappingURL=upload-cloud.js.map
@@ -0,0 +1,65 @@
{
"name": "brace-expansion",
"description": "Brace expansion as known from sh/bash",
"version": "5.0.12",
"files": [
"dist"
],
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"type": "module",
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write .",
"format:check": "prettier --check .",
"benchmark": "node benchmark/index.js",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"devDependencies": {
"@types/brace-expansion": "^1.1.2",
"@types/node": "^25.2.1",
"mkdirp": "^3.0.1",
"prettier": "^3.3.2",
"tap": "^21.6.2",
"tshy": "^3.0.2",
"typedoc": "^0.28.5"
},
"dependencies": {
"balanced-match": "^4.0.2"
},
"license": "MIT",
"engines": {
"node": "20 || >=22"
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/juliangruber/brace-expansion.git"
}
}
@@ -0,0 +1,606 @@
'use strict'
const log = require('./log')
const { existsSync } = require('fs')
const { win32: path } = require('path')
const { regSearchKeys, execFile } = require('./util')
class VisualStudioFinder {
static findVisualStudio = (...args) => new VisualStudioFinder(...args).findVisualStudio()
log = log.withPrefix('find VS')
regSearchKeys = regSearchKeys
constructor (nodeSemver, configMsvsVersion) {
this.nodeSemver = nodeSemver
this.configMsvsVersion = configMsvsVersion
this.errorLog = []
this.validVersions = []
}
// Logs a message at verbose level, but also saves it to be displayed later
// at error level if an error occurs. This should help diagnose the problem.
addLog (message) {
this.log.verbose(message)
this.errorLog.push(message)
}
async findVisualStudio () {
this.configVersionYear = null
this.configPath = null
if (this.configMsvsVersion) {
this.addLog(`--msvs_version=${this.configMsvsVersion} was set on the command line`)
if (this.configMsvsVersion.match(/^\d{4}$/)) {
this.configVersionYear = parseInt(this.configMsvsVersion, 10)
this.addLog(
`- looking for Visual Studio version ${this.configVersionYear}`)
} else {
this.configPath = path.resolve(this.configMsvsVersion)
this.addLog(
`- looking for Visual Studio installed in "${this.configPath}"`)
}
} else {
this.addLog('--msvs_version was not set on the command line')
}
if (process.env.VCINSTALLDIR) {
this.envVcInstallDir =
path.resolve(process.env.VCINSTALLDIR, '..')
this.addLog('running in VS Command Prompt, installation path is:\n' +
`"${this.envVcInstallDir}"\n- will only use this version`)
} else {
this.addLog('VCINSTALLDIR not set, not running in VS Command Prompt')
}
const checks = [
() => this.findVisualStudio2019OrNewerFromSpecifiedLocation(),
() => this.findVisualStudio2019OrNewerUsingSetupModule(),
() => this.findVisualStudio2019OrNewer(),
() => this.findVisualStudio2017FromSpecifiedLocation(),
() => this.findVisualStudio2017UsingSetupModule(),
() => this.findVisualStudio2017(),
() => this.findVisualStudio2015(),
() => this.findVisualStudio2013()
]
for (const check of checks) {
const info = await check()
if (info) {
return this.succeed(info)
}
}
return this.fail()
}
succeed (info) {
this.log.info(`using VS${info.versionYear} (${info.version}) found at:` +
`\n"${info.path}"` +
'\nrun with --verbose for detailed information')
return info
}
fail () {
if (this.configMsvsVersion && this.envVcInstallDir) {
this.errorLog.push(
'msvs_version does not match this VS Command Prompt or the',
'installation cannot be used.')
} else if (this.configMsvsVersion) {
// If msvs_version was specified but finding VS failed, print what would
// have been accepted
this.errorLog.push('')
if (this.validVersions) {
this.errorLog.push('valid versions for msvs_version:')
this.validVersions.forEach((version) => {
this.errorLog.push(`- "${version}"`)
})
} else {
this.errorLog.push('no valid versions for msvs_version were found')
}
}
const errorLog = this.errorLog.join('\n')
// For Windows 80 col console, use up to the column before the one marked
// with X (total 79 chars including logger prefix, 62 chars usable here):
// X
const infoLog = [
'**************************************************************',
'You need to install the latest version of Visual Studio',
'including the "Desktop development with C++" workload.',
'For more information consult the documentation at:',
'https://github.com/nodejs/node-gyp#on-windows',
'**************************************************************'
].join('\n')
this.log.error(`\n${errorLog}\n\n${infoLog}\n`)
throw new Error('Could not find any Visual Studio installation to use')
}
async findVisualStudio2019OrNewerFromSpecifiedLocation () {
return this.findVSFromSpecifiedLocation([2019, 2022, 2026])
}
async findVisualStudio2017FromSpecifiedLocation () {
if (this.nodeSemver.major >= 22) {
this.addLog(
'not looking for VS2017 as it is only supported up to Node.js 21')
return null
}
return this.findVSFromSpecifiedLocation([2017])
}
async findVSFromSpecifiedLocation (supportedYears) {
if (!this.envVcInstallDir) {
return null
}
const info = {
path: path.resolve(this.envVcInstallDir),
// Assume the version specified by the user is correct.
// Since Visual Studio 2015, the Developer Command Prompt sets the
// VSCMD_VER environment variable which contains the version information
// for Visual Studio.
// https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022
version: process.env.VSCMD_VER,
packages: [
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
// Assume MSBuild exists. It will be checked in processing.
'Microsoft.VisualStudio.VC.MSBuild.Base'
]
}
// Is there a better way to get SDK information?
const envWindowsSDKVersion = process.env.WindowsSDKVersion
const sdkVersionMatched = envWindowsSDKVersion?.match(/^(\d+)\.(\d+)\.(\d+)\..*/)
if (sdkVersionMatched) {
info.packages.push(`Microsoft.VisualStudio.Component.Windows10SDK.${sdkVersionMatched[3]}.Desktop`)
}
// pass for further processing
return this.processData([info], supportedYears)
}
async findVisualStudio2019OrNewerUsingSetupModule () {
return this.findNewVSUsingSetupModule([2019, 2022, 2026])
}
async findVisualStudio2017UsingSetupModule () {
if (this.nodeSemver.major >= 22) {
this.addLog(
'not looking for VS2017 as it is only supported up to Node.js 21')
return null
}
return this.findNewVSUsingSetupModule([2017])
}
async findNewVSUsingSetupModule (supportedYears) {
const ps = path.join(process.env.SystemRoot, 'System32',
'WindowsPowerShell', 'v1.0', 'powershell.exe')
const vcInstallDir = this.envVcInstallDir
const checkModuleArgs = [
'-NoProfile',
'-Command',
'&{@(Get-Module -ListAvailable -Name VSSetup).Version.ToString()}'
]
this.log.silly('Running', ps, checkModuleArgs)
const [cErr] = await this.execFile(ps, checkModuleArgs)
if (cErr) {
this.addLog('VSSetup module doesn\'t seem to exist. You can install it via: "Install-Module VSSetup -Scope CurrentUser"')
this.log.silly('VSSetup error = %j', cErr && (cErr.stack || cErr))
return null
}
const filterArg = vcInstallDir !== undefined ? `| where {$_.InstallationPath -eq '${vcInstallDir}' }` : ''
const psArgs = [
'-NoProfile',
'-Command',
`&{Get-VSSetupInstance ${filterArg} | ConvertTo-Json -Depth 3}`
]
this.log.silly('Running', ps, psArgs)
const [err, stdout, stderr] = await this.execFile(ps, psArgs)
let parsedData = this.parseData(err, stdout, stderr)
if (parsedData === null) {
return null
}
this.log.silly('Parsed data', parsedData)
if (!Array.isArray(parsedData)) {
// if there are only 1 result, then Powershell will output non-array
parsedData = [parsedData]
}
// normalize output
parsedData = parsedData.map((info) => {
info.path = info.InstallationPath
info.version = `${info.InstallationVersion.Major}.${info.InstallationVersion.Minor}.${info.InstallationVersion.Build}.${info.InstallationVersion.Revision}`
info.packages = info.Packages.map((p) => p.Id)
return info
})
// pass for further processing
return this.processData(parsedData, supportedYears)
}
// Invoke the PowerShell script to get information about Visual Studio 2019
// or newer installations
async findVisualStudio2019OrNewer () {
return this.findNewVS([2019, 2022, 2026])
}
// Invoke the PowerShell script to get information about Visual Studio 2017
async findVisualStudio2017 () {
if (this.nodeSemver.major >= 22) {
this.addLog(
'not looking for VS2017 as it is only supported up to Node.js 21')
return null
}
return this.findNewVS([2017])
}
// Invoke the PowerShell script to get information about Visual Studio 2017
// or newer installations
async findNewVS (supportedYears) {
const ps = path.join(process.env.SystemRoot, 'System32',
'WindowsPowerShell', 'v1.0', 'powershell.exe')
const csFile = path.join(__dirname, 'Find-VisualStudio.cs')
const psArgs = [
'-ExecutionPolicy',
'Unrestricted',
'-NoProfile',
'-Command',
'&{Add-Type -IgnoreWarnings -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}'
]
this.log.silly('Running', ps, psArgs)
const [err, stdout, stderr] = await this.execFile(ps, psArgs)
const parsedData = this.parseData(err, stdout, stderr, { checkIsArray: true })
if (parsedData === null) {
return null
}
return this.processData(parsedData, supportedYears)
}
// Parse the output of the PowerShell script, make sanity checks
parseData (err, stdout, stderr, sanityCheckOptions) {
const defaultOptions = {
checkIsArray: false
}
// Merging provided options with the default options
const sanityOptions = { ...defaultOptions, ...sanityCheckOptions }
this.log.silly('PS stderr = %j', stderr)
const failPowershell = (failureDetails) => {
this.addLog(
`could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details. \n
Failure details: ${failureDetails}`)
return null
}
if (err) {
this.log.silly('PS err = %j', err && (err.stack || err))
return failPowershell(`${err}`.substring(0, 40))
}
let vsInfo
try {
vsInfo = JSON.parse(stdout)
} catch (e) {
this.log.silly('PS stdout = %j', stdout)
this.log.silly(e)
return failPowershell()
}
if (sanityOptions.checkIsArray && !Array.isArray(vsInfo)) {
this.log.silly('PS stdout = %j', stdout)
return failPowershell('Expected array as output of the PS script')
}
return vsInfo
}
// Process parsed data containing information about VS installations
// Look for the required parts, extract and output them back
processData (vsInfo, supportedYears) {
vsInfo = vsInfo.map((info) => {
this.log.silly(`processing installation: "${info.path}"`)
info.path = path.resolve(info.path)
const ret = this.getVersionInfo(info)
ret.path = info.path
ret.msBuild = this.getMSBuild(info, ret.versionYear)
ret.toolset = this.getToolset(info, ret.versionYear)
ret.sdk = this.getSDK(info)
return ret
})
this.log.silly('vsInfo:', vsInfo)
// Remove future versions or errors parsing version number
// Also remove any unsupported versions
vsInfo = vsInfo.filter((info) => {
if (info.versionYear && supportedYears.indexOf(info.versionYear) !== -1) {
return true
}
this.addLog(`${info.versionYear ? 'unsupported' : 'unknown'} version "${info.version}" found at "${info.path}"`)
return false
})
// Sort to place newer versions first
vsInfo.sort((a, b) => b.versionYear - a.versionYear)
for (let i = 0; i < vsInfo.length; ++i) {
const info = vsInfo[i]
this.addLog(`checking VS${info.versionYear} (${info.version}) found ` +
`at:\n"${info.path}"`)
if (info.msBuild) {
this.addLog('- found "Visual Studio C++ core features"')
} else {
this.addLog('- "Visual Studio C++ core features" missing')
continue
}
if (info.toolset) {
this.addLog(`- found VC++ toolset: ${info.toolset}`)
} else {
this.addLog('- missing any VC++ toolset')
continue
}
if (info.sdk) {
this.addLog(`- found Windows SDK: ${info.sdk}`)
} else {
this.addLog('- missing any Windows SDK')
continue
}
if (!this.checkConfigVersion(info.versionYear, info.path)) {
continue
}
return info
}
this.addLog(
'could not find a version of Visual Studio 2017 or newer to use')
return null
}
// Helper - process version information
getVersionInfo (info) {
const match = /^(\d+)\.(\d+)(?:\..*)?/.exec(info.version)
if (!match) {
this.log.silly('- failed to parse version:', info.version)
return {}
}
this.log.silly('- version match = %j', match)
const ret = {
version: info.version,
versionMajor: parseInt(match[1], 10),
versionMinor: parseInt(match[2], 10)
}
if (ret.versionMajor === 15) {
ret.versionYear = 2017
return ret
}
if (ret.versionMajor === 16) {
ret.versionYear = 2019
return ret
}
if (ret.versionMajor === 17) {
ret.versionYear = 2022
return ret
}
if (ret.versionMajor === 18) {
ret.versionYear = 2026
return ret
}
this.log.silly('- unsupported version:', ret.versionMajor)
return {}
}
msBuildPathExists (path) {
return existsSync(path)
}
// Helper - process MSBuild information
getMSBuild (info, versionYear) {
const pkg = 'Microsoft.VisualStudio.VC.MSBuild.Base'
const msbuildPath = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe')
const msbuildPathArm64 = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'arm64', 'MSBuild.exe')
if (info.packages.indexOf(pkg) !== -1) {
this.log.silly('- found VC.MSBuild.Base')
if (versionYear === 2017) {
return path.join(info.path, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe')
}
if (versionYear === 2019) {
if (process.arch === 'arm64' && this.msBuildPathExists(msbuildPathArm64)) {
return msbuildPathArm64
} else {
return msbuildPath
}
}
}
/**
* Visual Studio 2022 doesn't have the MSBuild package.
* Support for compiling _on_ ARM64 was added in MSVC 14.32.31326,
* so let's leverage it if the user has an ARM64 device.
*/
if (process.arch === 'arm64' && this.msBuildPathExists(msbuildPathArm64)) {
return msbuildPathArm64
} else if (this.msBuildPathExists(msbuildPath)) {
return msbuildPath
}
return null
}
// Helper - process toolset information
getToolset (info, versionYear) {
const vcToolsArm64 = 'VC.Tools.ARM64'
const pkgArm64 = `Microsoft.VisualStudio.Component.${vcToolsArm64}`
const vcToolsX64 = 'VC.Tools.x86.x64'
const pkgX64 = `Microsoft.VisualStudio.Component.${vcToolsX64}`
const express = 'Microsoft.VisualStudio.WDExpress'
if (process.arch === 'arm64' && info.packages.includes(pkgArm64)) {
this.log.silly(`- found ${vcToolsArm64}`)
} else if (info.packages.includes(pkgX64)) {
if (process.arch === 'arm64') {
this.addLog(`- found ${vcToolsX64} on ARM64 platform. Expect less performance and/or link failure with ARM64 binary.`)
} else {
this.log.silly(`- found ${vcToolsX64}`)
}
} else if (info.packages.includes(express)) {
this.log.silly('- found Visual Studio Express (looking for toolset)')
} else {
return null
}
if (versionYear === 2017) {
return 'v141'
} else if (versionYear === 2019) {
return 'v142'
} else if (versionYear === 2022) {
return 'v143'
} else if (versionYear === 2026) {
return 'v145'
}
this.log.silly('- invalid versionYear:', versionYear)
return null
}
// Helper - process Windows SDK information
getSDK (info) {
const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK'
const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.'
const win11SDKPrefix = 'Microsoft.VisualStudio.Component.Windows11SDK.'
let Win10or11SDKVer = 0
info.packages.forEach((pkg) => {
if (!pkg.startsWith(win10SDKPrefix) && !pkg.startsWith(win11SDKPrefix)) {
return
}
const parts = pkg.split('.')
if (parts.length > 5 && parts[5] !== 'Desktop') {
this.log.silly('- ignoring non-Desktop Win10/11SDK:', pkg)
return
}
const foundSdkVer = parseInt(parts[4], 10)
if (isNaN(foundSdkVer)) {
// Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb
this.log.silly('- failed to parse Win10/11SDK number:', pkg)
return
}
this.log.silly('- found Win10/11SDK:', foundSdkVer)
Win10or11SDKVer = Math.max(Win10or11SDKVer, foundSdkVer)
})
if (Win10or11SDKVer !== 0) {
return `10.0.${Win10or11SDKVer}.0`
} else if (info.packages.indexOf(win8SDK) !== -1) {
this.log.silly('- found Win8SDK')
return '8.1'
}
return null
}
// Find an installation of Visual Studio 2015 to use
async findVisualStudio2015 () {
if (this.nodeSemver.major >= 19) {
this.addLog(
'not looking for VS2015 as it is only supported up to Node.js 18')
return null
}
return this.findOldVS({
version: '14.0',
versionMajor: 14,
versionMinor: 0,
versionYear: 2015,
toolset: 'v140'
})
}
// Find an installation of Visual Studio 2013 to use
async findVisualStudio2013 () {
if (this.nodeSemver.major >= 9) {
this.addLog(
'not looking for VS2013 as it is only supported up to Node.js 8')
return null
}
return this.findOldVS({
version: '12.0',
versionMajor: 12,
versionMinor: 0,
versionYear: 2013,
toolset: 'v120'
})
}
// Helper - common code for VS2013 and VS2015
async findOldVS (info) {
const regVC7 = ['HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7',
'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7']
const regMSBuild = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions'
this.addLog(`looking for Visual Studio ${info.versionYear}`)
try {
let res = await this.regSearchKeys(regVC7, info.version, [])
const vsPath = path.resolve(res, '..')
this.addLog(`- found in "${vsPath}"`)
const msBuildRegOpts = process.arch === 'ia32' ? [] : ['/reg:32']
try {
res = await this.regSearchKeys([`${regMSBuild}\\${info.version}`], 'MSBuildToolsPath', msBuildRegOpts)
} catch (err) {
this.addLog('- could not find MSBuild in registry for this version')
return null
}
const msBuild = path.join(res, 'MSBuild.exe')
this.addLog(`- MSBuild in "${msBuild}"`)
if (!this.checkConfigVersion(info.versionYear, vsPath)) {
return null
}
info.path = vsPath
info.msBuild = msBuild
info.sdk = null
return info
} catch (err) {
this.addLog('- not found')
return null
}
}
// After finding a usable version of Visual Studio:
// - add it to validVersions to be displayed at the end if a specific
// version was requested and not found;
// - check if this is the version that was requested.
// - check if this matches the Visual Studio Command Prompt
checkConfigVersion (versionYear, vsPath) {
this.validVersions.push(versionYear)
this.validVersions.push(vsPath)
if (this.configVersionYear && this.configVersionYear !== versionYear) {
this.addLog('- msvs_version does not match this version')
return false
}
if (this.configPath &&
path.relative(this.configPath, vsPath) !== '') {
this.addLog('- msvs_version does not point to this installation')
return false
}
if (this.envVcInstallDir &&
path.relative(this.envVcInstallDir, vsPath) !== '') {
this.addLog('- does not match this Visual Studio Command Prompt')
return false
}
return true
}
async execFile (exec, args) {
return await execFile(exec, args, { encoding: 'utf8' })
}
}
module.exports = VisualStudioFinder
@@ -0,0 +1 @@
{"version":3,"file":"debounce.mjs","sources":["../../src/utils/debounce.ts"],"sourcesContent":[null],"names":["func","wait","isImmediate","timeout","debounce","args","context","later","undefined","apply","shouldCallNow","clearTimeout","setTimeout"],"mappings":"AAEA;;;;;AAKG;AACH,eAAe,CACbA,IAAO,EACPC,IAAY,EACZC,WAAqB,KAC6C;AAClE,EAAA,IAAIC,OAAkD;AACtD,EAAA,OAAO,SAASC,QAAQA,CAA6B,GAAGC,IAAmB,EAAA;AACzE;IACA,MAAMC,OAAO,GAAG,IAAI;IACpB,MAAMC,KAAK,GAAGA,MAAK;AACjBJ,MAAAA,OAAO,GAAGK,SAAS;MACnB,IAAI,CAACN,WAAW,EAAE;AAChBF,QAAAA,IAAI,CAACS,KAAK,CAACH,OAAO,EAAED,IAAI,CAAC;AAC3B,MAAA;IACF,CAAC;AACD,IAAA,MAAMK,aAAa,GAAGR,WAAW,IAAI,CAACC,OAAO;IAC7C,IAAIA,OAAO,KAAKK,SAAS,EAAE;MACzBG,YAAY,CAACR,OAAO,CAAC;AACvB,IAAA;AACAA,IAAAA,OAAO,GAAGS,UAAU,CAACL,KAAK,EAAEN,IAAI,CAAC;AACjC,IAAA,IAAIS,aAAa,EAAE;AACjBV,MAAAA,IAAI,CAACS,KAAK,CAACH,OAAO,EAAED,IAAI,CAAC;AACzB,MAAA;AACF,IAAA;AAEA,IAAA,OAAOG,SAAS;EAClB,CAAC;AACH,CAAC;;;;"}
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Crown = createLucideIcon("Crown", [
[
"path",
{
d: "M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",
key: "1vdc57"
}
],
["path", { d: "M5 21h14", key: "11awu3" }]
]);
export { Crown as default };
//# sourceMappingURL=crown.js.map
@@ -0,0 +1 @@
{"version":3,"file":"files.js","sources":["../../../src/icons/files.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Files\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgN2gtM2EyIDIgMCAwIDEtMi0yVjIiIC8+CiAgPHBhdGggZD0iTTkgMThhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJoN2w0IDR2MTBhMiAyIDAgMCAxLTIgMloiIC8+CiAgPHBhdGggZD0iTTMgNy42djEyLjhBMS42IDEuNiAwIDAgMCA0LjYgMjJoOS44IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/files\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Files = createLucideIcon('Files', [\n ['path', { d: 'M20 7h-3a2 2 0 0 1-2-2V2', key: 'x099mo' }],\n ['path', { d: 'M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z', key: '18t6ie' }],\n ['path', { d: 'M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8', key: '1nja0z' }],\n]);\n\nexport default Files;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACvE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/scroll-area.tsx", "../src/use-state-machine.ts"],
"sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Presence } from '@radix-ui/react-presence';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useStateMachine } from './use-state-machine';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Sizes = {\n content: number;\n viewport: number;\n scrollbar: {\n size: number;\n paddingStart: number;\n paddingEnd: number;\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollArea\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_AREA_NAME = 'ScrollArea';\n\ntype ScopedProps<P> = P & { __scopeScrollArea?: Scope };\nconst [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);\n\ntype ScrollAreaContextValue = {\n type: 'auto' | 'always' | 'scroll' | 'hover';\n dir: Direction;\n scrollHideDelay: number;\n scrollArea: ScrollAreaElement | null;\n viewport: ScrollAreaViewportElement | null;\n onViewportChange(viewport: ScrollAreaViewportElement | null): void;\n content: HTMLDivElement | null;\n onContentChange(content: HTMLDivElement): void;\n scrollbarX: ScrollAreaScrollbarElement | null;\n onScrollbarXChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarXEnabled: boolean;\n onScrollbarXEnabledChange(rendered: boolean): void;\n scrollbarY: ScrollAreaScrollbarElement | null;\n onScrollbarYChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarYEnabled: boolean;\n onScrollbarYEnabledChange(rendered: boolean): void;\n onCornerWidthChange(width: number): void;\n onCornerHeightChange(height: number): void;\n};\n\nconst [ScrollAreaProvider, useScrollAreaContext] =\n createScrollAreaContext<ScrollAreaContextValue>(SCROLL_AREA_NAME);\n\ntype ScrollAreaElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface ScrollAreaProps extends PrimitiveDivProps {\n type?: ScrollAreaContextValue['type'];\n dir?: ScrollAreaContextValue['dir'];\n scrollHideDelay?: number;\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>(\n (props: ScopedProps<ScrollAreaProps>, forwardedRef) => {\n const {\n __scopeScrollArea,\n type = 'hover',\n dir,\n scrollHideDelay = 600,\n ...scrollAreaProps\n } = props;\n const [scrollArea, setScrollArea] = React.useState<ScrollAreaElement | null>(null);\n const [viewport, setViewport] = React.useState<ScrollAreaViewportElement | null>(null);\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const [scrollbarX, setScrollbarX] = React.useState<ScrollAreaScrollbarElement | null>(null);\n const [scrollbarY, setScrollbarY] = React.useState<ScrollAreaScrollbarElement | null>(null);\n const [cornerWidth, setCornerWidth] = React.useState(0);\n const [cornerHeight, setCornerHeight] = React.useState(0);\n const [scrollbarXEnabled, setScrollbarXEnabled] = React.useState(false);\n const [scrollbarYEnabled, setScrollbarYEnabled] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));\n const direction = useDirection(dir);\n\n return (\n <ScrollAreaProvider\n scope={__scopeScrollArea}\n type={type}\n dir={direction}\n scrollHideDelay={scrollHideDelay}\n scrollArea={scrollArea}\n viewport={viewport}\n onViewportChange={setViewport}\n content={content}\n onContentChange={setContent}\n scrollbarX={scrollbarX}\n onScrollbarXChange={setScrollbarX}\n scrollbarXEnabled={scrollbarXEnabled}\n onScrollbarXEnabledChange={setScrollbarXEnabled}\n scrollbarY={scrollbarY}\n onScrollbarYChange={setScrollbarY}\n scrollbarYEnabled={scrollbarYEnabled}\n onScrollbarYEnabledChange={setScrollbarYEnabled}\n onCornerWidthChange={setCornerWidth}\n onCornerHeightChange={setCornerHeight}\n >\n <Primitive.div\n dir={direction}\n {...scrollAreaProps}\n ref={composedRefs}\n style={{\n position: 'relative',\n // Pass corner sizes as CSS vars to reduce re-renders of context consumers\n ['--radix-scroll-area-corner-width' as any]: cornerWidth + 'px',\n ['--radix-scroll-area-corner-height' as any]: coLine truncated
"mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,4BAA4B;;;ACTrC,YAAY,WAAW;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;AD0FQ,SAqCF,UArCE,KAqCF,YArCE;AAhFR,IAAM,mBAAmB;AAGzB,IAAM,CAAC,yBAAyB,qBAAqB,IAAI,mBAAmB,gBAAgB;AAuB5F,IAAM,CAAC,oBAAoB,oBAAoB,IAC7C,wBAAgD,gBAAgB;AAUlE,IAAM,aAAmB;AAAA,EACvB,CAAC,OAAqC,iBAAiB;AACrD,UAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,CAAC,YAAY,aAAa,IAAU,gBAAmC,IAAI;AACjF,UAAM,CAAC,UAAU,WAAW,IAAU,gBAA2C,IAAI;AACrF,UAAM,CAAC,SAAS,UAAU,IAAU,gBAAgC,IAAI;AACxE,UAAM,CAAC,YAAY,aAAa,IAAU,gBAA4C,IAAI;AAC1F,UAAM,CAAC,YAAY,aAAa,IAAU,gBAA4C,IAAI;AAC1F,UAAM,CAAC,aAAa,cAAc,IAAU,gBAAS,CAAC;AACtD,UAAM,CAAC,cAAc,eAAe,IAAU,gBAAS,CAAC;AACxD,UAAM,CAAC,mBAAmB,oBAAoB,IAAU,gBAAS,KAAK;AACtE,UAAM,CAAC,mBAAmB,oBAAoB,IAAU,gBAAS,KAAK;AACtE,UAAM,eAAe,gBAAgB,cAAc,CAAC,SAAS,cAAc,IAAI,CAAC;AAChF,UAAM,YAAY,aAAa,GAAG;AAElC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,QAClB;AAAA,QACA,iBAAiB;AAAA,QACjB;AAAA,QACA,oBAAoB;AAAA,QACpB;AAAA,QACA,2BAA2B;AAAA,QAC3B;AAAA,QACA,oBAAoB;AAAA,QACpB;AAAA,QACA,2BAA2B;AAAA,QAC3B,qBAAqB;AAAA,QACrB,sBAAsB;AAAA,QAEtB;AAAA,UAAC,UAAU;AAAA,UAAV;AAAA,YACC,KAAK;AAAA,YACJ,GAAG;AAAA,YACJ,KAAK;AAAA,YACL,OAAO;AAAA,cACL,UAAU;AAAA;AAAA,cAEV,CAAC,kCAAyC,GAAG,cAAc;AAAA,cAC3D,CAAC,mCAA0C,GAAG,eAAe;AAAA,cAC7D,GAAG,MAAM;AAAA,YACX;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AAMzB,IAAM,gBAAgB;AAOtB,IAAM,qBAA2B;AAAA,EAC/B,CAAC,OAA6C,iBAAiB;AAC7D,UAAM,EAAE,mBAAmB,UAAU,OAAO,GAAG,cAAc,IAAI;AACjE,UAAM,UAAU,qBAAqB,eAAe,iBAAiB;AACrE,UAAM,MAAY,cAAkC,IAAI;AACxD,UAAM,eAAe,gBAAgB,cAAc,KAAK,QAAQ,gBAAgB;AAChF,WACE,iCAEE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,yBAAyB;AAAA,YACvB,QAAQ;AAAA,UACV;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MACA;AAAA,QAAC,UAAU;AAAA,QAAV;AAAA,UACC,mCAAgC;AAAA,UAC/B,GAAG;AAAA,UACJ,KAAK;AAAA,UACL,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAYL,WAAW,QAAQ,oBAAoB,WAAW;AAAA,YAClD,WAAW,QAAQ,oBAAoB,WAAW;AAAA,YAClD,GAAG,MAAM;AAAA,UACX;AAAA,UASA,8BAAC,SAAI,KAAK,QAAQ,iBAAiB,OAAO,EAAE,UAAU,QAAQ,SAAS,QAAQ,GAC5E,UACH;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,mBAAmB,cAAc;AAMjC,IAAM,iBAAiB;AAOvB,IAAM,sBAA4B;AAAA,EAChC,CAAC,OAA8C,iBAAiB;AAC9D,UAAM,EAAE,YAAY,GAAG,eAAe,IAAI;AAC1C,UAAM,UAAU,qBAAqB,gBAAgB,MAAM,iBAAiB;AAC5E,UAAM,EAAE,2BAA2B,0BAA0B,IAAI;AACjE,UAAM,eAAe,MAAM,gBAAgB;AAE3C,IAAM,iBAAU,MAAM;AACpB,qBAAe,0BAA0B,IAAI,IAAI,0BAA0B,IAAI;AAC/E,aAAO,MAAM;AACX,uBAAe,0BAA0B,KAAK,IAAI,0BAA0B,KAAK;AAAA,MACnF;AAAA,IACF,GAAG,CAAC,cAAc,2BAA2B,yBAAyB,CAAC;AAEvE,WAAO,QAAQ,SAAS,UACtB,oBAAC,4BAA0B,GAAG,gBAAgB,KAAK,cAAc,YAAwB,IACvF,QAAQ,SAAS,WACnB,oBAAC,6BAA2B,GAAG,gBAAgB,KAAK,cAAc,YAAwB,IACxF,QAAQ,SAAS,SACnB,oBAAC,2BAAyB,GAAG,gBAAgB,KAAK,cAAc,YAAwB,IACtF,QAAQ,SAAS,WACnB,oBAAC,8BAA4B,GAAG,gBAAgB,KAAK,cAAc,IACjE;AAAA,EACN;AACF;AAEA,oBAAoB,cAAc;AASlC,IAAM,2BAAiC,kBAGrC,CAAC,OAAmD,iBAAiB;AACrE,QAAM,EAAE,YAAY,GAAG,eAAe,IAAI;AAC1C,QAAM,UAAU,qBAAqB,gBAAgB,MAAM,iBAAiB;AAC5E,QAAM,CAAC,SAAS,UAAU,IAAU,gBAAS,KAAK;AAElD,EAAM,iBAAU,MAAM;AACpB,UAAM,aAAa,QAAQ;AAC3B,QAAI,YAAY;AAChB,QAAI,YAAY;AACd,YAAM,qBAAqB,MAAM;AAC/B,eAAO,aAAa,SAAS;AAC7B,mBAAW,IAAI;AAAA,MACjB;AACA,YAAM,qBAAqB,MAAM;AAC/B,oBAAY,OAAO,WAAW,MAAM,WAAW,KAAK,GAAG,QAAQ,eAAe;AAAA,MAChF;AACA,iBAAW,iBAAiB,gBAAgB,kBAAkB;AAC9D,iBAAW,iBAAiB,gBAAgB,kBAAkB;AAC9D,aAAO,MAAM;AACX,eAAO,aAAa,SAAS;AAC7B,mBAAW,oBAAoB,gBAAgB,kBAAkB;AACjE,mBAAW,oBAAoB,gBAAgB,kBAAkB;AAAA,MACnE;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,YAAY,QAAQ,eAAe,CAAC;AAEhD,SACE,oBAAC,YAAS,SAAS,cAAc,SAC/B;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,UAAU,YAAY;AAAA,MACjC,GAAG;AAAA,MACJ,KAAK;AAAA;AAAA,EACP,GACF;AAEJ,CAAC;AAOD,IAAM,4BAAkC,kBAGtC,CAAC,OAAoD,iBAAiB;AACtE,QAAM,EAAE,YAAY,GAAG,eAAe,IAAI;AAC1C,QAAM,UAAU,qBAAqB,gBAAgB,MAAM,iBAAiB;AAC5E,QAAM,eAAe,MAAM,gBAAgB;AAC3C,QAAM,oBAAoB,oBAAoB,MAAM,KAAK,YAAY,GAAG,GAAG;AAC3E,QAAM,CAAC,OAAO,IAAI,IAAI,gBAAgB,UAAU;AAAA,IAC9C,QAAQ;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,IACA,WAAW;AAAA,MACT,YAAY;AAAA,MACZ,eAAe;AAAA,IACjB;AAAA,IACA,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,eAAe;AAAA,IACjB;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,eAAe;AAAA,IACjB;AAAA,EACF,CAAC;AAED,EAAM,iBAAU,MAAM;AACpB,QAAI,UAAU,QAAQ;AACpB,YAAM,YAAY,OAAO,WAAW,MAAM,KAAK,MAAM,GAAG,QAAQ,eAAe;AAC/E,aAAO,MAAM,OAAO,aAAa,SAAS;AAAA,IAC5C;AAAA,EACF,GAAG,CAAC,OAAO,QAAQ,iBAAiB,IAAI,CAAC;AAEzC,EAAM,iBAAU,MAAM;AACpB,UAAM,WAAW,QAAQ;AACzB,UAAM,kBAAkB,eAAe,eAAe;AAEtD,QAAI,UAAU;AACZ,UAAI,gBAAgB,SAAS,eAAe;AAC5C,YAAM,eAAe,MAAM;AACzB,cAAM,YAAY,SAAS,eAAe;AAC1C,cAAM,8BAA8B,kBAAkB;AACtD,YAAI,6BAA6B;AAC/B,eAAK,QAAQ;AACb,4BAAkB;AAAA,QACpB;AACA,wBAAgB;AAAA,MAClB;AACA,eAAS,iBAAiB,UAAU,YAAY;AAChD,aAAO,MAAM,SAAS,oBAAoB,UAAU,YAAY;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,QAAQ,UAAU,cAAc,MAAM,iBAAiB,CAAC;AAE5D,SACE,oBAAC,YAAS,SAAS,cAAc,UAAU,UACzC;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,UAAU,WAAW,WAAW;AAAA,MAC3C,GAAG;AAAA,MACJ,KAAK;AAALine truncated
"names": ["React", "height", "width"]
}
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OptionValidator = void 0;
var _findSuggestion = require("./find-suggestion.js");
class OptionValidator {
constructor(descriptor) {
this.descriptor = descriptor;
}
validateTopLevelOptions(options, TopLevelOptionShape) {
const validOptionNames = Object.keys(TopLevelOptionShape);
for (const option of Object.keys(options)) {
if (!validOptionNames.includes(option)) {
throw new Error(this.formatMessage(`'${option}' is not a valid top-level option.
- Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`));
}
}
}
validateBooleanOption(name, value, defaultValue) {
if (value === undefined) {
return defaultValue;
} else {
this.invariant(typeof value === "boolean", `'${name}' option must be a boolean.`);
}
return value;
}
validateStringOption(name, value, defaultValue) {
if (value === undefined) {
return defaultValue;
} else {
this.invariant(typeof value === "string", `'${name}' option must be a string.`);
}
return value;
}
invariant(condition, message) {
if (!condition) {
throw new Error(this.formatMessage(message));
}
}
formatMessage(message) {
return `${this.descriptor}: ${message}`;
}
}
exports.OptionValidator = OptionValidator;
//# sourceMappingURL=validator.js.map
@@ -0,0 +1,9 @@
import { Measurable } from '@radix-ui/rect';
/**
* Use this custom hook to get access to an element's rect (getBoundingClientRect)
* and observe it along time.
*/
declare function useRect(measurable: Measurable | null): DOMRect | undefined;
export { useRect };
@@ -0,0 +1,119 @@
// src/slot.tsx
import * as React from "react";
import { composeRefs } from "@radix-ui/react-compose-refs";
import { Fragment as Fragment2, jsx } from "react/jsx-runtime";
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
var use = React[" use ".trim().toString()];
function isPromiseLike(value) {
return typeof value === "object" && value !== null && "then" in value;
}
function isLazyComponent(element) {
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
}
// @__NO_SIDE_EFFECTS__
function createSlot(ownerName) {
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
const Slot2 = React.forwardRef((props, forwardedRef) => {
let { children, ...slotProps } = props;
if (isLazyComponent(children) && typeof use === "function") {
children = use(children._payload);
}
const childrenArray = React.Children.toArray(children);
const slottable = childrenArray.find(isSlottable);
if (slottable) {
const newElement = slottable.props.children;
const newChildren = childrenArray.map((child) => {
if (child === slottable) {
if (React.Children.count(newElement) > 1) return React.Children.only(null);
return React.isValidElement(newElement) ? newElement.props.children : null;
} else {
return child;
}
});
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
}
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
});
Slot2.displayName = `${ownerName}.Slot`;
return Slot2;
}
var Slot = /* @__PURE__ */ createSlot("Slot");
// @__NO_SIDE_EFFECTS__
function createSlotClone(ownerName) {
const SlotClone = React.forwardRef((props, forwardedRef) => {
let { children, ...slotProps } = props;
if (isLazyComponent(children) && typeof use === "function") {
children = use(children._payload);
}
if (React.isValidElement(children)) {
const childrenRef = getElementRef(children);
const props2 = mergeProps(slotProps, children.props);
if (children.type !== React.Fragment) {
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
}
return React.cloneElement(children, props2);
}
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
});
SlotClone.displayName = `${ownerName}.SlotClone`;
return SlotClone;
}
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
// @__NO_SIDE_EFFECTS__
function createSlottable(ownerName) {
const Slottable2 = ({ children }) => {
return /* @__PURE__ */ jsx(Fragment2, { children });
};
Slottable2.displayName = `${ownerName}.Slottable`;
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
return Slottable2;
}
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
function isSlottable(child) {
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
}
function mergeProps(slotProps, childProps) {
const overrideProps = { ...childProps };
for (const propName in childProps) {
const slotPropValue = slotProps[propName];
const childPropValue = childProps[propName];
const isHandler = /^on[A-Z]/.test(propName);
if (isHandler) {
if (slotPropValue && childPropValue) {
overrideProps[propName] = (...args) => {
const result = childPropValue(...args);
slotPropValue(...args);
return result;
};
} else if (slotPropValue) {
overrideProps[propName] = slotPropValue;
}
} else if (propName === "style") {
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
} else if (propName === "className") {
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
}
}
return { ...slotProps, ...overrideProps };
}
function getElementRef(element) {
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
if (mayWarn) {
return element.ref;
}
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
if (mayWarn) {
return element.props.ref;
}
return element.props.ref || element.ref;
}
export {
Slot as Root,
Slot,
Slottable,
createSlot,
createSlottable
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,66 @@
import { Y as isTopLevelExpressionStatement, f as createRule, g as import_ast_utils, t as FixTracker } from "../utils.js";
var no_extra_semi_default = createRule({
name: "no-extra-semi",
meta: {
type: "layout",
docs: { description: "Disallow unnecessary semicolons" },
fixable: "code",
schema: [],
messages: { unexpected: "Unnecessary semicolon." }
},
create(context) {
const sourceCode = context.sourceCode;
function isFixable(nodeOrToken) {
const nextToken = sourceCode.getTokenAfter(nodeOrToken);
if (!nextToken || nextToken.type !== "String") return true;
return !isTopLevelExpressionStatement(sourceCode.getNodeByRangeIndex(nextToken.range[0]).parent);
}
function report(nodeOrToken) {
context.report({
node: nodeOrToken,
messageId: "unexpected",
fix: isFixable(nodeOrToken) ? (fixer) => new FixTracker(fixer, context.sourceCode).retainSurroundingTokens(nodeOrToken).remove(nodeOrToken) : null
});
}
function checkForPartOfClassBody(firstToken) {
for (let token = firstToken; token.type === "Punctuator" && !(0, import_ast_utils.isClosingBraceToken)(token); token = sourceCode.getTokenAfter(token)) if ((0, import_ast_utils.isSemicolonToken)(token)) report(token);
}
return {
EmptyStatement(node) {
const parent = node.parent;
if (![
"ForStatement",
"ForInStatement",
"ForOfStatement",
"WhileStatement",
"DoWhileStatement",
"IfStatement",
"LabeledStatement",
"WithStatement"
].includes(parent.type)) report(node);
},
ClassBody(node) {
checkForPartOfClassBody(sourceCode.getFirstToken(node, 1));
},
MethodDefinition(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
},
PropertyDefinition(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
},
AccessorProperty(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
},
StaticBlock(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
},
TSAbstractMethodDefinition(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
},
TSAbstractPropertyDefinition(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
}
};
}
});
export { no_extra_semi_default as t };
@@ -0,0 +1,7 @@
//#region src/adapter/cloudflare-workers/conninfo.ts
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
const getConnInfo = (c) => ({ remote: { address: c.req.header("cf-connecting-ip") } });
//#endregion
export { getConnInfo };
@@ -0,0 +1,134 @@
import { getPattern, splitPath, splitRoutingPath } from "../../utils/url.js";
import "../../router.js";
import { createNullObject } from "../utils.js";
//#region src/router/trie-router/node.ts
const emptyParams = createNullObject();
let order = 0;
var Node = class Node {
#methods = [];
#children = createNullObject();
#patterns = [];
#pattern;
#params = emptyParams;
insert(method, path, handler) {
let curNode = this;
const parts = splitRoutingPath(path);
const possibleKeys = /* @__PURE__ */ new Set();
let i = 0;
for (const p of parts) {
const nextP = parts[++i];
const pattern = getPattern(p, nextP) || (nextP === void 0 && p && p.indexOf("*") === p.length - 1 ? p : null);
const isParam = Array.isArray(pattern);
const key = isParam ? pattern[0] : pattern || p;
const child = curNode.#children[key] ||= new Node();
if (pattern && !child.#pattern) {
child.#pattern = pattern;
curNode.#patterns.push(child);
}
curNode = child;
if (isParam) possibleKeys.add(pattern[1]);
}
curNode.#methods.push({ [method]: {
handler,
possibleKeys: [...possibleKeys],
score: ++order
} });
}
#pushHandlerSets(handlerSets, node, method, nodeParams, params) {
for (let i = 0, len = node.#methods.length; i < len; i++) {
const m = node.#methods[i];
const handlerSet = m[method] || m["ALL"];
if (handlerSet) {
handlerSet.params = createNullObject();
handlerSets.push(handlerSet);
for (let i = 0, len = handlerSet.possibleKeys.length; i < len; i++) {
const key = handlerSet.possibleKeys[i];
handlerSet.params[key] = params?.[key] && !i ? params[key] : nodeParams[key] ?? params?.[key];
}
}
}
}
search(method, path) {
const handlerSets = [];
this.#params = emptyParams;
let curNodes = [this];
const parts = splitPath(path);
const curNodesQueue = [];
const len = parts.length;
let partOffsets = null;
for (let i = 0; i < len; i++) {
const part = parts[i];
const isLast = i === len - 1;
const tempNodes = [];
for (let j = 0, len2 = curNodes.length; j < len2; j++) {
const node = curNodes[j];
const nextNode = node.#children[part];
if (nextNode) {
nextNode.#params = node.#params;
if (isLast) {
if (nextNode.#children["*"]) this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params);
this.#pushHandlerSets(handlerSets, nextNode, method, node.#params);
} else tempNodes.push(nextNode);
}
for (const child of node.#patterns) {
const pattern = child.#pattern;
const params = node.#params === emptyParams ? {} : { ...node.#params };
if (typeof pattern === "string") {
if (pattern === "*" || part.startsWith(pattern.slice(0, -1))) {
this.#pushHandlerSets(handlerSets, child, method, node.#params);
if (pattern === "*") {
child.#params = params;
tempNodes.push(child);
}
}
continue;
}
const [, name, matcher] = pattern;
if (!part && matcher === true) continue;
if (matcher !== true) {
if (!partOffsets) {
partOffsets = [];
let offset = path[0] === "/" ? 1 : 0;
for (let p = 0; p < len; p++) {
partOffsets[p] = offset;
offset += parts[p].length + 1;
}
}
const restPathString = path.slice(partOffsets[i]);
const m = matcher.exec(restPathString);
if (m) {
params[name] = m[0];
this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
if (m[0].length === restPathString.length && child.#children["*"]) this.#pushHandlerSets(handlerSets, child.#children["*"], method, node.#params, params);
for (const _ in child.#children) {
child.#params = params;
const componentCount = m[0].match(/\//g)?.length ?? 0;
(curNodesQueue[componentCount] ||= []).push(child);
break;
}
continue;
}
}
if (matcher === true || matcher.test(part)) {
params[name] = part;
if (isLast) {
this.#pushHandlerSets(handlerSets, child, method, params, node.#params);
if (child.#children["*"]) this.#pushHandlerSets(handlerSets, child.#children["*"], method, params, node.#params);
} else {
child.#params = params;
tempNodes.push(child);
}
}
}
}
const shifted = curNodesQueue.shift();
curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
}
if (handlerSets[1]) handlerSets.sort((a, b) => {
return a.score - b.score;
});
return [handlerSets.map(({ handler, params }) => [handler, params])];
}
};
//#endregion
export { Node };
@@ -0,0 +1,82 @@
module.exports = function (obj, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
var space = opts.space || '';
if (typeof space === 'number') space = Array(space+1).join(' ');
var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
var replacer = opts.replacer || function(key, value) { return value; };
var cmp = opts.cmp && (function (f) {
return function (node) {
return function (a, b) {
var aobj = { key: a, value: node[a] };
var bobj = { key: b, value: node[b] };
return f(aobj, bobj);
};
};
})(opts.cmp);
var seen = [];
return (function stringify (parent, key, node, level) {
var indent = space ? ('\n' + new Array(level + 1).join(space)) : '';
var colonSeparator = space ? ': ' : ':';
if (node && node.toJSON && typeof node.toJSON === 'function') {
node = node.toJSON();
}
node = replacer.call(parent, key, node);
if (node === undefined) {
return;
}
if (typeof node !== 'object' || node === null) {
return JSON.stringify(node);
}
if (isArray(node)) {
var out = [];
for (var i = 0; i < node.length; i++) {
var item = stringify(node, i, node[i], level+1) || JSON.stringify(null);
out.push(indent + space + item);
}
return '[' + out.join(',') + indent + ']';
}
else {
if (seen.indexOf(node) !== -1) {
if (cycles) return JSON.stringify('__cycle__');
throw new TypeError('Converting circular structure to JSON');
}
else seen.push(node);
var keys = objectKeys(node).sort(cmp && cmp(node));
var out = [];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = stringify(node, key, node[key], level+1);
if(!value) continue;
var keyValue = JSON.stringify(key)
+ colonSeparator
+ value;
;
out.push(indent + space + keyValue);
}
seen.splice(seen.indexOf(node), 1);
return '{' + out.join(',') + indent + '}';
}
})({ '': obj }, '', obj, 0);
};
var isArray = Array.isArray || function (x) {
return {}.toString.call(x) === '[object Array]';
};
var objectKeys = Object.keys || function (obj) {
var has = Object.prototype.hasOwnProperty || function () { return true };
var keys = [];
for (var key in obj) {
if (has.call(obj, key)) keys.push(key);
}
return keys;
};
@@ -0,0 +1,7 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "es5",
"ignoreDeprecations": "6.0",
},
}
@@ -0,0 +1,227 @@
/**
* @fileoverview Rule to disallow specified names in exports
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow specified names in exports",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-restricted-exports",
},
schema: [
{
anyOf: [
{
type: "object",
properties: {
restrictedNamedExports: {
type: "array",
items: {
type: "string",
},
uniqueItems: true,
},
restrictedNamedExportsPattern: { type: "string" },
},
additionalProperties: false,
},
{
type: "object",
properties: {
restrictedNamedExports: {
type: "array",
items: {
type: "string",
pattern: "^(?!default$)",
},
uniqueItems: true,
},
restrictedNamedExportsPattern: { type: "string" },
restrictDefaultExports: {
type: "object",
properties: {
// Allow/Disallow `export default foo; export default 42; export default function foo() {}` format
direct: {
type: "boolean",
},
// Allow/Disallow `export { foo as default };` declarations
named: {
type: "boolean",
},
// Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations
defaultFrom: {
type: "boolean",
},
// Allow/Disallow `export { foo as default } from "mod";` declarations
namedFrom: {
type: "boolean",
},
// Allow/Disallow `export * as default from "mod"`; declarations
namespaceFrom: {
type: "boolean",
},
},
additionalProperties: false,
},
},
additionalProperties: false,
},
],
},
],
messages: {
restrictedNamed:
"'{{name}}' is restricted from being used as an exported name.",
restrictedDefault: "Exporting 'default' is restricted.",
},
},
create(context) {
const restrictedNames = new Set(
context.options[0] && context.options[0].restrictedNamedExports,
);
const restrictedNamePattern =
context.options[0] &&
context.options[0].restrictedNamedExportsPattern;
const restrictDefaultExports =
context.options[0] && context.options[0].restrictDefaultExports;
const sourceCode = context.sourceCode;
/**
* Checks and reports given exported name.
* @param {ASTNode} node exported `Identifier` or string `Literal` node to check.
* @returns {void}
*/
function checkExportedName(node) {
const name = astUtils.getModuleExportName(node);
let matchesRestrictedNamePattern = false;
if (restrictedNamePattern && name !== "default") {
const patternRegex = new RegExp(restrictedNamePattern, "u");
matchesRestrictedNamePattern = patternRegex.test(name);
}
if (matchesRestrictedNamePattern || restrictedNames.has(name)) {
context.report({
node,
messageId: "restrictedNamed",
data: { name },
});
return;
}
if (name === "default") {
if (node.parent.type === "ExportAllDeclaration") {
if (
restrictDefaultExports &&
restrictDefaultExports.namespaceFrom
) {
context.report({
node,
messageId: "restrictedDefault",
});
}
} else {
// ExportSpecifier
const isSourceSpecified = !!node.parent.parent.source;
const specifierLocalName = astUtils.getModuleExportName(
node.parent.local,
);
if (
!isSourceSpecified &&
restrictDefaultExports &&
restrictDefaultExports.named
) {
context.report({
node,
messageId: "restrictedDefault",
});
return;
}
if (isSourceSpecified && restrictDefaultExports) {
if (
(specifierLocalName === "default" &&
restrictDefaultExports.defaultFrom) ||
(specifierLocalName !== "default" &&
restrictDefaultExports.namedFrom)
) {
context.report({
node,
messageId: "restrictedDefault",
});
}
}
}
}
}
return {
ExportAllDeclaration(node) {
if (node.exported) {
checkExportedName(node.exported);
}
},
ExportDefaultDeclaration(node) {
if (restrictDefaultExports && restrictDefaultExports.direct) {
context.report({
node,
messageId: "restrictedDefault",
});
}
},
ExportNamedDeclaration(node) {
const declaration = node.declaration;
if (declaration) {
if (
declaration.type === "FunctionDeclaration" ||
declaration.type === "ClassDeclaration"
) {
checkExportedName(declaration.id);
} else if (declaration.type === "VariableDeclaration") {
sourceCode
.getDeclaredVariables(declaration)
.map(v =>
v.defs.find(d => d.parent === declaration),
)
.map(d => d.name) // Identifier nodes
.forEach(checkExportedName);
}
} else {
node.specifiers
.map(s => s.exported)
.forEach(checkExportedName);
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../src/Parser.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1 @@
{"version":3,"file":"milk-off.js","sources":["../../../src/icons/milk-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MilkOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAyaDgiIC8+CiAgPHBhdGggZD0iTTkgMnYxLjM0M00xNSAydjIuNzg5YTQgNCAwIDAgMCAuNjcyIDIuMjE5bC42NTYuOTg0YTQgNCAwIDAgMSAuNjcyIDIuMjJ2MS4xMzFNNy44IDcuOGwtLjEyOC4xOTJBNCA0IDAgMCAwIDcgMTAuMjEyVjIwYTIgMiAwIDAgMCAyIDJoNmEyIDIgMCAwIDAgMi0ydi0zIiAvPgogIDxwYXRoIGQ9Ik03IDE1YTYuNDcgNi40NyAwIDAgMSA1IDAgNi40NzIgNi40NzIgMCAwIDAgMy40MzUuNDM1IiAvPgogIDxsaW5lIHgxPSIyIiB4Mj0iMjIiIHkxPSIyIiB5Mj0iMjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/milk-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MilkOff = createLucideIcon('MilkOff', [\n ['path', { d: 'M8 2h8', key: '1ssgc1' }],\n [\n 'path',\n {\n d: 'M9 2v1.343M15 2v2.789a4 4 0 0 0 .672 2.219l.656.984a4 4 0 0 1 .672 2.22v1.131M7.8 7.8l-.128.192A4 4 0 0 0 7 10.212V20a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-3',\n key: 'y0ejgx',\n },\n ],\n ['path', { d: 'M7 15a6.47 6.47 0 0 1 5 0 6.472 6.472 0 0 0 3.435.435', key: 'iaxqsy' }],\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n]);\n\nexport default MilkOff;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,33 @@
export {
_lt as lt,
_lte as lte,
_gt as gt,
_gte as gte,
_positive as positive,
_negative as negative,
_nonpositive as nonpositive,
_nonnegative as nonnegative,
_multipleOf as multipleOf,
_maxSize as maxSize,
_minSize as minSize,
_size as size,
_maxLength as maxLength,
_minLength as minLength,
_length as length,
_regex as regex,
_lowercase as lowercase,
_uppercase as uppercase,
_includes as includes,
_startsWith as startsWith,
_endsWith as endsWith,
_property as property,
_properties as properties,
_mime as mime,
_overwrite as overwrite,
_normalize as normalize,
_trim as trim,
_toLowerCase as toLowerCase,
_toUpperCase as toUpperCase,
_slugify as slugify,
type $RefinementCtx as RefinementCtx,
} from "../core/index.js";
@@ -0,0 +1 @@
{"version":3,"names":["_assertClassBrand","require","_classPrivateFieldSet2","privateMap","receiver","value","set","assertClassBrand"],"sources":["../../src/helpers/classPrivateFieldSet2.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nimport assertClassBrand from \"./assertClassBrand.ts\";\n\nexport default function _classPrivateFieldSet2(\n privateMap: WeakMap<any, any>,\n receiver: any,\n value: any,\n) {\n privateMap.set(assertClassBrand(privateMap, receiver), value);\n return value;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,sBAAsBA,CAC5CC,UAA6B,EAC7BC,QAAa,EACbC,KAAU,EACV;EACAF,UAAU,CAACG,GAAG,CAAC,IAAAC,yBAAgB,EAACJ,UAAU,EAAEC,QAAQ,CAAC,EAAEC,KAAK,CAAC;EAC7D,OAAOA,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,89 @@
export type Schema = ObjectSchema | ArraySchema | StringSchema | NumberSchema | IntegerSchema | BooleanSchema | NullSchema;
export type _JSONSchema = boolean | JSONSchema;
export type SchemaType = "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
export type JSONSchema = {
[k: string]: unknown;
$schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
$id?: string;
$anchor?: string;
$ref?: string;
$dynamicRef?: string;
$dynamicAnchor?: string;
$vocabulary?: Record<string, boolean>;
$comment?: string;
$defs?: Record<string, JSONSchema>;
type?: SchemaType | SchemaType[];
additionalItems?: _JSONSchema;
unevaluatedItems?: _JSONSchema;
prefixItems?: _JSONSchema[];
items?: _JSONSchema | _JSONSchema[];
contains?: _JSONSchema;
additionalProperties?: _JSONSchema;
unevaluatedProperties?: _JSONSchema;
properties?: Record<string, _JSONSchema>;
patternProperties?: Record<string, _JSONSchema>;
dependentSchemas?: Record<string, _JSONSchema>;
propertyNames?: _JSONSchema;
if?: _JSONSchema;
then?: _JSONSchema;
else?: _JSONSchema;
allOf?: JSONSchema[];
anyOf?: JSONSchema[];
oneOf?: JSONSchema[];
not?: _JSONSchema;
multipleOf?: number;
maximum?: number;
exclusiveMaximum?: number | boolean;
minimum?: number;
exclusiveMinimum?: number | boolean;
maxLength?: number;
minLength?: number;
pattern?: string;
maxItems?: number;
minItems?: number;
uniqueItems?: boolean;
maxContains?: number;
minContains?: number;
maxProperties?: number;
minProperties?: number;
required?: string[];
dependentRequired?: Record<string, string[]>;
enum?: Array<string | number | boolean | null>;
const?: string | number | boolean | null;
id?: string;
title?: string;
description?: string;
default?: unknown;
deprecated?: boolean;
readOnly?: boolean;
writeOnly?: boolean;
nullable?: boolean;
examples?: unknown[];
format?: string;
contentMediaType?: string;
contentEncoding?: string;
contentSchema?: JSONSchema;
_prefault?: unknown;
};
export type BaseSchema = JSONSchema;
export interface ObjectSchema extends JSONSchema {
type: "object";
}
export interface ArraySchema extends JSONSchema {
type: "array";
}
export interface StringSchema extends JSONSchema {
type: "string";
}
export interface NumberSchema extends JSONSchema {
type: "number";
}
export interface IntegerSchema extends JSONSchema {
type: "integer";
}
export interface BooleanSchema extends JSONSchema {
type: "boolean";
}
export interface NullSchema extends JSONSchema {
type: "null";
}
@@ -0,0 +1,276 @@
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_useRouter = require("./useRouter.cjs");
const require_useMatch = require("./useMatch.cjs");
const require_useLoaderData = require("./useLoaderData.cjs");
const require_useLoaderDeps = require("./useLoaderDeps.cjs");
const require_useParams = require("./useParams.cjs");
const require_useSearch = require("./useSearch.cjs");
const require_useNavigate = require("./useNavigate.cjs");
const require_useRouteContext = require("./useRouteContext.cjs");
const require_link = require("./link.cjs");
let _tanstack_router_core = require("@tanstack/router-core");
let react = require("react");
react = require_runtime.__toESM(react);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/route.tsx
/**
* Returns a route-specific API that exposes type-safe hooks pre-bound
* to a single route ID. Useful for consuming a route's APIs from files
* where the route object isn't directly imported (e.g. code-split files).
*
* @param id Route ID string literal for the target route.
* @returns A `RouteApi` instance bound to the given route ID.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/getRouteApiFunction
*/
function getRouteApi(id) {
return new RouteApi({ id });
}
var RouteApi = class extends _tanstack_router_core.BaseRouteApi {
/**
* @deprecated Use the `getRouteApi` function instead.
*/
constructor({ id }) {
super({ id });
this.useMatch = (opts) => {
return require_useMatch.useMatch({
select: opts?.select,
from: this.id,
structuralSharing: opts?.structuralSharing
});
};
this.useRouteContext = (opts) => {
return require_useRouteContext.useRouteContext({
...opts,
from: this.id
});
};
this.useSearch = (opts) => {
return require_useSearch.useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id
});
};
this.useParams = (opts) => {
return require_useParams.useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id
});
};
this.useLoaderDeps = (opts) => {
return require_useLoaderDeps.useLoaderDeps({
...opts,
from: this.id,
strict: false
});
};
this.useLoaderData = (opts) => {
return require_useLoaderData.useLoaderData({
...opts,
from: this.id,
strict: false
});
};
this.useNavigate = () => {
return require_useNavigate.useNavigate({ from: require_useRouter.useRouter().routesById[this.id].fullPath });
};
this.notFound = (opts) => {
return (0, _tanstack_router_core.notFound)({
routeId: this.id,
...opts
});
};
this.Link = react.default.forwardRef((props, ref) => {
const fullPath = require_useRouter.useRouter().routesById[this.id].fullPath;
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
ref,
from: fullPath,
...props
});
});
}
};
var Route = class extends _tanstack_router_core.BaseRoute {
/**
* @deprecated Use the `createRoute` function instead.
*/
constructor(options) {
super(options);
this.useMatch = (opts) => {
return require_useMatch.useMatch({
select: opts?.select,
from: this.id,
structuralSharing: opts?.structuralSharing
});
};
this.useRouteContext = (opts) => {
return require_useRouteContext.useRouteContext({
...opts,
from: this.id
});
};
this.useSearch = (opts) => {
return require_useSearch.useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id
});
};
this.useParams = (opts) => {
return require_useParams.useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id
});
};
this.useLoaderDeps = (opts) => {
return require_useLoaderDeps.useLoaderDeps({
...opts,
from: this.id
});
};
this.useLoaderData = (opts) => {
return require_useLoaderData.useLoaderData({
...opts,
from: this.id
});
};
this.useNavigate = () => {
return require_useNavigate.useNavigate({ from: this.fullPath });
};
this.Link = react.default.forwardRef((props, ref) => {
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
ref,
from: this.fullPath,
...props
});
});
}
};
/**
* Creates a non-root Route instance for code-based routing.
*
* Use this to define a route that will be composed into a route tree
* (typically via a parent route's `addChildren`). If you're using file-based
* routing, prefer `createFileRoute`.
*
* @param options Route options (path, component, loader, context, etc.).
* @returns A Route instance to be attached to the route tree.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction
*/
function createRoute(options) {
return new Route(options);
}
/**
* Creates a root route factory that requires a router context type.
*
* Use when your root route expects `context` to be provided to `createRouter`.
* The returned function behaves like `createRootRoute` but enforces a context type.
*
* @returns A factory function to configure and return a root route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction
*/
function createRootRouteWithContext() {
return (options) => {
return createRootRoute(options);
};
}
/**
* @deprecated Use the `createRootRouteWithContext` function instead.
*/
var rootRouteWithContext = createRootRouteWithContext;
var RootRoute = class extends _tanstack_router_core.BaseRootRoute {
/**
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
*/
constructor(options) {
super(options);
this.useMatch = (opts) => {
return require_useMatch.useMatch({
select: opts?.select,
from: this.id,
structuralSharing: opts?.structuralSharing
});
};
this.useRouteContext = (opts) => {
return require_useRouteContext.useRouteContext({
...opts,
from: this.id
});
};
this.useSearch = (opts) => {
return require_useSearch.useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id
});
};
this.useParams = (opts) => {
return require_useParams.useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id
});
};
this.useLoaderDeps = (opts) => {
return require_useLoaderDeps.useLoaderDeps({
...opts,
from: this.id
});
};
this.useLoaderData = (opts) => {
return require_useLoaderData.useLoaderData({
...opts,
from: this.id
});
};
this.useNavigate = () => {
return require_useNavigate.useNavigate({ from: this.fullPath });
};
this.Link = react.default.forwardRef((props, ref) => {
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
ref,
from: this.fullPath,
...props
});
});
}
};
/**
* Creates a root Route instance used to build your route tree.
*
* Typically paired with `createRouter({ routeTree })`. If you need to require
* a typed router context, use `createRootRouteWithContext` instead.
*
* @param options Root route options (component, error, pending, etc.).
* @returns A root route instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction
*/
function createRootRoute(options) {
return new RootRoute(options);
}
function createRouteMask(opts) {
return opts;
}
var NotFoundRoute = class extends Route {
constructor(options) {
super({
...options,
id: "404"
});
}
};
//#endregion
exports.NotFoundRoute = NotFoundRoute;
exports.RootRoute = RootRoute;
exports.Route = Route;
exports.RouteApi = RouteApi;
exports.createRootRoute = createRootRoute;
exports.createRootRouteWithContext = createRootRouteWithContext;
exports.createRoute = createRoute;
exports.createRouteMask = createRouteMask;
exports.getRouteApi = getRouteApi;
exports.rootRouteWithContext = rootRouteWithContext;
//# sourceMappingURL=route.cjs.map
@@ -0,0 +1,15 @@
function shallowCompare(next, prev) {
if (!Array.isArray(prev))
return false;
const prevLength = prev.length;
if (prevLength !== next.length)
return false;
for (let i = 0; i < prevLength; i++) {
if (prev[i] !== next[i])
return false;
}
return true;
}
export { shallowCompare };
//# sourceMappingURL=shallow-compare.mjs.map
@@ -0,0 +1,19 @@
# @babel/helper-validator-option
> Validate plugin/preset options
See our website [@babel/helper-validator-option](https://babeljs.io/docs/babel-helper-validator-option) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-validator-option
```
or using yarn:
```sh
yarn add @babel/helper-validator-option
```
@@ -0,0 +1 @@
{"version":3,"file":"circle-slash-2.js","sources":["../../../src/icons/circle-slash-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleSlash2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMjIgMiAyIDIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-slash-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleSlash2 = createLucideIcon('CircleSlash2', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M22 2 2 22', key: 'y4kqgn' }],\n]);\n\nexport default CircleSlash2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uCAAuC;AACvC,cAAc,YAAY,CAAC;AAE3B,gCAAgC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,cAAc,CAAC;AAE7B,kBAAkB;AAClB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAEhC,wBAAwB;AACxB,cAAc,uBAAuB,CAAC;AAWtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,218 @@
flf2a$ 2 1 8 -1 13
1row font by unknown
=======================
-> Conversion to FigLet font by MEPH. (Part of ASCII Editor Service Pack I)
(http://studenten.freepage.de/meph/ascii/editor/_index.htm)
-> Defined: ASCII code alphanumeric
-> Uppercase characters only.
Was a part of a '1row' font collection. Author unknown.
$@
$@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
(\) @
@@
'| @
@@
^/_ @
@@
-} @
@@
+| @
@@
;~ @
@@
(o @
@@
"/ @
@@
{} @
@@
"| @
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
/\ @
@@
]3 @
@@
( @
@@
|) @
@@
[- @
@@
/= @
@@
(_, @
@@
|-| @
@@
| @
@@
_T @
@@
/< @
@@
|_ @
@@
|\/| @
@@
|\| @
@@
() @
@@
|^ @
@@
()_ @
@@
/? @
@@
_\~ @
@@
~|~ @
@@
|_| @
@@
\/ @
@@
\/\/ @
@@
>< @
@@
`/ @
@@
~/_ @
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
/\ @
@@
]3 @
@@
( @
@@
|) @
@@
[- @
@@
/= @
@@
(_, @
@@
|-| @
@@
| @
@@
_T @
@@
/< @
@@
|_ @
@@
|\/| @
@@
|\| @
@@
() @
@@
|^ @
@@
()_ @
@@
/? @
@@
_\~ @
@@
~|~ @
@@
|_| @
@@
\/ @
@@
\/\/ @
@@
>< @
@@
`/ @
@@
~/_ @
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@@ -0,0 +1,64 @@
import utils from '../../../../scoring/utils'
import { PasswordChanges } from '../matching/unmunger/getCleanPasswords'
export interface L33tOptions {
l33t: string
subs: PasswordChanges[]
token: string
}
export interface GetCountsOptions {
token: string
sub: PasswordChanges
}
const countSubstring = (string: string, substring: string) => {
let count = 0
let pos = string.indexOf(substring)
while (pos >= 0) {
count += 1
pos = string.indexOf(substring, pos + substring.length)
}
return count
}
const getCounts = ({ sub, token }: GetCountsOptions) => {
// lower-case match.token before calculating: capitalization shouldn't affect l33t calc.
const tokenLower = token.toLowerCase()
// num of subbed chars
const subbedCount = countSubstring(tokenLower, sub.substitution)
// num of unsubbed chars
const unsubbedCount = countSubstring(tokenLower, sub.letter)
return {
subbedCount,
unsubbedCount,
}
}
export default ({ l33t, subs, token }: L33tOptions) => {
if (!l33t) {
return 1
}
let variations = 1
subs.forEach((sub) => {
const { subbedCount, unsubbedCount } = getCounts({ sub, token })
if (subbedCount === 0 || unsubbedCount === 0) {
// for this sub, password is either fully subbed (444) or fully unsubbed (aaa)
// treat that as doubling the space (attacker needs to try fully subbed chars in addition to
// unsubbed.)
variations *= 2
} else {
// this case is similar to capitalization:
// with aa44a, U = 3, S = 2, attacker needs to try unsubbed + one sub + two subs
const p = Math.min(unsubbedCount, subbedCount)
let possibilities = 0
for (let i = 1; i <= p; i += 1) {
possibilities += utils.nCk(unsubbedCount + subbedCount, i)
}
variations *= possibilities
}
})
return variations
}
@@ -0,0 +1,9 @@
import { HandlerCallback } from './handlerCallback.cjs';
import { AnyRouter } from '../router.cjs';
import { Manifest } from '../manifest.cjs';
export type RequestHandler<TRouter extends AnyRouter> = (cb: HandlerCallback<TRouter>) => Promise<Response>;
export declare function createRequestHandler<TRouter extends AnyRouter>({ createRouter, request, getRouterManifest, }: {
createRouter: () => TRouter;
request: Request;
getRouterManifest?: () => Manifest | Promise<Manifest>;
}): RequestHandler<TRouter>;
@@ -0,0 +1,350 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("./types");
const __1 = require("..");
const codegen_1 = require("../codegen");
const ref_error_1 = require("../ref_error");
const names_1 = require("../names");
const code_1 = require("../../vocabularies/code");
const ref_1 = require("../../vocabularies/jtd/ref");
const type_1 = require("../../vocabularies/jtd/type");
const parseJson_1 = require("../../runtime/parseJson");
const util_1 = require("../util");
const timestamp_1 = require("../../runtime/timestamp");
const genParse = {
elements: parseElements,
values: parseValues,
discriminator: parseDiscriminator,
properties: parseProperties,
optionalProperties: parseProperties,
enum: parseEnum,
type: parseType,
ref: parseRef,
};
function compileParser(sch, definitions) {
const _sch = __1.getCompilingSchema.call(this, sch);
if (_sch)
return _sch;
const { es5, lines } = this.opts.code;
const { ownProperties } = this.opts;
const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
const parseName = gen.scopeName("parse");
const cxt = {
self: this,
gen,
schema: sch.schema,
schemaEnv: sch,
definitions,
data: names_1.default.data,
parseName,
char: gen.name("c"),
};
let sourceCode;
try {
this._compilations.add(sch);
sch.parseName = parseName;
parserFunction(cxt);
gen.optimize(this.opts.code.optimize);
const parseFuncCode = gen.toString();
sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`;
const makeParse = new Function(`${names_1.default.scope}`, sourceCode);
const parse = makeParse(this.scope.get());
this.scope.value(parseName, { ref: parse });
sch.parse = parse;
}
catch (e) {
if (sourceCode)
this.logger.error("Error compiling parser, function code:", sourceCode);
delete sch.parse;
delete sch.parseName;
throw e;
}
finally {
this._compilations.delete(sch);
}
return sch;
}
exports.default = compileParser;
const undef = (0, codegen_1._) `undefined`;
function parserFunction(cxt) {
const { gen, parseName, char } = cxt;
gen.func(parseName, (0, codegen_1._) `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => {
gen.let(names_1.default.data);
gen.let(char);
gen.assign((0, codegen_1._) `${parseName}.message`, undef);
gen.assign((0, codegen_1._) `${parseName}.position`, undef);
gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${names_1.default.jsonPos} || 0`);
gen.const(names_1.default.jsonLen, (0, codegen_1._) `${names_1.default.json}.length`);
parseCode(cxt);
skipWhitespace(cxt);
gen.if(names_1.default.jsonPart, () => {
gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos);
gen.return(names_1.default.data);
});
gen.if((0, codegen_1._) `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data));
jsonSyntaxError(cxt);
});
}
function parseCode(cxt) {
let form;
for (const key of types_1.jtdForms) {
if (key in cxt.schema) {
form = key;
break;
}
}
if (form)
parseNullable(cxt, genParse[form]);
else
parseEmpty(cxt);
}
const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError));
function parseNullable(cxt, parseForm) {
const { gen, schema, data } = cxt;
if (!schema.nullable)
return parseForm(cxt);
tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null));
}
function parseElements(cxt) {
const { gen, schema, data } = cxt;
parseToken(cxt, "[");
const ix = gen.let("i", 0);
gen.assign(data, (0, codegen_1._) `[]`);
parseItems(cxt, "]", () => {
const el = gen.let("el");
parseCode({ ...cxt, schema: schema.elements, data: el });
gen.assign((0, codegen_1._) `${data}[${ix}++]`, el);
});
}
function parseValues(cxt) {
const { gen, schema, data } = cxt;
parseToken(cxt, "{");
gen.assign(data, (0, codegen_1._) `{}`);
parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values));
}
function parseItems(cxt, endToken, block) {
tryParseItems(cxt, endToken, block);
parseToken(cxt, endToken);
}
function tryParseItems(cxt, endToken, block) {
const { gen } = cxt;
gen.for((0, codegen_1._) `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => {
block();
tryParseToken(cxt, ",", () => gen.break(), hasItem);
});
function hasItem() {
tryParseToken(cxt, endToken, () => { }, jsonSyntaxError);
}
}
function parseKeyValue(cxt, schema) {
const { gen } = cxt;
const key = gen.let("key");
parseString({ ...cxt, data: key });
parseToken(cxt, ":");
parsePropertyValue(cxt, key, schema);
}
function parseDiscriminator(cxt) {
const { gen, data, schema } = cxt;
const { discriminator, mapping } = schema;
parseToken(cxt, "{");
gen.assign(data, (0, codegen_1._) `{}`);
const startPos = gen.const("pos", names_1.default.jsonPos);
const value = gen.let("value");
const tag = gen.let("tag");
tryParseItems(cxt, "}", () => {
const key = gen.let("key");
parseString({ ...cxt, data: key });
parseToken(cxt, ":");
gen.if((0, codegen_1._) `${key} === ${discriminator}`, () => {
parseString({ ...cxt, data: tag });
gen.assign((0, codegen_1._) `${data}[${key}]`, tag);
gen.break();
}, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped
);
});
gen.assign(names_1.default.jsonPos, startPos);
gen.if((0, codegen_1._) `${tag} === undefined`);
parsingError(cxt, (0, codegen_1.str) `discriminator tag not found`);
for (const tagValue in mapping) {
gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator);
}
gen.else();
parsingError(cxt, (0, codegen_1.str) `discriminator value not in schema`);
gen.endIf();
}
function parseProperties(cxt) {
const { gen, data } = cxt;
parseToken(cxt, "{");
gen.assign(data, (0, codegen_1._) `{}`);
parseSchemaProperties(cxt);
}
function parseSchemaProperties(cxt, discriminator) {
const { gen, schema, data } = cxt;
const { properties, optionalProperties, additionalProperties } = schema;
parseItems(cxt, "}", () => {
const key = gen.let("key");
parseString({ ...cxt, data: key });
parseToken(cxt, ":");
gen.if(false);
parseDefinedProperty(cxt, key, properties);
parseDefinedProperty(cxt, key, optionalProperties);
if (discriminator) {
gen.elseIf((0, codegen_1._) `${key} === ${discriminator}`);
const tag = gen.let("tag");
parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned
}
gen.else();
if (additionalProperties) {
parseEmpty({ ...cxt, data: (0, codegen_1._) `${data}[${key}]` });
}
else {
parsingError(cxt, (0, codegen_1.str) `property ${key} not allowed`);
}
gen.endIf();
});
if (properties) {
const hasProp = (0, code_1.hasPropFunc)(gen);
const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._) `${hasProp}.call(${data}, ${p})`));
gen.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str) `missing required properties`));
}
}
function parseDefinedProperty(cxt, key, schemas = {}) {
const { gen } = cxt;
for (const prop in schemas) {
gen.elseIf((0, codegen_1._) `${key} === ${prop}`);
parsePropertyValue(cxt, key, schemas[prop]);
}
}
function parsePropertyValue(cxt, key, schema) {
parseCode({ ...cxt, schema, data: (0, codegen_1._) `${cxt.data}[${key}]` });
}
function parseType(cxt) {
const { gen, schema, data, self } = cxt;
switch (schema.type) {
case "boolean":
parseBoolean(cxt);
break;
case "string":
parseString(cxt);
break;
case "timestamp": {
parseString(cxt);
const vts = (0, util_1.useFunc)(gen, timestamp_1.default);
const { allowDate, parseDate } = self.opts;
const notValid = allowDate ? (0, codegen_1._) `!${vts}(${data}, true)` : (0, codegen_1._) `!${vts}(${data})`;
const fail = parseDate
? (0, codegen_1.or)(notValid, (0, codegen_1._) `(${data} = new Date(${data}), false)`, (0, codegen_1._) `isNaN(${data}.valueOf())`)
: notValid;
gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`));
break;
}
case "float32":
case "float64":
parseNumber(cxt);
break;
default: {
const t = schema.type;
if (!self.opts.int32range && (t === "int32" || t === "uint32")) {
parseNumber(cxt, 16); // 2 ** 53 - max safe integer
if (t === "uint32") {
gen.if((0, codegen_1._) `${data} < 0`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`));
}
}
else {
const [min, max, maxDigits] = type_1.intRange[t];
parseNumber(cxt, maxDigits);
gen.if((0, codegen_1._) `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`));
}
}
}
}
function parseString(cxt) {
parseToken(cxt, '"');
parseWith(cxt, parseJson_1.parseJsonString);
}
function parseEnum(cxt) {
const { gen, data, schema } = cxt;
const enumSch = schema.enum;
parseToken(cxt, '"');
// TODO loopEnum
gen.if(false);
for (const value of enumSch) {
const valueStr = JSON.stringify(value).slice(1); // remove starting quote
gen.elseIf((0, codegen_1._) `${jsonSlice(valueStr.length)} === ${valueStr}`);
gen.assign(data, (0, codegen_1.str) `${value}`);
gen.add(names_1.default.jsonPos, valueStr.length);
}
gen.else();
jsonSyntaxError(cxt);
gen.endIf();
}
function parseNumber(cxt, maxDigits) {
const { gen } = cxt;
skipWhitespace(cxt);
gen.if((0, codegen_1._) `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits));
}
function parseBooleanToken(bool, fail) {
return (cxt) => {
const { gen, data } = cxt;
tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool));
};
}
function parseRef(cxt) {
const { gen, self, definitions, schema, schemaEnv } = cxt;
const { ref } = schema;
const refSchema = definitions[ref];
if (!refSchema)
throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`);
if (!(0, ref_1.hasRef)(refSchema))
return parseCode({ ...cxt, schema: refSchema });
const { root } = schemaEnv;
const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions);
partialParse(cxt, getParser(gen, sch), true);
}
function getParser(gen, sch) {
return sch.parse
? gen.scopeValue("parse", { ref: sch.parse })
: (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.parse`;
}
function parseEmpty(cxt) {
parseWith(cxt, parseJson_1.parseJson);
}
function parseWith(cxt, parseFunc, args) {
partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args);
}
function partialParse(cxt, parseFunc, args) {
const { gen, data } = cxt;
gen.assign(data, (0, codegen_1._) `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._) `, ${args}` : codegen_1.nil})`);
gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${parseFunc}.position`);
gen.if((0, codegen_1._) `${data} === undefined`, () => parsingError(cxt, (0, codegen_1._) `${parseFunc}.message`));
}
function parseToken(cxt, tok) {
tryParseToken(cxt, tok, jsonSyntaxError);
}
function tryParseToken(cxt, tok, fail, success) {
const { gen } = cxt;
const n = tok.length;
skipWhitespace(cxt);
gen.if((0, codegen_1._) `${jsonSlice(n)} === ${tok}`, () => {
gen.add(names_1.default.jsonPos, n);
success === null || success === void 0 ? void 0 : success(cxt);
}, () => fail(cxt));
}
function skipWhitespace({ gen, char: c }) {
gen.code((0, codegen_1._) `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`);
}
function jsonSlice(len) {
return len === 1
? (0, codegen_1._) `${names_1.default.json}[${names_1.default.jsonPos}]`
: (0, codegen_1._) `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`;
}
function jsonSyntaxError(cxt) {
parsingError(cxt, (0, codegen_1._) `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`);
}
function parsingError({ gen, parseName }, msg) {
gen.assign((0, codegen_1._) `${parseName}.message`, msg);
gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos);
gen.return(undef);
}
//# sourceMappingURL=parse.js.map
@@ -0,0 +1,324 @@
import Options from './Options'
import { PasswordChanges } from './matcher/dictionary/variants/matching/unmunger/getCleanPasswords'
import Matching from './Matching'
import { DictionaryReturn } from './matcher/dictionary/scoring'
import { REGEXEN } from './data/const'
import l33tTableDefault from './data/l33tTable'
import translationKeys from './data/translationKeys'
export type PluralizationFunction = (value: number) => string
export interface TranslationKeys {
warnings: {
[key in keyof typeof translationKeys.warnings]: string
}
suggestions: {
[key in keyof typeof translationKeys.suggestions]: string
}
timeEstimation: {
[key in keyof typeof translationKeys.timeEstimation]: key extends
| 'ltSecond'
| 'second'
| 'minute'
| 'hour'
| 'day'
| 'month'
| 'year'
| 'centuries'
? string
: string | PluralizationFunction
}
}
export type L33tTableDefault = typeof l33tTableDefault
export type LooseObject = Record<string, any>
export type Pattern =
| 'dictionary'
| 'spatial'
| 'repeat'
| 'sequence'
| 'wordSequence'
| 'regex'
| 'date'
| 'bruteforce'
| 'separator'
| string
export type DictionaryNames =
| 'passwords'
| 'commonWords'
| 'firstnames'
| 'lastnames'
| 'wikipedia'
| 'userInputs'
export interface Match {
/**
* @description The name of the matcher
*/
pattern: Pattern
/**
* @description The start index of the token found in the password
*/
i: number
/**
@description The end index of the token found in the password
*/
j: number
/**
* @description The token found in the password
*/
token: string
[key: string]: any
}
export interface DictionaryMatch extends Match {
pattern: 'dictionary'
matchedWord: string
rank: number
dictionaryName: DictionaryNames | string
reversed: boolean
l33t: boolean
}
export interface L33tMatch extends DictionaryMatch {
subs: PasswordChanges[]
subDisplay: string
}
export interface SpatialMatch extends Match {
pattern: 'spatial'
graph: string
turns: number
shiftedCount: number
}
export interface RepeatMatch extends Match {
pattern: 'repeat'
baseToken: string | string[]
baseGuesses: number
repeatCount: number
}
export interface SequenceMatch extends Match {
pattern: 'sequence'
sequenceName: string
sequenceSpace: number
ascending: boolean
}
export interface RegexMatch extends Match {
pattern: 'regex'
regexName: keyof typeof REGEXEN
regexMatch: string[]
}
export interface DateMatch extends Match {
pattern: 'date'
separator: string
year: number
month: number
day: number
}
export interface BruteForceMatch extends Match {
pattern: 'bruteforce'
}
export interface SeparatorMatch extends Match {
pattern: 'separator'
}
export interface WordSequenceMatch extends Match {
pattern: 'wordSequence'
words: string[]
wordCount: number
dictionaryName: string
ascending: boolean
}
export type MatchExtended =
| DictionaryMatch
| L33tMatch
| SpatialMatch
| RepeatMatch
| SequenceMatch
| WordSequenceMatch
| RegexMatch
| DateMatch
| BruteForceMatch
| SeparatorMatch
| Match
export interface Estimate {
guesses: number
guessesLog10: number
baseGuesses?: number
uppercaseVariations?: number
l33tVariations?: number
}
export type MatchEstimated = MatchExtended & Estimate
export interface Optimal {
bestMatches: Record<string, MatchEstimated>[]
guessesProduct: Record<string, number>[]
totalGuesses: Record<string, number>[]
}
export interface CrackTime {
base: number | null
seconds: number
display: string
}
export interface CrackTimes {
onlineThrottlingXPerHour: CrackTime
onlineNoThrottlingXPerSecond: CrackTime
offlineSlowHashingXPerSecond: CrackTime
offlineFastHashingXPerSecond: CrackTime
}
export interface CrackTimesSeconds {
onlineThrottlingXPerHour: number
onlineNoThrottlingXPerSecond: number
offlineSlowHashingXPerSecond: number
offlineFastHashingXPerSecond: number
}
export interface FeedbackType {
warning: string | null
suggestions: string[]
}
export type OptionsL33tTable = L33tTableDefault | Record<string, string[]>
export type OptionsDictionary = Record<string, (string | number)[]>
export type OptionsGraphEntry = Record<string, (string | null)[]>
export type OptionsGraph = Record<string, OptionsGraphEntry>
export interface TimeEstimationValues {
scoring: {
0: number
1: number
2: number
3: number
}
attackTime: {
onlineThrottlingXPerHour: number
onlineNoThrottlingXPerSecond: number
offlineSlowHashingXPerSecond: number
offlineFastHashingXPerSecond: number
}
}
export interface OptionsType {
/**
* @description Defines an object with a key value match to translate the feedback given by this library. The default values are plain keys so that you can use your own i18n library. Already implemented language can be found with something like @zxcvbn-ts/language-en.
*/
translations?: TranslationKeys
/**
* @description Defines keyboard layouts as an object which are used to find sequences. Already implemented layouts can be found in @zxcvbn-ts/language-common
*/
graphs?: OptionsGraph
/**
* @description Define an object with l33t substitutions. For example that an "a" can be exchanged with a "4" or a "@".
*/
l33tTable?: OptionsL33tTable
/**
* @description Define dictionary that should be used to check against. The matcher will search the dictionaries for similar password with l33t speak and reversed words. The recommended sets are found in @zxcvbn-ts/language-common and @zxcvbn-ts/language-en.
*/
dictionary?: OptionsDictionary
/**
* @description Defines if the levenshtein algorithm should be used. This will be only used on the complete password and not on parts of it. This will decrease the calcTime a bit but will significantly improve the password check. The recommended sets are found in @zxcvbn-ts/language-common and @zxcvbn-ts/language-en.
* @default false
*/
useLevenshteinDistance?: boolean
/**
* @description Defines how many characters can be different to match a dictionary word with the levenshtein algorithm.
* @default 2
*/
levenshteinThreshold?: number
/**
* @description The l33t matcher will check how many characters can be exchanged with the l33t table. If they are to many it will decrease the calcTime significantly. So we cap it at a reasonable value by default which will probably already seems like a strong password anyway.
* @default 100
*/
l33tMaxSubstitutions?: number
/**
* @description Defines how many character of the password are checked. A password longer than the default are considered strong anyway, but it can be increased as pleased. Be aware that this could open some attack vectors.
* @default 256
*/
maxLength?: number
/**
* @description Define the values to calculate the scoring and attack times. DO NOT CHANGE unless you know what you are doing. The default values are just fine as long as you are using a strong, slow hash function. Can be adjusted to account for increasingly powerful attacker hardware.
*/
timeEstimationValues?: TimeEstimationValues
}
export type RankedDictionary = Record<string, number>
export type RankedDictionaries = Record<string, RankedDictionary>
export type DefaultFeedbackFunction = (
options: Options,
match: MatchEstimated,
isSoleMatch?: boolean,
) => FeedbackType | null
export type DefaultScoringFunction = (
match: MatchExtended | MatchEstimated,
options: Options,
) => number | DictionaryReturn
export interface UserInputsOptions {
rankedDictionary: RankedDictionary
rankedDictionaryMaxWordSize: number
}
export interface MatchOptions {
password: string
/**
* @description This is the original Matcher so that one can use other matchers to define a baseGuess. An usage example is the repeat matcher
*/
omniMatch: Matching
userInputsOptions?: UserInputsOptions
}
export abstract class MatcherBaseClass {
constructor(protected options: Options) {}
abstract match(
matchOptions: MatchOptions,
): MatchExtended[] | Promise<MatchExtended[]>
}
export type MatcherConstructor<T extends MatcherBaseClass = MatcherBaseClass> =
new (options: Options) => T
export interface Matcher {
feedback: DefaultFeedbackFunction
scoring: DefaultScoringFunction
Matching: MatcherConstructor
}
export type Matchers = Record<string, Matcher>
export type Score = 0 | 1 | 2 | 3 | 4
export interface DictionaryScoringExtras {
baseGuesses: number
uppercaseVariations: number
l33tVariations: number
}
export interface ZxcvbnResult {
feedback: FeedbackType
crackTimes: CrackTimes
score: Score
password: string
guesses: number
guessesLog10: number
sequence: MatchExtended[]
calcTime: number
}
@@ -0,0 +1 @@
{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/not.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAIpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;QACR,CAAC;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CACX;YACE,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB,EACD,KAAK,CACN,CAAA;QAED,GAAG,CAAC,UAAU,CACZ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC;CACtC,CAAA;AAED,kBAAe,GAAG,CAAA"}
@@ -0,0 +1,480 @@
import * as core from "../core/index.js";
import type { $ZodBigIntFormats } from "../core/index.js";
import * as util from "../core/util.js";
type SomeType = core.SomeType;
export interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
type: Internals["def"]["type"];
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
with(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
clone(def?: Internals["def"], params?: {
parent: boolean;
}): this;
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T, Dir>;
def: Internals["def"];
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): util.SafeParseResult<core.output<this>>;
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<util.SafeParseResult<core.output<this>>>;
apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
}
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodMiniType<any, any, Internals> {
}
export declare const ZodMiniType: core.$constructor<ZodMiniType>;
export interface _ZodMiniString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodMiniType<T>, core.$ZodString<T["input"]> {
_zod: T;
}
export interface ZodMiniString<Input = unknown> extends _ZodMiniString<core.$ZodStringInternals<Input>>, core.$ZodString<Input> {
}
export declare const ZodMiniString: core.$constructor<ZodMiniString>;
export declare function string(params?: string | core.$ZodStringParams): ZodMiniString<string>;
export interface ZodMiniStringFormat<Format extends string = string> extends _ZodMiniString<core.$ZodStringFormatInternals<Format>>, core.$ZodStringFormat<Format> {
}
export declare const ZodMiniStringFormat: core.$constructor<ZodMiniStringFormat>;
export interface ZodMiniEmail extends _ZodMiniString<core.$ZodEmailInternals> {
}
export declare const ZodMiniEmail: core.$constructor<ZodMiniEmail>;
export declare function email(params?: string | core.$ZodEmailParams): ZodMiniEmail;
export interface ZodMiniGUID extends _ZodMiniString<core.$ZodGUIDInternals> {
}
export declare const ZodMiniGUID: core.$constructor<ZodMiniGUID>;
export declare function guid(params?: string | core.$ZodGUIDParams): ZodMiniGUID;
export interface ZodMiniUUID extends _ZodMiniString<core.$ZodUUIDInternals> {
}
export declare const ZodMiniUUID: core.$constructor<ZodMiniUUID>;
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodMiniUUID;
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodMiniUUID;
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodMiniUUID;
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodMiniUUID;
export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
}
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
export declare function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodMiniURL;
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
}
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodMiniEmoji;
export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals> {
}
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
/**
* @deprecated CUID v1 is deprecated by its authors due to information leakage
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
* See https://github.com/paralleldrive/cuid.
*/
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
}
/**
* @deprecated CUID v1 is deprecated by its authors due to information leakage
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
* See https://github.com/paralleldrive/cuid.
*/
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
/**
* Validates a CUID v1 string.
*
* @deprecated CUID v1 is deprecated by its authors due to information leakage
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
* See https://github.com/paralleldrive/cuid.
*/
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
}
export declare const ZodMiniCUID2: core.$constructor<ZodMiniCUID2>;
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodMiniCUID2;
export interface ZodMiniULID extends _ZodMiniString<core.$ZodULIDInternals> {
}
export declare const ZodMiniULID: core.$constructor<ZodMiniULID>;
export declare function ulid(params?: string | core.$ZodULIDParams): ZodMiniULID;
export interface ZodMiniXID extends _ZodMiniString<core.$ZodXIDInternals> {
}
export declare const ZodMiniXID: core.$constructor<ZodMiniXID>;
export declare function xid(params?: string | core.$ZodXIDParams): ZodMiniXID;
export interface ZodMiniKSUID extends _ZodMiniString<core.$ZodKSUIDInternals> {
}
export declare const ZodMiniKSUID: core.$constructor<ZodMiniKSUID>;
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodMiniKSUID;
export interface ZodMiniIPv4 extends _ZodMiniString<core.$ZodIPv4Internals> {
}
export declare const ZodMiniIPv4: core.$constructor<ZodMiniIPv4>;
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodMiniIPv4;
export interface ZodMiniIPv6 extends _ZodMiniString<core.$ZodIPv6Internals> {
}
export declare const ZodMiniIPv6: core.$constructor<ZodMiniIPv6>;
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodMiniIPv6;
export interface ZodMiniCIDRv4 extends _ZodMiniString<core.$ZodCIDRv4Internals> {
}
export declare const ZodMiniCIDRv4: core.$constructor<ZodMiniCIDRv4>;
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodMiniCIDRv4;
export interface ZodMiniCIDRv6 extends _ZodMiniString<core.$ZodCIDRv6Internals> {
}
export declare const ZodMiniCIDRv6: core.$constructor<ZodMiniCIDRv6>;
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodMiniCIDRv6;
export interface ZodMiniMAC extends _ZodMiniString<core.$ZodMACInternals> {
}
export declare const ZodMiniMAC: core.$constructor<ZodMiniMAC>;
export declare function mac(params?: string | core.$ZodMACParams): ZodMiniMAC;
export interface ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
}
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
export declare function base64(params?: string | core.$ZodBase64Params): ZodMiniBase64;
export interface ZodMiniBase64URL extends _ZodMiniString<core.$ZodBase64URLInternals> {
}
export declare const ZodMiniBase64URL: core.$constructor<ZodMiniBase64URL>;
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodMiniBase64URL;
export interface ZodMiniE164 extends _ZodMiniString<core.$ZodE164Internals> {
}
export declare const ZodMiniE164: core.$constructor<ZodMiniE164>;
export declare function e164(params?: string | core.$ZodE164Params): ZodMiniE164;
export interface ZodMiniCreditCard extends _ZodMiniString<core.$ZodCreditCardInternals> {
}
export declare const ZodMiniCreditCard: core.$constructor<ZodMiniCreditCard>;
export declare function creditCard(params?: string | core.$ZodCreditCardParams): ZodMiniCreditCard;
export interface ZodMiniIBAN extends _ZodMiniString<core.$ZodIBANInternals> {
}
export declare const ZodMiniIBAN: core.$constructor<ZodMiniIBAN>;
export declare function iban(params?: string | core.$ZodIBANParams): ZodMiniIBAN;
export interface ZodMiniJWT extends _ZodMiniString<core.$ZodJWTInternals> {
}
export declare const ZodMiniJWT: core.$constructor<ZodMiniJWT>;
export declare function jwt(params?: string | core.$ZodJWTParams): ZodMiniJWT;
export interface ZodMiniCustomStringFormat<Format extends string = string> extends ZodMiniStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
_zod: core.$ZodCustomStringFormatInternals<Format>;
}
export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hex">;
export declare function currencyCode(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"currency_code">;
export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
enc?: Enc;
} & core.$ZodStringFormatParams): ZodMiniCustomStringFormat<`${Alg}_${Enc}`>;
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
_zod: T;
}
export interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<core.$ZodNumberInternals<Input>>, core.$ZodNumber<Input> {
}
export declare const ZodMiniNumber: core.$constructor<ZodMiniNumber>;
export declare function number(params?: string | core.$ZodNumberParams): ZodMiniNumber<number>;
export interface ZodMiniNumberFormat<Format extends core.$ZodNumberFormats = core.$ZodNumberFormats> extends _ZodMiniNumber<core.$ZodNumberFormatInternals<Format>>, core.$ZodNumberFormat<Format> {
}
export declare const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat>;
export interface ZodMiniInt extends ZodMiniNumberFormat<"safeint"> {
}
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniInt;
export interface ZodMiniFloat32 extends ZodMiniNumberFormat<"float32"> {
}
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniFloat32;
export interface ZodMiniFloat64 extends ZodMiniNumberFormat<"float64"> {
}
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniFloat64;
export interface ZodMiniInt32 extends ZodMiniNumberFormat<"int32"> {
}
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniInt32;
export interface ZodMiniUInt32 extends ZodMiniNumberFormat<"uint32"> {
}
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniUInt32;
export interface ZodMiniBoolean<T = unknown> extends _ZodMiniType<core.$ZodBooleanInternals<T>> {
}
export declare const ZodMiniBoolean: core.$constructor<ZodMiniBoolean>;
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodMiniBoolean<boolean>;
export interface ZodMiniBigInt<T = unknown> extends _ZodMiniType<core.$ZodBigIntInternals<T>>, core.$ZodBigInt<T> {
}
export declare const ZodMiniBigInt: core.$constructor<ZodMiniBigInt>;
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<bigint>;
export interface ZodMiniBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends _ZodMiniType<core.$ZodBigIntFormatInternals<Format>> {
}
export declare const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat>;
export interface ZodMiniInt64 extends ZodMiniBigIntFormat<"int64"> {
}
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodMiniInt64;
export interface ZodMiniUInt64 extends ZodMiniBigIntFormat<"uint64"> {
}
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodMiniUInt64;
export interface ZodMiniSymbol extends _ZodMiniType<core.$ZodSymbolInternals> {
}
export declare const ZodMiniSymbol: core.$constructor<ZodMiniSymbol>;
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodMiniSymbol;
export interface ZodMiniUndefined extends _ZodMiniType<core.$ZodUndefinedInternals> {
}
export declare const ZodMiniUndefined: core.$constructor<ZodMiniUndefined>;
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodMiniUndefined;
export { _undefined as undefined };
export interface ZodMiniNull extends _ZodMiniType<core.$ZodNullInternals> {
}
export declare const ZodMiniNull: core.$constructor<ZodMiniNull>;
declare function _null(params?: string | core.$ZodNullParams): ZodMiniNull;
export { _null as null };
export interface ZodMiniAny extends _ZodMiniType<core.$ZodAnyInternals> {
}
export declare const ZodMiniAny: core.$constructor<ZodMiniAny>;
export declare function any(): ZodMiniAny;
export interface ZodMiniUnknown extends _ZodMiniType<core.$ZodUnknownInternals> {
}
export declare const ZodMiniUnknown: core.$constructor<ZodMiniUnknown>;
export declare function unknown(): ZodMiniUnknown;
export interface ZodMiniNever extends _ZodMiniType<core.$ZodNeverInternals> {
}
export declare const ZodMiniNever: core.$constructor<ZodMiniNever>;
export declare function never(params?: string | core.$ZodNeverParams): ZodMiniNever;
export interface ZodMiniVoid extends _ZodMiniType<core.$ZodVoidInternals> {
}
export declare const ZodMiniVoid: core.$constructor<ZodMiniVoid>;
declare function _void(params?: string | core.$ZodVoidParams): ZodMiniVoid;
export { _void as void };
export interface ZodMiniDate<T = unknown> extends _ZodMiniType<core.$ZodDateInternals<T>> {
}
export declare const ZodMiniDate: core.$constructor<ZodMiniDate>;
export declare function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date>;
export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
}
export declare const ZodMiniArray: core.$constructor<ZodMiniArray>;
export declare function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniEnum<util.KeysEnum<T["shape"]>>;
export interface ZodMiniObject<
/** @ts-ignore Cast variance */
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$strip> extends ZodMiniType<any, any, core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
shape: Shape;
}
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strip>;
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strict>;
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$loose>;
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
};
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
/**
* @deprecated Use [`z.extend(A, B.shape)`](https://zod.dev/api?id=extend) instead.
*/
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, U["_zod"]["config"]>;
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
export declare function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
}, T["_zod"]["config"]>;
export declare function partial<T extends util.TupleItems, Rest extends SomeType | null>(schema: ZodMiniTuple<T, Rest>): ZodMiniTuple<{
-readonly [k in keyof T]: ZodMiniOptional<T[k]>;
}, Rest>;
export declare function exactPartial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: ZodMiniExactOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function exactPartial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniExactOptional<T["shape"][k]> : T["shape"][k];
}, T["_zod"]["config"]>;
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
} & {
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
}>;
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Extend<T["shape"], {
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
}>, T["_zod"]["config"]>;
export declare function catchall<T extends ZodMiniObject, U extends SomeType>(inst: T, catchall: U): ZodMiniObject<T["shape"], core.$catchall<U>>;
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodUnionInternals<T>> {
}
export declare const ZodMiniUnion: core.$constructor<ZodMiniUnion>;
export declare function union<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodMiniUnion<T>;
export interface ZodMiniXor<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodXorInternals<T>> {
}
export declare const ZodMiniXor: core.$constructor<ZodMiniXor>;
/** Creates an exclusive union (XOR) where exactly one option must match.
* Unlike regular unions that succeed when any option matches, xor fails if
* zero or more than one option matches the input. */
export declare function xor<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodXorParams): ZodMiniXor<T>;
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[], Disc extends string = string> extends ZodMiniUnion<Options> {
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
}
export declare const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion>;
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types, Disc>;
export interface ZodMiniIntersection<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodIntersectionInternals<A, B>> {
}
export declare const ZodMiniIntersection: core.$constructor<ZodMiniIntersection>;
export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U>;
export interface ZodMiniTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends SomeType | null = core.$ZodType | null> extends _ZodMiniType<core.$ZodTupleInternals<T, Rest>> {
}
export declare const ZodMiniTuple: core.$constructor<ZodMiniTuple>;
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodRecordInternals<Key, Value>> {
}
export declare const ZodMiniRecord: core.$constructor<ZodMiniRecord>;
export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key & core.$partial, Value>;
export declare function looseRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
export interface ZodMiniMap<Key extends SomeType = core.$ZodType, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodMapInternals<Key, Value>> {
}
export declare const ZodMiniMap: core.$constructor<ZodMiniMap>;
export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMiniMap<Key, Value>;
export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSetInternals<T>> {
}
export declare const ZodMiniSet: core.$constructor<ZodMiniSet>;
export declare function set<Value extends SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodMiniSet<Value>;
export interface ZodMiniEnum<T extends util.EnumLike = util.EnumLike> extends _ZodMiniType<core.$ZodEnumInternals<T>> {
options: Array<T[keyof T]>;
}
export declare const ZodMiniEnum: core.$constructor<ZodMiniEnum>;
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<util.ToEnum<T[number]>>;
declare function _enum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
export { _enum as enum };
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
*
* ```ts
* enum Colors { red, green, blue }
* z.enum(Colors);
* ```
*/
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
export interface ZodMiniLiteral<T extends util.Literal = util.Literal> extends _ZodMiniType<core.$ZodLiteralInternals<T>> {
}
export declare const ZodMiniLiteral: core.$constructor<ZodMiniLiteral>;
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T[number]>;
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T>;
export interface ZodMiniFile extends _ZodMiniType<core.$ZodFileInternals> {
}
export declare const ZodMiniFile: core.$constructor<ZodMiniFile>;
export declare function file(params?: string | core.$ZodFileParams): ZodMiniFile;
export interface ZodMiniTransform<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodTransformInternals<O, I>> {
}
export declare const ZodMiniTransform: core.$constructor<ZodMiniTransform>;
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodMiniTransform<Awaited<O>, I>;
export interface ZodMiniOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
}
export declare const ZodMiniOptional: core.$constructor<ZodMiniOptional>;
export declare function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T>;
export interface ZodMiniExactOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodExactOptionalInternals<T>>, core.$ZodExactOptional<T> {
}
export declare const ZodMiniExactOptional: core.$constructor<ZodMiniExactOptional>;
export declare function exactOptional<T extends SomeType>(innerType: T): ZodMiniExactOptional<T>;
export interface ZodMiniNullable<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNullableInternals<T>> {
}
export declare const ZodMiniNullable: core.$constructor<ZodMiniNullable>;
export declare function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T>;
export declare function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>>;
export interface ZodMiniDefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodDefaultInternals<T>> {
}
export declare const ZodMiniDefault: core.$constructor<ZodMiniDefault>;
export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodMiniDefault<T>;
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPrefaultInternals<T>> {
}
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodMiniPrefault<T>;
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNonOptionalInternals<T>> {
}
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
export declare function nonoptional<T extends SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodMiniNonOptional<T>;
export interface ZodMiniSuccess<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSuccessInternals<T>> {
}
export declare const ZodMiniSuccess: core.$constructor<ZodMiniSuccess>;
export declare function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T>;
export interface ZodMiniCatch<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodCatchInternals<T>> {
}
export declare const ZodMiniCatch: core.$constructor<ZodMiniCatch>;
declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodMiniCatch<T>;
export { _catch as catch };
export interface ZodMiniNaN extends _ZodMiniType<core.$ZodNaNInternals> {
}
export declare const ZodMiniNaN: core.$constructor<ZodMiniNaN>;
export declare function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN;
export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPipeInternals<A, B>> {
}
export declare const ZodMiniPipe: core.$constructor<ZodMiniPipe>;
export declare function pipe<const A extends SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodMiniPipe<A, B>;
export interface ZodMiniCodec<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends ZodMiniPipe<A, B>, core.$ZodCodec<A, B> {
_zod: core.$ZodCodecInternals<A, B>;
def: core.$ZodCodecDef<A, B>;
}
export declare const ZodMiniCodec: core.$constructor<ZodMiniCodec>;
export declare function codec<const A extends SomeType, B extends core.SomeType = core.$ZodType>(in_: A, out: B, params: {
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
}): ZodMiniCodec<A, B>;
export declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A>;
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
}
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
export declare function readonly<T extends SomeType>(innerType: T): ZodMiniReadonly<T>;
export interface ZodMiniTemplateLiteral<Template extends string = string> extends _ZodMiniType<core.$ZodTemplateLiteralInternals<Template>> {
}
export declare const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral>;
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodMiniTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
export interface ZodMiniLazy<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodLazyInternals<T>> {
}
export declare const ZodMiniLazy: core.$constructor<ZodMiniLazy>;
declare function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T>;
export { _lazy as lazy };
export interface ZodMiniPromise<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPromiseInternals<T>> {
}
export declare const ZodMiniPromise: core.$constructor<ZodMiniPromise>;
export declare function promise<T extends SomeType>(innerType: T): ZodMiniPromise<T>;
export interface ZodMiniCustom<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodCustomInternals<O, I>> {
}
export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
export declare const describe: typeof core.describe;
export declare const meta: typeof core.meta;
declare abstract class Class {
constructor(..._args: any[]);
}
declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
export { _instanceof as instanceof };
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean>;
export type _ZodMiniJSONSchema = ZodMiniUnion<[
ZodMiniString,
ZodMiniNumber,
ZodMiniBoolean,
ZodMiniNull,
ZodMiniArray<ZodMiniJSONSchema>,
ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
]>;
export type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
output: util.JSONType;
input: util.JSONType;
}
export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
_zod: ZodMiniJSONSchemaInternals;
}
export declare function json(): ZodMiniJSONSchema;
export interface ZodMiniFunction<Args extends core.$ZodFunctionIn = core.$ZodFunctionIn, Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut> extends _ZodMiniType<core.$ZodFunctionInternals<Args, Returns>>, core.$ZodFunction<Args, Returns> {
_def: core.$ZodFunctionDef<Args, Returns>;
_input: core.$InferInnerFunctionType<Args, Returns>;
_output: core.$InferOuterFunctionType<Args, Returns>;
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): ZodMiniFunction<ZodMiniTuple<Items, Rest>, Returns>;
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodMiniFunction<NewArgs, Returns>;
input(...args: any[]): ZodMiniFunction<any, Returns>;
output<NewReturns extends core.$ZodFunctionOut>(output: NewReturns): ZodMiniFunction<Args, NewReturns>;
}
export declare const ZodMiniFunction: core.$constructor<ZodMiniFunction>;
export declare function _function(): ZodMiniFunction;
export declare function _function<const In extends Array<SomeType> = Array<SomeType>>(params: {
input: In;
}): ZodMiniFunction<ZodMiniTuple<In, null>, core.$ZodFunctionOut>;
export declare function _function<const In extends Array<SomeType> = Array<SomeType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
input: In;
output: Out;
}): ZodMiniFunction<ZodMiniTuple<In, null>, Out>;
export declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
input: In;
}): ZodMiniFunction<In, core.$ZodFunctionOut>;
export declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
output: Out;
}): ZodMiniFunction<core.$ZodFunctionIn, Out>;
export declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params?: {
input: In;
output: Out;
}): ZodMiniFunction<In, Out>;
export { _function as function };
@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.range = exports.balanced = void 0;
const balanced = (a, b, str) => {
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
return (r && {
start: r[0],
end: r[1],
pre: str.slice(0, r[0]),
body: str.slice(r[0] + ma.length, r[1]),
post: str.slice(r[1] + mb.length),
});
};
exports.balanced = balanced;
const maybeMatch = (reg, str) => {
const m = str.match(reg);
return m ? m[0] : null;
};
const range = (a, b, str) => {
let begs, beg, left, right = undefined, result;
let ai = str.indexOf(a);
let bi = str.indexOf(b, ai + 1);
let i = ai;
if (ai >= 0 && bi > 0) {
if (a === b) {
return [ai, bi];
}
begs = [];
left = str.length;
while (i >= 0 && !result) {
if (i === ai) {
begs.push(i);
ai = str.indexOf(a, i + 1);
}
else if (begs.length === 1) {
const r = begs.pop();
if (r !== undefined)
result = [r, bi];
}
else {
beg = begs.pop();
if (beg !== undefined && beg < left) {
left = beg;
right = bi;
}
bi = str.indexOf(b, i + 1);
}
i = ai < bi && ai >= 0 ? ai : bi;
}
if (begs.length && right !== undefined) {
result = [left, right];
}
}
return result;
};
exports.range = range;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,143 @@
/*!
* media-typer
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* RegExp to match type in RFC 6838
*
* type-name = restricted-name
* subtype-name = restricted-name
* restricted-name = restricted-name-first *126restricted-name-chars
* restricted-name-first = ALPHA / DIGIT
* restricted-name-chars = ALPHA / DIGIT / "!" / "#" /
* "$" / "&" / "-" / "^" / "_"
* restricted-name-chars =/ "." ; Characters before first dot always
* ; specify a facet name
* restricted-name-chars =/ "+" ; Characters after last plus always
* ; specify a structured syntax suffix
* ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
* DIGIT = %x30-39 ; 0-9
*/
var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/
var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/
var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/
/**
* Module exports.
*/
exports.format = format
exports.parse = parse
exports.test = test
/**
* Format object to media type.
*
* @param {object} obj
* @return {string}
* @public
*/
function format (obj) {
if (!obj || typeof obj !== 'object') {
throw new TypeError('argument obj is required')
}
var subtype = obj.subtype
var suffix = obj.suffix
var type = obj.type
if (!type || !TYPE_NAME_REGEXP.test(type)) {
throw new TypeError('invalid type')
}
if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) {
throw new TypeError('invalid subtype')
}
// format as type/subtype
var string = type + '/' + subtype
// append +suffix
if (suffix) {
if (!TYPE_NAME_REGEXP.test(suffix)) {
throw new TypeError('invalid suffix')
}
string += '+' + suffix
}
return string
}
/**
* Test media type.
*
* @param {string} string
* @return {object}
* @public
*/
function test (string) {
if (!string) {
throw new TypeError('argument string is required')
}
if (typeof string !== 'string') {
throw new TypeError('argument string is required to be a string')
}
return TYPE_REGEXP.test(string.toLowerCase())
}
/**
* Parse media type to object.
*
* @param {string} string
* @return {object}
* @public
*/
function parse (string) {
if (!string) {
throw new TypeError('argument string is required')
}
if (typeof string !== 'string') {
throw new TypeError('argument string is required to be a string')
}
var match = TYPE_REGEXP.exec(string.toLowerCase())
if (!match) {
throw new TypeError('invalid media type')
}
var type = match[1]
var subtype = match[2]
var suffix
// suffix after last +
var index = subtype.lastIndexOf('+')
if (index !== -1) {
suffix = subtype.substr(index + 1)
subtype = subtype.substr(0, index)
}
return new MediaType(type, subtype, suffix)
}
/**
* Class for MediaType object.
* @public
*/
function MediaType (type, subtype, suffix) {
this.type = type
this.subtype = subtype
this.suffix = suffix
}
@@ -0,0 +1 @@
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../web/event.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,WAAW,KA2Cf,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,235 @@
import type { InferFileRouteTypes } from './fileRoute'
import type { AddTrailingSlash, RemoveTrailingSlashes } from './link'
import type { AnyRoute } from './route'
import type { AnyRouter, TrailingSlashOption } from './router'
import type { PartialMergeAll } from './utils'
export type ParseRoute<TRouteTree, TAcc = TRouteTree> = TRouteTree extends {
types: { children: infer TChildren }
}
? unknown extends TChildren
? TAcc
: TChildren extends ReadonlyArray<any>
? ParseRoute<TChildren[number], TAcc | TChildren[number]>
: ParseRoute<
TChildren[keyof TChildren],
TAcc | TChildren[keyof TChildren]
>
: TAcc
export type ParseRouteWithoutBranches<TRouteTree> =
ParseRoute<TRouteTree> extends infer TRoute extends AnyRoute
? TRoute extends any
? unknown extends TRoute['types']['children']
? TRoute
: TRoute['types']['children'] extends ReadonlyArray<any>
? '/' extends TRoute['types']['children'][number]['path']
? never
: TRoute
: '/' extends TRoute['types']['children'][keyof TRoute['types']['children']]['path']
? never
: TRoute
: never
: never
export type CodeRoutesById<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? {
[K in TRoutes as K['id']]: K
}
: never
export type RoutesById<TRouteTree extends AnyRoute> =
InferFileRouteTypes<TRouteTree> extends never
? CodeRoutesById<TRouteTree>
: InferFileRouteTypes<TRouteTree>['fileRoutesById']
export type RouteById<TRouteTree extends AnyRoute, TId> = Extract<
RoutesById<TRouteTree>[TId & keyof RoutesById<TRouteTree>],
AnyRoute
>
export type CodeRouteIds<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? TRoutes['id']
: never
export type RouteIds<TRouteTree extends AnyRoute> =
InferFileRouteTypes<TRouteTree> extends never
? CodeRouteIds<TRouteTree>
: InferFileRouteTypes<TRouteTree>['id']
export type ParentPath<TRouter extends AnyRouter> =
TrailingSlashOptionByRouter<TRouter> extends 'always'
? '../'
: TrailingSlashOptionByRouter<TRouter> extends 'never'
? '..'
: '../' | '..'
export type CurrentPath<TRouter extends AnyRouter> =
TrailingSlashOptionByRouter<TRouter> extends 'always'
? './'
: TrailingSlashOptionByRouter<TRouter> extends 'never'
? '.'
: './' | '.'
export type ToPath<TRouter extends AnyRouter, TTo extends string> =
TrailingSlashOptionByRouter<TRouter> extends 'always'
? AddTrailingSlash<TTo>
: TrailingSlashOptionByRouter<TRouter> extends 'never'
? RemoveTrailingSlashes<TTo>
: AddTrailingSlash<TTo> | RemoveTrailingSlashes<TTo>
export type CatchAllPaths<TRouter extends AnyRouter> =
| CurrentPath<TRouter>
| ParentPath<TRouter>
export type CodeRoutesByPath<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? {
[K in TRoutes as K['fullPath']]: K
}
: never
export type RoutesByPath<TRouteTree extends AnyRoute> =
InferFileRouteTypes<TRouteTree> extends never
? CodeRoutesByPath<TRouteTree>
: InferFileRouteTypes<TRouteTree>['fileRoutesByFullPath']
export type RouteByPath<TRouteTree extends AnyRoute, TPath> = Extract<
RoutesByPath<TRouteTree>[TPath & keyof RoutesByPath<TRouteTree>],
AnyRoute
>
export type CodeRoutePaths<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? TRoutes['fullPath']
: never
export type RoutePaths<TRouteTree extends AnyRoute> = unknown extends TRouteTree
? string
:
| (InferFileRouteTypes<TRouteTree> extends never
? CodeRoutePaths<TRouteTree>
: InferFileRouteTypes<TRouteTree>['fullPaths'])
| '/'
export type RouteToPathAlwaysTrailingSlash<TRoute extends AnyRoute> =
TRoute['path'] extends '/'
? TRoute['fullPath']
: TRoute['fullPath'] extends '/'
? TRoute['fullPath']
: `${TRoute['fullPath']}/`
export type RouteToPathNeverTrailingSlash<TRoute extends AnyRoute> =
TRoute['path'] extends '/'
? TRoute['fullPath'] extends '/'
? TRoute['fullPath']
: RemoveTrailingSlashes<TRoute['fullPath']>
: TRoute['fullPath']
export type RouteToPathPreserveTrailingSlash<TRoute extends AnyRoute> =
| RouteToPathNeverTrailingSlash<TRoute>
| RouteToPathAlwaysTrailingSlash<TRoute>
export type RouteToPathByTrailingSlashOption<TRoute extends AnyRoute> = {
always: RouteToPathAlwaysTrailingSlash<TRoute>
preserve: RouteToPathPreserveTrailingSlash<TRoute>
never: RouteToPathNeverTrailingSlash<TRoute>
}
export type TrailingSlashOptionByRouter<TRouter extends AnyRouter> =
TrailingSlashOption extends TRouter['options']['trailingSlash']
? 'never'
: NonNullable<TRouter['options']['trailingSlash']>
export type RouteToByRouter<
TRouter extends AnyRouter,
TRoute extends AnyRoute,
> = RouteToPathByTrailingSlashOption<TRoute>[TrailingSlashOptionByRouter<TRouter>]
export type CodeRouteToPath<TRouter extends AnyRouter> =
ParseRouteWithoutBranches<TRouter['routeTree']> extends infer TRoute extends
AnyRoute
? TRoute extends any
? RouteToByRouter<TRouter, TRoute>
: never
: never
export type FileRouteToPath<
TRouter extends AnyRouter,
TTo = InferFileRouteTypes<TRouter['routeTree']>['to'],
TTrailingSlashOption = TrailingSlashOptionByRouter<TRouter>,
> = 'never' extends TTrailingSlashOption
? TTo
: 'always' extends TTrailingSlashOption
? AddTrailingSlash<TTo>
: TTo | AddTrailingSlash<TTo>
export type RouteToPath<TRouter extends AnyRouter> = unknown extends TRouter
? string
: InferFileRouteTypes<TRouter['routeTree']> extends never
? CodeRouteToPath<TRouter>
: FileRouteToPath<TRouter>
export type CodeRoutesByToPath<TRouter extends AnyRouter> =
ParseRouteWithoutBranches<TRouter['routeTree']> extends infer TRoutes extends
AnyRoute
? {
[TRoute in TRoutes as RouteToByRouter<TRouter, TRoute>]: TRoute
}
: never
export type RoutesByToPath<TRouter extends AnyRouter> =
InferFileRouteTypes<TRouter['routeTree']> extends never
? CodeRoutesByToPath<TRouter>
: InferFileRouteTypes<TRouter['routeTree']>['fileRoutesByTo']
export type CodeRouteByToPath<TRouter extends AnyRouter, TTo> = Extract<
RoutesByToPath<TRouter>[TTo & keyof RoutesByToPath<TRouter>],
AnyRoute
>
export type FileRouteByToPath<TRouter extends AnyRouter, TTo> =
'never' extends TrailingSlashOptionByRouter<TRouter>
? CodeRouteByToPath<TRouter, TTo>
: 'always' extends TrailingSlashOptionByRouter<TRouter>
? TTo extends '/'
? CodeRouteByToPath<TRouter, TTo>
: TTo extends `${infer TPath}/`
? CodeRouteByToPath<TRouter, TPath>
: never
: CodeRouteByToPath<
TRouter,
TTo extends '/' ? TTo : RemoveTrailingSlashes<TTo>
>
export type RouteByToPath<TRouter extends AnyRouter, TTo> =
InferFileRouteTypes<TRouter['routeTree']> extends never
? CodeRouteByToPath<TRouter, TTo>
: FileRouteByToPath<TRouter, TTo>
export type FullSearchSchema<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? PartialMergeAll<TRoutes['types']['fullSearchSchema']>
: never
export type FullSearchSchemaInput<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? PartialMergeAll<TRoutes['types']['fullSearchSchemaInput']>
: never
export type AllParams<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? PartialMergeAll<TRoutes['types']['allParams']>
: never
export type AllContext<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? PartialMergeAll<TRoutes['types']['allContext']>
: never
export type AllLoaderData<TRouteTree extends AnyRoute> =
ParseRoute<TRouteTree> extends infer TRoutes extends AnyRoute
? PartialMergeAll<TRoutes['types']['loaderData']>
: never
@@ -0,0 +1,24 @@
/**
* This file is automatically generated from the Model Context Protocol specification.
*
* Source: https://github.com/modelcontextprotocol/modelcontextprotocol
* Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts
* Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669
*
* DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates.
* To update this file, run: npm run fetch:spec-types
*/ /* JSON-RPC types */
/** @internal */
export const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1";
/** @internal */
export const JSONRPC_VERSION = "2.0";
// Standard JSON-RPC error codes
export const PARSE_ERROR = -32700;
export const INVALID_REQUEST = -32600;
export const METHOD_NOT_FOUND = -32601;
export const INVALID_PARAMS = -32602;
export const INTERNAL_ERROR = -32603;
// Implementation-specific JSON-RPC error codes [-32000, -32099]
/** @internal */
export const URL_ELICITATION_REQUIRED = -32042;
//# sourceMappingURL=spec.types.js.map
@@ -0,0 +1,78 @@
/**
* @fileoverview Rule to disallow a duplicate case label.
* @author Dieter Oberkofler
* @author Burak Yigit Kaya
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow duplicate case labels",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-duplicate-case",
},
schema: [],
messages: {
unexpected: "Duplicate case label.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Determines whether the two given nodes are considered to be equal.
* @param {ASTNode} a First node.
* @param {ASTNode} b Second node.
* @returns {boolean} `true` if the nodes are considered to be equal.
*/
function equal(a, b) {
if (a.type !== b.type) {
return false;
}
return astUtils.equalTokens(a, b, sourceCode);
}
return {
SwitchStatement(node) {
const previousTests = [];
for (const switchCase of node.cases) {
if (switchCase.test) {
const test = switchCase.test;
if (
previousTests.some(previousTest =>
equal(previousTest, test),
)
) {
context.report({
node: switchCase,
messageId: "unexpected",
});
} else {
previousTests.push(test);
}
}
}
},
};
},
};