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":"decode.js","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAExE,IAAW,SAaV;AAbD,WAAW,SAAS;IAChB,wCAAQ,CAAA;IACR,0CAAS,CAAA;IACT,8CAAW,CAAA;IACX,0CAAS,CAAA;IACT,0CAAS,CAAA;IACT,gDAAY,CAAA;IACZ,iDAAa,CAAA;IACb,iDAAa,CAAA;IACb,iDAAa,CAAA;IACb,gDAAY,CAAA;IACZ,gDAAY,CAAA;IACZ,gDAAY,CAAA;AAChB,CAAC,EAbU,SAAS,KAAT,SAAS,QAanB;AAED,sFAAsF;AACtF,MAAM,YAAY,GAAG,EAAS,CAAC;AAE/B,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,mEAAoC,CAAA;IACpC,qEAAqC,CAAA;IACrC,6DAAkC,CAAA;AACtC,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,IAAI,SAAS,CAAC,IAAI,IAAI,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC;AAC5D,CAAC;AAED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AC;gBACjB,MAAM,IAAILine truncated
@@ -0,0 +1,8 @@
import { Props } from "../base.js";
//#region src/jsx/intrinsic-element/common.d.ts
export declare const deDupeKeyMap: Record<string, string[]>;
export declare const domRenderers: Record<string, Function>;
export declare const dataPrecedenceAttr = "data-precedence";
export declare const isStylesheetLinkWithPrecedence: (props: Props) => boolean;
export declare const shouldDeDupeByKey: (tagName: string, supportSort: boolean) => boolean;
//#endregion
@@ -0,0 +1,171 @@
/**
* @fileoverview Rule to flag use of implied eval via setTimeout and setInterval
* @author James Allardice
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { getStaticValue } = require("@eslint-community/eslint-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow the use of `eval()`-like methods",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-implied-eval",
},
schema: [],
messages: {
impliedEval:
"Implied eval. Consider passing a function instead of a string.",
execScript: "Implied eval. Do not use execScript().",
},
},
create(context) {
const GLOBAL_CANDIDATES = Object.freeze([
"global",
"window",
"globalThis",
"self",
]);
const EVAL_LIKE_FUNC_PATTERN =
/^(?:set(?:Interval|Timeout)|execScript)$/u;
const sourceCode = context.sourceCode;
/**
* Checks whether a node is evaluated as a string or not.
* @param {ASTNode} node A node to check.
* @returns {boolean} True if the node is evaluated as a string.
*/
function isEvaluatedString(node) {
if (
(node.type === "Literal" && typeof node.value === "string") ||
node.type === "TemplateLiteral"
) {
return true;
}
if (node.type === "BinaryExpression" && node.operator === "+") {
return (
isEvaluatedString(node.left) ||
isEvaluatedString(node.right)
);
}
return false;
}
/**
* Reports if the `CallExpression` node has evaluated argument.
* @param {ASTNode} node A CallExpression to check.
* @returns {void}
*/
function reportImpliedEvalCallExpression(node) {
const [firstArgument] = node.arguments;
if (firstArgument) {
const staticValue = getStaticValue(
firstArgument,
sourceCode.getScope(node),
);
const isStaticString =
staticValue && typeof staticValue.value === "string";
const isString =
isStaticString || isEvaluatedString(firstArgument);
if (isString) {
const calleeName =
node.callee.type === "Identifier"
? node.callee.name
: astUtils.getStaticPropertyName(node.callee);
const isExecScript = calleeName === "execScript";
context.report({
node,
messageId: isExecScript ? "execScript" : "impliedEval",
});
}
}
}
/**
* Reports calls of `implied eval` via the global references.
* @param {Variable} globalVar A global variable to check.
* @returns {void}
*/
function reportImpliedEvalViaGlobal(globalVar) {
const { references, name } = globalVar;
references.forEach(ref => {
const identifier = ref.identifier;
let node = identifier.parent;
while (astUtils.isSpecificMemberAccess(node, null, name)) {
node = node.parent;
}
if (
astUtils.isSpecificMemberAccess(
node,
null,
EVAL_LIKE_FUNC_PATTERN,
)
) {
const calleeNode =
node.parent.type === "ChainExpression"
? node.parent
: node;
const parent = calleeNode.parent;
if (
parent.type === "CallExpression" &&
parent.callee === calleeNode
) {
reportImpliedEvalCallExpression(parent);
}
}
});
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
CallExpression(node) {
if (
astUtils.isSpecificId(
node.callee,
EVAL_LIKE_FUNC_PATTERN,
) &&
sourceCode.isGlobalReference(node.callee)
) {
reportImpliedEvalCallExpression(node);
}
},
"Program:exit"(node) {
const globalScope = sourceCode.getScope(node);
GLOBAL_CANDIDATES.map(candidate =>
astUtils.getVariableByName(globalScope, candidate),
)
.filter(
globalVar => !!globalVar && globalVar.defs.length === 0,
)
.forEach(reportImpliedEvalViaGlobal);
},
};
},
};
@@ -0,0 +1,172 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SSEServerTransport = void 0;
const node_crypto_1 = require("node:crypto");
const node_tls_1 = require("node:tls");
const types_js_1 = require("../types.js");
const raw_body_1 = __importDefault(require("raw-body"));
const content_type_1 = __importDefault(require("content-type"));
const node_url_1 = require("node:url");
const MAXIMUM_MESSAGE_SIZE = '4mb';
/**
* Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests.
*
* This transport is only available in Node.js environments.
* @deprecated SSEServerTransport is deprecated. Use StreamableHTTPServerTransport instead.
*/
class SSEServerTransport {
/**
* Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`.
*/
constructor(_endpoint, res, options) {
this._endpoint = _endpoint;
this.res = res;
this._sessionId = (0, node_crypto_1.randomUUID)();
this._options = options || { enableDnsRebindingProtection: false };
}
/**
* Validates request headers for DNS rebinding protection.
* @returns Error message if validation fails, undefined if validation passes.
*/
validateRequestHeaders(req) {
// Skip validation if protection is not enabled
if (!this._options.enableDnsRebindingProtection) {
return undefined;
}
// Validate Host header if allowedHosts is configured
if (this._options.allowedHosts && this._options.allowedHosts.length > 0) {
const hostHeader = req.headers.host;
if (!hostHeader || !this._options.allowedHosts.includes(hostHeader)) {
return `Invalid Host header: ${hostHeader}`;
}
}
// Validate Origin header if allowedOrigins is configured
if (this._options.allowedOrigins && this._options.allowedOrigins.length > 0) {
const originHeader = req.headers.origin;
if (originHeader && !this._options.allowedOrigins.includes(originHeader)) {
return `Invalid Origin header: ${originHeader}`;
}
}
return undefined;
}
/**
* Handles the initial SSE connection request.
*
* This should be called when a GET request is made to establish the SSE stream.
*/
async start() {
if (this._sseResponse) {
throw new Error('SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.');
}
this.res.writeHead(200, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache, no-transform',
Connection: 'keep-alive'
});
// Send the endpoint event
// Use a dummy base URL because this._endpoint is relative.
// This allows using URL/URLSearchParams for robust parameter handling.
const dummyBase = 'http://localhost'; // Any valid base works
const endpointUrl = new node_url_1.URL(this._endpoint, dummyBase);
endpointUrl.searchParams.set('sessionId', this._sessionId);
// Reconstruct the relative URL string (pathname + search + hash)
const relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash;
this.res.write(`event: endpoint\ndata: ${relativeUrlWithSession}\n\n`);
this._sseResponse = this.res;
this.res.on('close', () => {
this._sseResponse = undefined;
this.onclose?.();
});
}
/**
* Handles incoming POST messages.
*
* This should be called when a POST request is made to send a message to the server.
*/
async handlePostMessage(req, res, parsedBody) {
if (!this._sseResponse) {
const message = 'SSE connection not established';
res.writeHead(500).end(message);
throw new Error(message);
}
// Validate request headers for DNS rebinding protection
const validationError = this.validateRequestHeaders(req);
if (validationError) {
res.writeHead(403).end(validationError);
this.onerror?.(new Error(validationError));
return;
}
const authInfo = req.auth;
const host = req.headers.host;
const protocol = req.socket instanceof node_tls_1.TLSSocket ? 'https' : 'http';
const fullUrl = host && req.url ? new node_url_1.URL(req.url, `${protocol}://${host}`) : undefined;
const requestInfo = {
headers: req.headers,
url: fullUrl
};
let body;
try {
const ct = content_type_1.default.parse(req.headers['content-type'] ?? '');
if (ct.type !== 'application/json') {
throw new Error(`Unsupported content-type: ${ct.type}`);
}
body =
parsedBody ??
(await (0, raw_body_1.default)(req, {
limit: MAXIMUM_MESSAGE_SIZE,
encoding: ct.parameters.charset ?? 'utf-8'
}));
}
catch (error) {
res.writeHead(400).end(String(error));
this.onerror?.(error);
return;
}
try {
await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body, { requestInfo, authInfo });
}
catch {
res.writeHead(400).end(`Invalid message: ${body}`);
return;
}
res.writeHead(202).end('Accepted');
}
/**
* Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST.
*/
async handleMessage(message, extra) {
let parsedMessage;
try {
parsedMessage = types_js_1.JSONRPCMessageSchema.parse(message);
}
catch (error) {
this.onerror?.(error);
throw error;
}
this.onmessage?.(parsedMessage, extra);
}
async close() {
this._sseResponse?.end();
this._sseResponse = undefined;
this.onclose?.();
}
async send(message) {
if (!this._sseResponse) {
throw new Error('Not connected');
}
this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`);
}
/**
* Returns the session ID for this transport.
*
* This can be used to route incoming POST requests.
*/
get sessionId() {
return this._sessionId;
}
}
exports.SSEServerTransport = SSEServerTransport;
//# sourceMappingURL=sse.js.map
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const def = {
keyword: ["then", "else"],
schemaType: ["object", "boolean"],
code({ keyword, parentSchema, it }) {
if (parentSchema.if === undefined)
(0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
},
};
exports.default = def;
//# sourceMappingURL=thenElse.js.map
@@ -0,0 +1,80 @@
import * as React from 'react'
import { isNotFound } from '@tanstack/router-core'
import { isServer } from '@tanstack/router-core/isServer'
import { useStore } from '@tanstack/react-store'
import { CatchBoundary } from './CatchBoundary'
import { useRouter } from './useRouter'
import type { ErrorInfo } from 'react'
import type { NotFoundError } from '@tanstack/router-core'
export function CatchNotFound(props: {
fallback?: (error: NotFoundError) => React.ReactElement
onCatch?: (error: Error, errorInfo: ErrorInfo) => void
children: React.ReactNode
}) {
const router = useRouter()
if (isServer ?? router.isServer) {
const pathname = router.stores.location.get().pathname
const status = router.stores.status.get()
const resetKey = `not-found-${pathname}-${status}`
return (
<CatchBoundary
getResetKey={() => resetKey}
onCatch={(error, errorInfo) => {
if (isNotFound(error)) {
props.onCatch?.(error, errorInfo)
} else {
throw error
}
}}
errorComponent={({ error }) => {
if (isNotFound(error)) {
return props.fallback?.(error)
} else {
throw error
}
}}
>
{props.children}
</CatchBoundary>
)
}
// TODO: Some way for the user to programmatically reset the not-found boundary?
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
const pathname = useStore(
router.stores.location,
(location) => location.pathname,
)
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
const status = useStore(router.stores.status, (status) => status)
const resetKey = `not-found-${pathname}-${status}`
return (
<CatchBoundary
getResetKey={() => resetKey}
onCatch={(error, errorInfo) => {
if (isNotFound(error)) {
props.onCatch?.(error, errorInfo)
} else {
throw error
}
}}
errorComponent={({ error }) => {
if (isNotFound(error)) {
return props.fallback?.(error)
} else {
throw error
}
}}
>
{props.children}
</CatchBoundary>
)
}
export function DefaultGlobalNotFound() {
return <p>Not Found</p>
}
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseNativeEnumDef = void 0;
function parseNativeEnumDef(def) {
const object = def.values;
const actualKeys = Object.keys(def.values).filter((key) => {
return typeof object[object[key]] !== "number";
});
const actualValues = actualKeys.map((key) => object[key]);
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
return {
type: parsedTypes.length === 1
? parsedTypes[0] === "string"
? "string"
: "number"
: ["string", "number"],
enum: actualValues,
};
}
exports.parseNativeEnumDef = parseNativeEnumDef;
@@ -0,0 +1,24 @@
/**
* @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 Car = createLucideIcon("Car", [
[
"path",
{
d: "M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",
key: "5owen"
}
],
["circle", { cx: "7", cy: "17", r: "2", key: "u2ysq9" }],
["path", { d: "M9 17h6", key: "r8uit2" }],
["circle", { cx: "17", cy: "17", r: "2", key: "axvx0g" }]
]);
export { Car as default };
//# sourceMappingURL=car.js.map
@@ -0,0 +1,69 @@
# Installation
> `npm install --save @types/debug`
# Summary
This package contains type definitions for debug (https://github.com/debug-js/debug).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug/index.d.ts)
````ts
declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
export = debug;
export as namespace debug;
declare namespace debug {
interface Debug {
(namespace: string): Debugger;
coerce: (val: any) => any;
disable: () => string;
enable: (namespaces: string) => void;
enabled: (namespaces: string) => boolean;
formatArgs: (this: Debugger, args: any[]) => void;
log: (...args: any[]) => any;
selectColor: (namespace: string) => string | number;
humanize: typeof import("ms");
names: string[];
skips: string[];
formatters: Formatters;
inspectOpts?: {
hideDate?: boolean | number | null;
colors?: boolean | number | null;
depth?: boolean | number | null;
showHidden?: boolean | number | null;
};
}
type IDebug = Debug;
interface Formatters {
[formatter: string]: (v: any) => string;
}
type IDebugger = Debugger;
interface Debugger {
(formatter: any, ...args: any[]): void;
color: string;
diff: number;
enabled: boolean;
log: (...args: any[]) => any;
namespace: string;
destroy: () => boolean;
extend: (namespace: string, delimiter?: string) => Debugger;
}
}
````
### Additional Details
* Last updated: Thu, 19 Mar 2026 06:47:22 GMT
* Dependencies: [@types/ms](https://npmjs.com/package/@types/ms)
# Credits
These definitions were written by [Seon-Wook Park](https://github.com/swook), [Gal Talmor](https://github.com/galtalmor), [John McLaughlin](https://github.com/zamb3zi), [Brasten Sager](https://github.com/brasten), [Nicolas Penin](https://github.com/npenin), [Kristian Brünn](https://github.com/kristianmitk), and [Caleb Gregory](https://github.com/calebgregory).
@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2022_object = void 0;
const base_config_1 = require("./base-config");
exports.es2022_object = {
libs: [],
variables: [['ObjectConstructor', base_config_1.TYPE]],
};
@@ -0,0 +1,98 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DescriptionFileUtils = require("./DescriptionFileUtils");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class DescriptionFilePlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string[]} filenames filenames
* @param {boolean} pathIsFile pathIsFile
* @param {string | ResolveStepHook} target target
*/
constructor(source, filenames, pathIsFile, target) {
this.source = source;
this.filenames = filenames;
this.pathIsFile = pathIsFile;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync(
"DescriptionFilePlugin",
(request, resolveContext, callback) => {
const { path } = request;
if (!path) return callback();
const directory = this.pathIsFile
? DescriptionFileUtils.cdUp(path)
: path;
if (!directory) return callback();
DescriptionFileUtils.loadDescriptionFile(
resolver,
directory,
this.filenames,
request.descriptionFilePath
? {
path: request.descriptionFilePath,
content: request.descriptionFileData,
directory:
/** @type {string} */
(request.descriptionFileRoot),
}
: undefined,
resolveContext,
(err, result) => {
if (err) return callback(err);
if (!result) {
if (resolveContext.log) {
resolveContext.log(
`No description file found in ${directory} or above`,
);
}
return callback();
}
const relativePath = `.${path
.slice(result.directory.length)
.replace(/\\/g, "/")}`;
/** @type {ResolveRequest} */
const obj = {
...request,
descriptionFilePath: result.path,
descriptionFileData: result.content,
descriptionFileRoot: result.directory,
relativePath,
};
resolver.doResolve(
target,
obj,
`using description file: ${result.path} (relative path: ${relativePath})`,
resolveContext,
(err, result) => {
if (err) return callback(err);
// Don't allow other processing
if (result === undefined) return callback(null, null);
callback(null, result);
},
);
},
);
},
);
}
};
@@ -0,0 +1,85 @@
{
"name": "side-channel",
"version": "1.1.1",
"description": "Store information about any JS value in a side channel. Uses WeakMap if available.",
"main": "index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p . && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx npm@'>=10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/side-channel.git"
},
"keywords": [
"weakmap",
"map",
"side",
"channel",
"metadata"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/side-channel/issues"
},
"homepage": "https://github.com/ljharb/side-channel#readme",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.4",
"side-channel-list": "^1.0.1",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.3",
"@ljharb/eslint-config": "^22.2.3",
"@ljharb/tsconfig": "^0.3.2",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.8.1",
"auto-changelog": "^2.6.0",
"eclint": "^2.8.1",
"encoding": "^0.1.13",
"eslint": "^8.57.1",
"in-publish": "^2.0.1",
"npmignore": "^0.3.5",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,3 @@
import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_zF","2":"_OC"},D:{"1":"_NK","2":"_KC"},E:{"1":"_YB","2":"_k","132":"mB"},F:{"1":"_a","2":"_T"},G:{"1":"_t","2":"_d"},H:{"2":"1D"},I:{"1":"_8B","2":"_n"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"async attribute for external scripts",D:true};
@@ -0,0 +1,15 @@
export declare class AddressError extends Error {
/**
* The offending address with the portion that failed to parse wrapped in
* `<span class="parse-error">`, e.g. `2001:db8<span
* class="parse-error">:::</span>1`. Present only on errors thrown from a
* parse path that can point at a specific substring.
*
* This is an HTML fragment intended for an address-inspector UI. The
* address content is HTML-escaped, so it is safe to insert as-is; treat it
* as markup rather than as a plain-text message, and use `message` for
* anything that renders as text.
*/
parseMessage?: string;
constructor(message: string, parseMessage?: string);
}
@@ -0,0 +1,66 @@
declare const colorsMap: {
readonly reset: readonly [0, 0];
readonly bold: readonly [1, 22, "\u001B[22m\u001B[1m"];
readonly dim: readonly [2, 22, "\u001B[22m\u001B[2m"];
readonly italic: readonly [3, 23];
readonly underline: readonly [4, 24];
readonly inverse: readonly [7, 27];
readonly hidden: readonly [8, 28];
readonly strikethrough: readonly [9, 29];
readonly black: readonly [30, 39];
readonly red: readonly [31, 39];
readonly green: readonly [32, 39];
readonly yellow: readonly [33, 39];
readonly blue: readonly [34, 39];
readonly magenta: readonly [35, 39];
readonly cyan: readonly [36, 39];
readonly white: readonly [37, 39];
readonly gray: readonly [90, 39];
readonly bgBlack: readonly [40, 49];
readonly bgRed: readonly [41, 49];
readonly bgGreen: readonly [42, 49];
readonly bgYellow: readonly [43, 49];
readonly bgBlue: readonly [44, 49];
readonly bgMagenta: readonly [45, 49];
readonly bgCyan: readonly [46, 49];
readonly bgWhite: readonly [47, 49];
readonly blackBright: readonly [90, 39];
readonly redBright: readonly [91, 39];
readonly greenBright: readonly [92, 39];
readonly yellowBright: readonly [93, 39];
readonly blueBright: readonly [94, 39];
readonly magentaBright: readonly [95, 39];
readonly cyanBright: readonly [96, 39];
readonly whiteBright: readonly [97, 39];
readonly bgBlackBright: readonly [100, 49];
readonly bgRedBright: readonly [101, 49];
readonly bgGreenBright: readonly [102, 49];
readonly bgYellowBright: readonly [103, 49];
readonly bgBlueBright: readonly [104, 49];
readonly bgMagentaBright: readonly [105, 49];
readonly bgCyanBright: readonly [106, 49];
readonly bgWhiteBright: readonly [107, 49];
};
interface Formatter {
(input?: unknown): string;
open: string;
close: string;
}
type ColorName = keyof typeof colorsMap;
type ColorsMethods = {
[Key in ColorName]: Formatter;
};
type Colors = ColorsMethods & {
isColorSupported: boolean;
reset: (input: unknown) => string;
};
declare function getDefaultColors(): Colors;
declare function isSupported(): boolean;
declare function createColors({ force }?: {
force?: boolean;
}): Colors;
declare const colors: Colors;
declare function disableDefaultColors(): void;
declare function enabledDefaultColors(): void;
export { Colors, Formatter, createColors, colors as default, disableDefaultColors, enabledDefaultColors, getDefaultColors, isSupported };
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("./core");
const validation_1 = require("./validation");
const applicator_1 = require("./applicator");
const dynamic_1 = require("./dynamic");
const next_1 = require("./next");
const unevaluated_1 = require("./unevaluated");
const format_1 = require("./format");
const metadata_1 = require("./metadata");
const draft2020Vocabularies = [
dynamic_1.default,
core_1.default,
validation_1.default,
(0, applicator_1.default)(true),
format_1.default,
metadata_1.metadataVocabulary,
metadata_1.contentVocabulary,
next_1.default,
unevaluated_1.default,
];
exports.default = draft2020Vocabularies;
//# sourceMappingURL=draft2020.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_5B","132":"_IE"},C:{"1":"_6L","2":"_zJ"},D:{"1":"_LQ _DC","2":"_kF","132":"_eM gC"},E:{"1":"_pB","2":"_RB","132":"mC"},F:{"1":"_KN _RD","2":"_XI","132":"_kN"},G:{"1":"_AB","2":"_iB","132":"lD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_yB","2":"_3B","132":"AE"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","132":"LE"}},B:5,C:"CSS justify-content: space-evenly",D:true};
@@ -0,0 +1,69 @@
{
"name": "uqr",
"type": "module",
"version": "0.1.3",
"description": "Generate QR Code universally, in any runtime, to ANSI, Unicode or SVG.",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
"homepage": "https://github.com/unjs/uqr#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/unjs/uqr.git"
},
"bugs": "https://github.com/unjs/uqr/issues",
"keywords": [],
"sideEffects": false,
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
]
}
},
"files": [
"dist"
],
"devDependencies": {
"@antfu/eslint-config": "^8.0.0",
"@antfu/ni": "^30.0.0",
"@antfu/utils": "^9.3.0",
"@types/node": "^25.5.0",
"bumpp": "^11.0.1",
"eslint": "^10.1.0",
"lint-staged": "^16.4.0",
"pnpm": "^10.33.0",
"rimraf": "^6.1.3",
"rollup": "^4.60.1",
"simple-git-hooks": "^2.13.1",
"tsx": "^4.21.0",
"typescript": "^6.0.2",
"unbuild": "^3.6.1",
"vite": "^8.0.3",
"vitest": "^4.1.2"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
},
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint .",
"release": "bumpp && npm publish",
"play": "tsx play/run.ts",
"test": "vitest",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1,102 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_url = require("../../utils/url.js");
const require_router = require("../../router.js");
const require_router_utils = require("../utils.js");
const require_router_reg_exp_router_matcher = require("./matcher.js");
const require_router_reg_exp_router_node = require("./node.js");
const require_router_reg_exp_router_trie = require("./trie.js");
//#region src/router/reg-exp-router/router.ts
let wildcardRegExpCache = require_router_utils.createNullObject();
function buildWildcardRegExp(path) {
return wildcardRegExpCache[path] ??= new RegExp(`^${path.replace(/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g, (match, metaChar) => metaChar ? `\\${metaChar}` : match === "/*" ? require_router_reg_exp_router_node.TAIL_WILDCARD_REG_EXP_STR : match === "*" ? ".*" : `/:${require_router_reg_exp_router_node.LABEL_REG_EXP_STR}`)}$`);
}
function findMiddleware(middleware, path) {
for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path)) return [...middleware[k]];
}
var RegExpRouter = class {
name = "RegExpRouter";
#middleware;
#routes;
#tries;
constructor() {
this.#middleware = { ["ALL"]: require_router_utils.createNullObject() };
this.#routes = { ["ALL"]: require_router_utils.createNullObject() };
this.#tries = { ["ALL"]: new require_router_reg_exp_router_trie.Trie() };
}
#insertPath(method, path) {
try {
this.#tries[method].insert(path, !/\*|\/:/.test(path));
} catch (e) {
throw e === require_router_reg_exp_router_node.PATH_ERROR ? new require_router.UnsupportedPathError(path) : e;
}
}
add(method, path, handler) {
const middleware = this.#middleware;
const routes = this.#routes;
if (!middleware) throw new Error(require_router.MESSAGE_MATCHER_IS_ALREADY_BUILT);
if (!middleware[method]) {
this.#tries[method] = new require_router_reg_exp_router_trie.Trie();
for (const handlerMap of [middleware, routes]) {
handlerMap[method] = require_router_utils.createNullObject();
for (const p in handlerMap["ALL"]) {
handlerMap[method][p] = [...handlerMap["ALL"][p]];
this.#insertPath(method, p);
}
}
}
if (path === "/*") path = "*";
const methods = method === "ALL" ? Object.keys(middleware) : [method];
if (/\*$/.test(path)) {
const re = buildWildcardRegExp(path);
for (const m of methods) if (!middleware[m][path]) {
this.#insertPath(m, path);
middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware["ALL"], path) || [];
}
for (const handlerMap of [middleware, routes]) for (const m of methods) for (const p in handlerMap[m]) re.test(p) && handlerMap[m][p].push([handler, path]);
return;
}
const paths = require_utils_url.checkOptionalParameter(path) || [path];
for (const path of paths) for (const m of methods) {
if (!routes[m][path]) {
this.#insertPath(m, path);
routes[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware["ALL"], path) || [];
}
routes[m][path].push([handler, path]);
}
}
match = require_router_reg_exp_router_matcher.match;
buildAllMatchers() {
const matchers = require_router_utils.createNullObject();
for (const method of Object.keys(this.#routes)) matchers[method] = this.#buildMatcher(method);
this.#middleware = this.#routes = this.#tries = void 0;
wildcardRegExpCache = require_router_utils.createNullObject();
return matchers;
}
#buildMatcher(method) {
const middleware = this.#middleware[method];
const routes = this.#routes[method];
const trie = this.#tries[method];
const staticMap = require_router_utils.createNullObject();
const handlerData = [];
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
for (const r of [middleware, routes]) for (const path in r) {
const handlers = r[path];
const pathData = trie.paths[path];
if (!pathData) {
staticMap[path] = [handlers.map(([h]) => [h, require_router_utils.createNullObject()]), require_router_reg_exp_router_matcher.emptyParam];
continue;
}
handlerData[pathData[0]] = handlers.map(([h, handlerPath]) => [h, trie.paths[handlerPath][1].reduceRight((map, [key], i) => {
map[key] = paramReplacementMap[pathData[1][i][1]];
return map;
}, require_router_utils.createNullObject())]);
}
return [
regexp,
indexReplacementMap.map((i) => handlerData[i]),
staticMap
];
}
};
//#endregion
exports.RegExpRouter = RegExpRouter;
@@ -0,0 +1,17 @@
/**
* @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 PanelsRightBottom = createLucideIcon("PanelsRightBottom", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M3 15h12", key: "1wkqb3" }],
["path", { d: "M15 3v18", key: "14nvp0" }]
]);
export { PanelsRightBottom as default };
//# sourceMappingURL=panels-right-bottom.js.map
@@ -0,0 +1,21 @@
import { StructuralSharingOption, ValidateSelected } from './structuralSharing.cjs';
import { AnyRouter, RegisteredRouter, ResolveUseSearch, StrictOrFrom, ThrowConstraint, ThrowOrOptional, UseSearchResult } from '@tanstack/router-core';
export interface UseSearchBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing> {
select?: (state: ResolveUseSearch<TRouter, TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
shouldThrow?: TThrow;
}
export type UseSearchOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing> = StrictOrFrom<TRouter, TFrom, TStrict> & UseSearchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>;
export type UseSearchRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseSearchBaseOptions<TRouter, TFrom, true, true, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => UseSearchResult<TRouter, TFrom, true, TSelected>;
/**
* Read and select the current route's search parameters with type-safety.
*
* Options:
* - `from`/`strict`: Control which route's search is read and how strictly it's typed
* - `select`: Map the search object to a derived value for render optimization
* - `structuralSharing`: Enable structural sharing for stable references
* - `shouldThrow`: Throw when the route is not found (strict contexts)
*
* @returns The search object (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook
*/
export declare function useSearch<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, TStrict extends boolean = true, TThrow extends boolean = true, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts: UseSearchOptions<TRouter, TFrom, TStrict, ThrowConstraint<TStrict, TThrow>, TSelected, TStructuralSharing>): ThrowOrOptional<UseSearchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>;
@@ -0,0 +1 @@
{"version":3,"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call"],"sources":["../../src/helpers/initializerDefineProperty.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ninterface DescriptorWithInitializer extends PropertyDescriptor {\n initializer?: () => any;\n}\n\nexport default function _initializerDefineProperty<T>(\n target: T,\n property: PropertyKey,\n descriptor: DescriptorWithInitializer | undefined,\n context: DecoratorContext,\n): void {\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer\n ? descriptor.initializer.call(context)\n : void 0,\n });\n}\n"],"mappings":";;;;;;AAMe,SAASA,0BAA0BA,CAChDC,MAAS,EACTC,QAAqB,EACrBC,UAAiD,EACjDC,OAAyB,EACnB;EACN,IAAI,CAACD,UAAU,EAAE;EAEjBE,MAAM,CAACC,cAAc,CAACL,MAAM,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;IAC7BC,KAAK,EAAEP,UAAU,CAACQ,WAAW,GACzBR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GACpC,KAAK;EACX,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,19 @@
# @babel/helper-compilation-targets
> Helper functions on Babel compilation targets
See our website [@babel/helper-compilation-targets](https://babeljs.io/docs/babel-helper-compilation-targets) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-compilation-targets
```
or using yarn:
```sh
yarn add @babel/helper-compilation-targets
```
@@ -0,0 +1,69 @@
/*
@license
Rollup.js v4.60.4
Thu, 14 May 2026 17:52:21 GMT - commit d311a84b0bb4d4a6f50d19ffd2c29cca28660c88
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const getLogFilter = filters => {
if (filters.length === 0)
return () => true;
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
const inverted = subFilter[0] === '!';
if (inverted)
subFilter = subFilter.slice(1);
const [key, ...value] = subFilter.split(':');
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
}));
return (log) => {
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
for (const { inverted, key, parts } of intersectedFilters) {
const isFilterSatisfied = testFilter(log, key, parts);
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
continue nextIntersectedFilter;
}
}
return true;
}
return false;
};
};
const testFilter = (log, key, parts) => {
let rawValue = log;
for (let index = 0; index < key.length; index++) {
if (!rawValue) {
return false;
}
const part = key[index];
if (!(part in rawValue)) {
return false;
}
rawValue = rawValue[part];
}
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
if (parts.length === 1) {
return value === parts[0];
}
if (!value.startsWith(parts[0])) {
return false;
}
const lastPartIndex = parts.length - 1;
for (let index = 1; index < lastPartIndex; index++) {
const part = parts[index];
const position = value.indexOf(part);
if (position === -1) {
return false;
}
value = value.slice(position + part.length);
}
return value.endsWith(parts[lastPartIndex]);
};
exports.getLogFilter = getLogFilter;
//# sourceMappingURL=getLogFilter.js.map
@@ -0,0 +1 @@
{"version":3,"file":"book-open.js","sources":["../../../src/icons/book-open.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookOpen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgN3YxNCIgLz4KICA8cGF0aCBkPSJNMyAxOGExIDEgMCAwIDEtMS0xVjRhMSAxIDAgMCAxIDEtMWg1YTQgNCAwIDAgMSA0IDQgNCA0IDAgMCAxIDQtNGg1YTEgMSAwIDAgMSAxIDF2MTNhMSAxIDAgMCAxLTEgMWgtNmEzIDMgMCAwIDAtMyAzIDMgMyAwIDAgMC0zLTN6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/book-open\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 BookOpen = createLucideIcon('BookOpen', [\n ['path', { d: 'M12 7v14', key: '1akyts' }],\n [\n 'path',\n {\n d: 'M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z',\n key: 'ruj8y',\n },\n ],\n]);\n\nexport default BookOpen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CA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,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,5 @@
import type { ZodErrorMap } from "./ZodError.cjs";
import defaultErrorMap from "./locales/en.cjs";
export { defaultErrorMap };
export declare function setErrorMap(map: ZodErrorMap): void;
export declare function getErrorMap(): ZodErrorMap;
@@ -0,0 +1,15 @@
/**
* @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 FishSymbol = createLucideIcon("FishSymbol", [
["path", { d: "M2 16s9-15 20-4C11 23 2 8 2 8", key: "h4oh4o" }]
]);
export { FishSymbol as default };
//# sourceMappingURL=fish-symbol.js.map
@@ -0,0 +1,21 @@
/**
* @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 Wine = createLucideIcon("Wine", [
["path", { d: "M8 22h8", key: "rmew8v" }],
["path", { d: "M7 10h10", key: "1101jm" }],
["path", { d: "M12 15v7", key: "t2xh3l" }],
[
"path",
{ d: "M12 15a5 5 0 0 0 5-5c0-2-.5-4-2-8H9c-1.5 4-2 6-2 8a5 5 0 0 0 5 5Z", key: "10ffi3" }
]
]);
export { Wine as default };
//# sourceMappingURL=wine.js.map
@@ -0,0 +1,118 @@
{
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "6.0.2",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
"TypeScript",
"Microsoft",
"compiler",
"language",
"javascript"
],
"bugs": {
"url": "https://github.com/microsoft/TypeScript/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/TypeScript.git"
},
"main": "./lib/typescript.js",
"typings": "./lib/typescript.d.ts",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
},
"engines": {
"node": ">=14.17"
},
"files": [
"bin",
"lib",
"!lib/enu",
"LICENSE.txt",
"README.md",
"SECURITY.md",
"ThirdPartyNoticeText.txt",
"!**/.gitattributes"
],
"devDependencies": {
"@dprint/formatter": "^0.4.1",
"@dprint/typescript": "0.93.4",
"@esfx/canceltoken": "^1.0.0",
"@eslint/js": "^10.0.1",
"@octokit/rest": "^22.0.1",
"@types/chai": "^4.3.20",
"@types/minimist": "^1.2.5",
"@types/mocha": "^10.0.10",
"@types/ms": "^2.1.0",
"@types/node": "latest",
"@types/source-map-support": "^0.5.10",
"@types/which": "^3.0.4",
"@typescript-eslint/rule-tester": "^8.56.1",
"@typescript-eslint/type-utils": "^8.56.1",
"@typescript-eslint/utils": "^8.56.1",
"azure-devops-node-api": "^15.1.3",
"c8": "^10.1.3",
"chai": "^4.5.0",
"chokidar": "^4.0.3",
"diff": "^8.0.3",
"dprint": "^0.49.1",
"esbuild": "^0.27.3",
"eslint": "^10.0.2",
"eslint-plugin-regexp": "^3.0.0",
"fast-xml-parser": "^5.4.1",
"glob": "^10.5.0",
"globals": "^17.4.0",
"hereby": "^1.12.0",
"jsonc-parser": "^3.3.1",
"knip": "^5.85.0",
"minimist": "^1.2.8",
"mocha": "^10.8.2",
"mocha-fivemat-progress-reporter": "^0.1.0",
"monocart-coverage-reports": "^2.12.9",
"ms": "^2.1.3",
"picocolors": "^1.1.1",
"playwright": "^1.58.2",
"source-map-support": "^0.5.21",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.1",
"which": "^3.0.1"
},
"overrides": {
"typescript@*": "$typescript"
},
"scripts": {
"test": "hereby runtests-parallel --light=false",
"test:eslint-rules": "hereby run-eslint-rules-tests",
"build": "npm run build:compiler && npm run build:tests",
"build:compiler": "hereby local",
"build:tests": "hereby tests",
"build:tests:notypecheck": "hereby tests --no-typecheck",
"clean": "hereby clean",
"gulp": "hereby",
"lint": "hereby lint",
"knip": "hereby knip",
"format": "dprint fmt",
"setup-hooks": "node scripts/link-hooks.mjs"
},
"browser": {
"fs": false,
"os": false,
"path": false,
"crypto": false,
"buffer": false,
"source-map-support": false,
"inspector": false,
"perf_hooks": false
},
"packageManager": "npm@8.19.4",
"volta": {
"node": "22.22.0",
"npm": "8.19.4"
},
"gitHead": "607a22a90d1a5a1b507ce01bb8cd7ec020f954e7"
}
@@ -0,0 +1,16 @@
/**
* @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 Columns2 = createLucideIcon("Columns2", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M12 3v18", key: "108xh3" }]
]);
export { Columns2 as default };
//# sourceMappingURL=columns-2.js.map
@@ -0,0 +1,65 @@
const bufLength = 1024 * 16;
// Provide a fallback for older environments.
const td =
typeof TextDecoder !== 'undefined'
? /* #__PURE__ */ new TextDecoder()
: typeof Buffer !== 'undefined'
? {
decode(buf: Uint8Array): string {
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
return out.toString();
},
}
: {
decode(buf: Uint8Array): string {
let out = '';
for (let i = 0; i < buf.length; i++) {
out += String.fromCharCode(buf[i]);
}
return out;
},
};
export class StringWriter {
pos = 0;
private out = '';
private buffer = new Uint8Array(bufLength);
write(v: number): void {
const { buffer } = this;
buffer[this.pos++] = v;
if (this.pos === bufLength) {
this.out += td.decode(buffer);
this.pos = 0;
}
}
flush(): string {
const { buffer, out, pos } = this;
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
}
}
export class StringReader {
pos = 0;
declare private buffer: string;
constructor(buffer: string) {
this.buffer = buffer;
}
next(): number {
return this.buffer.charCodeAt(this.pos++);
}
peek(): number {
return this.buffer.charCodeAt(this.pos);
}
indexOf(char: string): number {
const { buffer, pos } = this;
const idx = buffer.indexOf(char, pos);
return idx === -1 ? buffer.length : idx;
}
}
@@ -0,0 +1,16 @@
/**
* @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 TrendingDown = createLucideIcon("TrendingDown", [
["polyline", { points: "22 17 13.5 8.5 8.5 13.5 2 7", key: "1r2t7k" }],
["polyline", { points: "16 17 22 17 22 11", key: "11uiuu" }]
]);
export { TrendingDown as default };
//# sourceMappingURL=trending-down.js.map
@@ -0,0 +1,12 @@
'use strict';
module.exports = function dataProperties(klass, properties) {
properties.forEach(p => {
Object.defineProperty(klass.prototype, p, {
enumerable: true,
get() {
return this.data[p];
}
});
});
};
@@ -0,0 +1,82 @@
class GroupAnimation {
constructor(animations) {
// Bound to accomadate common `return animation.stop` pattern
this.stop = () => this.runAll("stop");
this.animations = animations.filter(Boolean);
}
get finished() {
return Promise.all(this.animations.map((animation) => animation.finished));
}
/**
* TODO: Filter out cancelled or stopped animations before returning
*/
getAll(propName) {
return this.animations[0][propName];
}
setAll(propName, newValue) {
for (let i = 0; i < this.animations.length; i++) {
this.animations[i][propName] = newValue;
}
}
attachTimeline(timeline) {
const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));
return () => {
subscriptions.forEach((cancel, i) => {
cancel && cancel();
this.animations[i].stop();
});
};
}
get time() {
return this.getAll("time");
}
set time(time) {
this.setAll("time", time);
}
get speed() {
return this.getAll("speed");
}
set speed(speed) {
this.setAll("speed", speed);
}
get state() {
return this.getAll("state");
}
get startTime() {
return this.getAll("startTime");
}
get duration() {
return getMax(this.animations, "duration");
}
get iterationDuration() {
return getMax(this.animations, "iterationDuration");
}
runAll(methodName) {
this.animations.forEach((controls) => controls[methodName]());
}
play() {
this.runAll("play");
}
pause() {
this.runAll("pause");
}
cancel() {
this.runAll("cancel");
}
complete() {
this.runAll("complete");
}
}
function getMax(animations, propName) {
let max = 0;
for (let i = 0; i < animations.length; i++) {
const value = animations[i][propName];
if (value !== null && value > max) {
max = value;
}
}
return max;
}
export { GroupAnimation };
//# sourceMappingURL=GroupAnimation.mjs.map
@@ -0,0 +1,383 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_request = require("./request.js");
const require_utils_html = require("./utils/html.js");
//#region src/context.ts
const TEXT_PLAIN = "text/plain; charset=UTF-8";
const setDefaultContentType = (contentType, headers) => {
return {
"Content-Type": contentType,
...headers
};
};
const createResponseInstance = (body, init) => new Response(body, init);
var Context = class {
#rawRequest;
#req;
/**
* `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.
*
* @see {@link https://hono.dev/docs/api/context#env}
*
* @example
* ```ts
* // Environment object for Cloudflare Workers
* app.get('*', async c => {
* const counter = c.env.COUNTER
* })
* ```
*/
env = {};
#var;
finalized = false;
/**
* `.error` can get the error object from the middleware if the Handler throws an error.
*
* @see {@link https://hono.dev/docs/api/context#error}
*
* @example
* ```ts
* app.use('*', async (c, next) => {
* await next()
* if (c.error) {
* // do something...
* }
* })
* ```
*/
error;
#status;
#executionCtx;
#res;
#layout;
#renderer;
#notFoundHandler;
#preparedHeaders;
#matchResult;
#path;
/**
* Creates an instance of the Context class.
*
* @param req - The Request object.
* @param options - Optional configuration options for the context.
*/
constructor(req, options) {
this.#rawRequest = req;
if (options) {
this.#executionCtx = options.executionCtx;
this.env = options.env;
this.#notFoundHandler = options.notFoundHandler;
this.#path = options.path;
this.#matchResult = options.matchResult;
}
}
/**
* `.req` is the instance of {@link HonoRequest}.
*/
get req() {
this.#req ??= new require_request.HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
return this.#req;
}
/**
* @see {@link https://hono.dev/docs/api/context#event}
* The FetchEvent associated with the current request.
*
* @throws Will throw an error if the context does not have a FetchEvent.
*/
get event() {
if (this.#executionCtx && "respondWith" in this.#executionCtx) return this.#executionCtx;
else throw Error("This context has no FetchEvent");
}
/**
* @see {@link https://hono.dev/docs/api/context#executionctx}
* The ExecutionContext associated with the current request.
*
* @throws Will throw an error if the context does not have an ExecutionContext.
*/
get executionCtx() {
if (this.#executionCtx) return this.#executionCtx;
else throw Error("This context has no ExecutionContext");
}
/**
* @see {@link https://hono.dev/docs/api/context#res}
* The Response object for the current request.
*/
get res() {
return this.#res ||= createResponseInstance(null, { headers: this.#preparedHeaders ??= new Headers() });
}
/**
* Sets the Response object for the current request.
*
* @param _res - The Response object to set.
*/
set res(_res) {
if (this.#res && _res) {
_res = createResponseInstance(_res.body, _res);
for (const [k, v] of this.#res.headers.entries()) {
if (k === "content-type") continue;
if (k === "set-cookie") {
const cookies = this.#res.headers.getSetCookie();
_res.headers.delete("set-cookie");
for (const cookie of cookies) _res.headers.append("set-cookie", cookie);
} else _res.headers.set(k, v);
}
}
this.#res = _res;
this.finalized = true;
}
/**
* `.render()` can create a response within a layout.
*
* @see {@link https://hono.dev/docs/api/context#render-setrenderer}
*
* @example
* ```ts
* app.get('/', (c) => {
* return c.render('Hello!')
* })
* ```
*/
render = (...args) => {
this.#renderer ??= (content) => this.html(content);
return this.#renderer(...args);
};
/**
* Sets the layout for the response.
*
* @param layout - The layout to set.
* @returns The layout function.
*/
setLayout = (layout) => this.#layout = layout;
/**
* Gets the current layout for the response.
*
* @returns The current layout function.
*/
getLayout = () => this.#layout;
/**
* `.setRenderer()` can set the layout in the custom middleware.
*
* @see {@link https://hono.dev/docs/api/context#render-setrenderer}
*
* @example
* ```tsx
* app.use('*', async (c, next) => {
* c.setRenderer((content) => {
* return c.html(
* <html>
* <body>
* <p>{content}</p>
* </body>
* </html>
* )
* })
* await next()
* })
* ```
*/
setRenderer = (renderer) => {
this.#renderer = renderer;
};
/**
* `.header()` can set headers.
*
* @see {@link https://hono.dev/docs/api/context#header}
*
* @example
* ```ts
* app.get('/welcome', (c) => {
* // Set headers
* c.header('X-Message', 'Hello!')
* c.header('Content-Type', 'text/plain')
*
* // Append multiple headers using the append option (e.g. Vary)
* c.header('Vary', 'Accept-Encoding', { append: true })
* c.header('Vary', 'User-Agent', { append: true })
*
* return c.body('Thank you for coming')
* })
* ```
*/
header = (name, value, options) => {
if (this.finalized) this.#res = createResponseInstance(this.#res.body, this.#res);
const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
if (value === void 0) headers.delete(name);
else if (options?.append) headers.append(name, value);
else headers.set(name, value);
};
status = (status) => {
this.#status = status;
};
/**
* `.set()` can set the value specified by the key.
*
* @see {@link https://hono.dev/docs/api/context#set-get}
*
* @example
* ```ts
* app.use('*', async (c, next) => {
* c.set('message', 'Hono is hot!!')
* await next()
* })
* ```
*/
set = (key, value) => {
this.#var ??= /* @__PURE__ */ new Map();
this.#var.set(key, value);
};
/**
* `.get()` can use the value specified by the key.
*
* @see {@link https://hono.dev/docs/api/context#set-get}
*
* @example
* ```ts
* app.get('/', (c) => {
* const message = c.get('message')
* return c.text(`The message is "${message}"`)
* })
* ```
*/
get = (key) => {
return this.#var ? this.#var.get(key) : void 0;
};
/**
* `.var` can access the value of a variable.
*
* @see {@link https://hono.dev/docs/api/context#var}
*
* @example
* ```ts
* const result = c.var.client.oneMethod()
* ```
*/
get var() {
if (!this.#var) return {};
return Object.fromEntries(this.#var);
}
#newResponse(data, arg, headers) {
let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders;
if (typeof arg === "object" && arg.headers) {
responseHeaders ??= new Headers();
for (const [key, value] of new Headers(arg.headers)) if (key === "set-cookie") responseHeaders.append(key, value);
else responseHeaders.set(key, value);
}
if (headers) {
if (!responseHeaders) {
let count = 0;
for (const k in headers) if (++count > 1 || typeof headers[k] !== "string") {
responseHeaders = new Headers();
break;
}
}
if (responseHeaders) for (const k in headers) {
const v = headers[k];
if (typeof v === "string") responseHeaders.set(k, v);
else {
responseHeaders.delete(k);
for (const v2 of v) responseHeaders.append(k, v2);
}
}
}
const status = typeof arg === "number" ? arg : arg?.status ?? this.#status;
return createResponseInstance(data, {
status,
headers: responseHeaders ?? headers
});
}
newResponse = (...args) => this.#newResponse(...args);
/**
* `.body()` can return the HTTP response.
* You can set headers with `.header()` and set HTTP status code with `.status`.
* This can also be set in `.text()`, `.json()` and so on.
*
* @see {@link https://hono.dev/docs/api/context#body}
*
* @example
* ```ts
* app.get('/welcome', (c) => {
* // Set headers
* c.header('X-Message', 'Hello!')
* c.header('Content-Type', 'text/plain')
* // Set HTTP status code
* c.status(201)
*
* // Return the response body
* return c.body('Thank you for coming')
* })
* ```
*/
body = (data, arg, headers) => this.#newResponse(data, arg, headers);
/**
* `.text()` can render text as `Content-Type:text/plain`.
*
* @see {@link https://hono.dev/docs/api/context#text}
*
* @example
* ```ts
* app.get('/say', (c) => {
* return c.text('Hello!')
* })
* ```
*/
text = (text, arg, headers) => {
return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(text, arg, setDefaultContentType(TEXT_PLAIN, headers));
};
/**
* `.json()` can render JSON as `Content-Type:application/json`.
*
* @see {@link https://hono.dev/docs/api/context#json}
*
* @example
* ```ts
* app.get('/api', (c) => {
* return c.json({ message: 'Hello!' })
* })
* ```
*/
json = (object, arg, headers) => {
return this.#newResponse(JSON.stringify(object), arg, setDefaultContentType("application/json", headers));
};
html = (html, arg, headers) => {
const res = (html) => this.#newResponse(html, arg, setDefaultContentType("text/html; charset=UTF-8", headers));
return typeof html === "object" ? require_utils_html.resolveCallback(html, require_utils_html.HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html);
};
/**
* `.redirect()` can Redirect, default status code is 302.
*
* @see {@link https://hono.dev/docs/api/context#redirect}
*
* @example
* ```ts
* app.get('/redirect', (c) => {
* return c.redirect('/')
* })
* app.get('/redirect-permanently', (c) => {
* return c.redirect('/', 301)
* })
* ```
*/
redirect = (location, status) => {
const locationString = String(location);
this.header("Location", !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString));
return this.newResponse(null, status ?? 302);
};
/**
* `.notFound()` can return the Not Found Response.
*
* @see {@link https://hono.dev/docs/api/context#notfound}
*
* @example
* ```ts
* app.get('/notfound', (c) => {
* return c.notFound()
* })
* ```
*/
notFound = () => {
this.#notFoundHandler ??= () => createResponseInstance();
return this.#notFoundHandler(this);
};
};
//#endregion
exports.Context = Context;
exports.TEXT_PLAIN = TEXT_PLAIN;
@@ -0,0 +1 @@
{"version":3,"file":"layout-panel-left.js","sources":["../../../src/icons/layout-panel-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LayoutPanelLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIxOCIgeD0iMyIgeT0iMyIgcng9IjEiIC8+CiAgPHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iNyIgeD0iMTQiIHk9IjMiIHJ4PSIxIiAvPgogIDxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjciIHg9IjE0IiB5PSIxNCIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/layout-panel-left\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 LayoutPanelLeft = createLucideIcon('LayoutPanelLeft', [\n ['rect', { width: '7', height: '18', x: '3', y: '3', rx: '1', key: '2obqm' }],\n ['rect', { width: '7', height: '7', x: '14', y: '3', rx: '1', key: '6d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AA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,327 @@
'use strict'
const test = require('tape')
const fastURI = require('..')
test('URI parse', (t) => {
let components
// scheme
components = fastURI.parse('uri:')
t.equal(components.error, undefined, 'scheme errors')
t.equal(components.scheme, 'uri', 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// userinfo
components = fastURI.parse('//@')
t.equal(components.error, undefined, 'userinfo errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, "@", "authority");
t.equal(components.userinfo, '', 'userinfo')
t.equal(components.host, '', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// host
components = fastURI.parse('//')
t.equal(components.error, undefined, 'host errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, "", "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// port
components = fastURI.parse('//:')
t.equal(components.error, undefined, 'port errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, ":", "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '', 'host')
t.equal(components.port, '', 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// path
components = fastURI.parse('')
t.equal(components.error, undefined, 'path errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// query
components = fastURI.parse('?')
t.equal(components.error, undefined, 'query errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, '', 'query')
t.equal(components.fragment, undefined, 'fragment')
// fragment
components = fastURI.parse('#')
t.equal(components.error, undefined, 'fragment errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, '', 'fragment')
// fragment with character tabulation
components = fastURI.parse('#\t')
t.equal(components.error, undefined, 'path errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, '%09', 'fragment')
// fragment with line feed
components = fastURI.parse('#\n')
t.equal(components.error, undefined, 'path errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, '%0A', 'fragment')
// fragment with line tabulation
components = fastURI.parse('#\v')
t.equal(components.error, undefined, 'path errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, '%0B', 'fragment')
// fragment with form feed
components = fastURI.parse('#\f')
t.equal(components.error, undefined, 'path errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, '%0C', 'fragment')
// fragment with carriage return
components = fastURI.parse('#\r')
t.equal(components.error, undefined, 'path errors')
t.equal(components.scheme, undefined, 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, '%0D', 'fragment')
// a fragment whose decoded bytes are not valid UTF-8 is still valid
// percent-encoding (RFC 3986 §2.1 is byte-level), so it is preserved as-is
// rather than being flagged as malformed
components = fastURI.parse('http://example.com/#%E0%A4A')
t.equal(components.error, undefined, 'valid percent-encoding is not flagged as malformed')
t.equal(components.fragment, '%E0%A4A', 'fragment is preserved')
// all
components = fastURI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
t.equal(components.error, undefined, 'all errors')
t.equal(components.scheme, 'uri', 'scheme')
// t.equal(components.authority, "user:pass@example.com:123", "authority");
t.equal(components.userinfo, 'user:pass', 'userinfo')
t.equal(components.host, 'example.com', 'host')
t.equal(components.port, 123, 'port')
t.equal(components.path, '/one/two.three', 'path')
t.equal(components.query, 'q1=a1&q2=a2', 'query')
t.equal(components.fragment, 'body', 'fragment')
// IPv4address
components = fastURI.parse('//10.10.10.10')
t.equal(components.error, undefined, 'IPv4address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '10.10.10.10', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// IPv4address with unformated 0 stay as-is
components = fastURI.parse('//10.10.000.10') // not valid as per https://datatracker.ietf.org/doc/html/rfc5954#section-4.1
t.equal(components.error, undefined, 'IPv4address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '10.10.000.10', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
components = fastURI.parse('//01.01.01.01') // not valid in URIs: https://datatracker.ietf.org/doc/html/rfc3986#section-7.4
t.equal(components.error, undefined, 'IPv4address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '01.01.01.01', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// IPv6address
components = fastURI.parse('//[2001:db8::7]')
t.equal(components.error, undefined, 'IPv4address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '2001:db8::7', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// invalid IPv6
components = fastURI.parse('//[2001:dbZ::7]')
t.equal(components.host, '[2001:dbz::7]')
t.equal(components.error, 'URI host is malformed.')
// mixed IPv4address & IPv6address
components = fastURI.parse('//[::ffff:129.144.52.38]')
t.equal(components.error, undefined, 'IPv4address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '::ffff:129.144.52.38', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
components = fastURI.parse('uri://10.10.10.10.example.com/en/process')
t.equal(components.error, undefined, 'mixed errors')
t.equal(components.scheme, 'uri', 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '10.10.10.10.example.com', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '/en/process', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16)
components = fastURI.parse('//[2606:2800:220:1:248:1893:25c8:1946]/test')
t.equal(components.error, undefined, 'IPv6address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '2606:2800:220:1:248:1893:25c8:1946', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '/test', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// IPv6address, example from RFC 5952
components = fastURI.parse('//[2001:db8::1]:80')
t.equal(components.error, undefined, 'IPv6address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '2001:db8::1', 'host')
t.equal(components.port, 80, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// IPv6address with zone identifier, RFC 6874
components = fastURI.parse('//[fe80::a%25en1]')
t.equal(components.error, undefined, 'IPv4address errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, 'fe80::a%en1', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22)
components = fastURI.parse('//[2001:db8::7%en0]')
t.equal(components.error, undefined, 'IPv6address interface errors')
t.equal(components.scheme, undefined, 'scheme')
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, '2001:db8::7%en0', 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, '', 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
// UUID V1
components = fastURI.parse('urn:uuid:b571b0bc-4713-11ec-81d3-0242ac130003')
t.equal(components.error, undefined, 'errors')
t.equal(components.scheme, 'urn', 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, undefined, 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
t.equal(components.nid, 'uuid', 'nid')
t.equal(components.nss, undefined, 'nss')
t.equal(components.uuid, 'b571b0bc-4713-11ec-81d3-0242ac130003', 'uuid')
// UUID v4
components = fastURI.parse('urn:uuid:97a32222-89b7-420e-8507-4360723e2c2a')
t.equal(components.uuid, '97a32222-89b7-420e-8507-4360723e2c2a', 'uuid')
components = fastURI.parse('urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
t.notSame(components.error, undefined, 'errors')
components = fastURI.parse('urn:foo:a123,456')
t.equal(components.error, undefined, 'errors')
t.equal(components.scheme, 'urn', 'scheme')
// t.equal(components.authority, undefined, "authority");
t.equal(components.userinfo, undefined, 'userinfo')
t.equal(components.host, undefined, 'host')
t.equal(components.port, undefined, 'port')
t.equal(components.path, undefined, 'path')
t.equal(components.query, undefined, 'query')
t.equal(components.fragment, undefined, 'fragment')
t.equal(components.nid, 'foo', 'nid')
t.equal(components.nss, 'a123,456', 'nss')
components = fastURI.parse('//[2606:2800:220:1:248:1893:25c8:1946:43209]')
t.equal(components.host, '[2606:2800:220:1:248:1893:25c8:1946:43209]')
t.equal(components.error, 'URI host is malformed.')
components = fastURI.parse('urn:foo:|\\24fpl')
t.equal(components.error, 'URN can not be parsed.')
t.end()
})
@@ -0,0 +1 @@
module.exports={C:{"47":0.00233,"48":0.00233,"52":0.00465,"56":0.00233,"60":0.00233,"72":0.00465,"94":0.00233,"102":0.00233,"106":0.00233,"115":0.79283,"120":0.00465,"121":0.01163,"125":0.00233,"127":0.02093,"128":0.00233,"130":0.00233,"131":0.00233,"132":0.00233,"133":0.00233,"134":0.00233,"135":0.00233,"136":0.00465,"137":0.00233,"138":0.00465,"139":0.00233,"140":0.09998,"141":0.00233,"142":0.00465,"143":0.00698,"144":0.00698,"145":0.0093,"146":0.01395,"147":0.01395,"148":0.00698,"149":0.00465,"150":0.00465,"151":0.02325,"152":0.03953,"153":0.07208,"154":0.2976,"155":0.92768,"156":0.81608,"157":0.03023,_:"2 3 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 38 39 40 41 42 43 44 45 46 49 50 51 53 54 55 57 58 59 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 95 96 97 98 99 100 101 103 104 105 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 126 129 158 159 160 3.5 3.6"},D:{"49":0.00233,"51":0.00233,"70":0.00233,"71":0.01163,"72":0.00233,"73":0.00233,"74":0.00233,"75":0.00233,"76":0.00233,"77":0.00233,"78":0.00698,"79":0.00465,"80":0.00698,"81":0.00465,"83":0.0093,"84":0.00465,"85":0.00233,"86":0.01628,"87":0.00698,"88":0.00698,"89":0.00698,"90":0.00465,"91":0.00465,"92":0.00698,"93":0.00233,"94":0.00233,"95":0.00233,"96":0.00698,"97":0.00233,"98":0.00465,"99":0.00465,"100":0.00233,"101":0.00465,"102":0.00465,"103":0.01163,"104":0.0093,"105":0.0093,"106":0.0093,"107":0.01628,"108":0.01628,"109":2.35523,"110":0.00698,"111":0.0093,"112":0.00698,"113":0.00233,"114":0.0093,"115":0.00233,"116":0.02558,"117":0.01163,"118":0.01395,"119":0.02093,"120":0.03023,"121":0.01395,"122":0.0186,"123":0.02558,"124":0.01395,"125":0.00698,"126":0.0186,"127":0.01163,"128":0.01163,"129":0.0093,"130":0.02093,"131":0.0651,"132":0.01395,"133":0.0279,"134":0.03023,"135":0.03953,"136":0.0279,"137":0.03255,"138":0.0651,"139":0.02558,"140":0.03023,"141":0.0372,"142":0.05115,"143":0.0651,"144":0.0744,"145":0.093,"146":0.0093,"147":0.02558,"148":0.07208,"149":0.10928,"150":0.27435,"151":1.25318,"152":6.13103,"153":4.43145,"154":0.95325,"155":0.01163,_:"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 38 39 40 41 42 43 44 45 46 47 48 50 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 156 157"},F:{"64":0.00233,"79":0.00698,"95":0.03255,"100":0.00233,"101":0.00698,"124":0.00233,"125":0.00233,"126":0.00233,"127":0.00233,"131":0.00465,"132":0.00233,"133":0.0093,"134":0.03255,"135":0.17903,_:"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 54 55 56 57 58 60 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.00233,"15":0.00233,"16":0.00233,"18":0.0093,"83":0.00233,"84":0.00233,"88":0.00465,"89":0.00233,"90":0.00233,"92":0.07208,"100":0.00465,"109":0.09068,"119":0.00465,"120":0.00698,"122":0.0093,"131":0.00233,"138":0.00233,"139":0.00233,"140":0.00465,"141":0.00698,"142":0.00465,"143":0.0093,"144":0.00465,"145":0.0093,"147":0.00233,"148":0.00465,"149":0.01395,"150":0.02558,"151":0.05348,"152":0.29528,"153":0.3255,"154":0.09068,_:"12 13 17 79 80 81 85 86 87 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 123 124 125 126 127 128 129 130 132 133 134 135 136 137 146"},E:{"27":0.0093,_:"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 13.1 14.1 15.1 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.3 17.4 18.0 18.1 18.2 18.4 27.1 27.2 TP","15.2-15.3":0.00233,"15.6":0.00698,"16.6":0.00698,"17.1":0.00233,"17.5":0.00233,"17.6":0.00233,"18.3":0.00233,"18.5-18.7":0.00233,"26.0":0.00233,"26.1":0.00465,"26.2":0.00233,"26.3":0.00233,"26.4":0.00233,"26.5":0.02325,"26.6":0.0279},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0007,"5.0-5.1":0.0007,"6.0-6.1":0,"7.0-7.1":0.00141,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00705,"11.0-11.2":0.0007,"11.3-11.4":0.00141,"12.0-12.1":0,"12.2-12.5":0.01832,"13.0-13.1":0,"13.2":0.00352,"13.3":0,"13.4-13.7":0.0007,"14.0-14.4":0.00282,"14.5-14.8":0.00423,"15.0-15.1":0.00423,"15.2-15.3":0.00282,"15.4":0.00352,"15.5":0.00423,"15.6-15.8":0.09159,"16.0":0.00705,"16.1":0.01268,"16.2":0.00705,"16.3":0.0155,"16.4":0.00352,"16.5":0.00564,"16.6-16.7":0.12753,"17.0":0.00493,"17.1":0.00705,"17.2":0.00705,"17.3":0.01057,"17.4":0.0148,"17.5":0.02889,"17.6-17.7":0.07468,"18.0":0.0155,"18.1":0.031,"18.2":0.04227,"18.3":0.07327,"18.4":0.0458,"18.5-18.7":0.94623,"26.0":0.0458,"26.1":0.0465,"26.2":0.12119,"26.3":0.13105,"26.4":0.09582,"26.5":0.64186,"26.6":3.96036,"27.0":0.30367,"27.1":0,"27.2":0.00775},P:{"20":0.01915,"21":0.0383,"22":0.07659,"23":0.08616,"24":0.10531,"25":0.10531,"26":0.20105,"27":0.1819,"28":0.4021,"29":0.39253,"30"Line truncated
@@ -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 ArchiveRestore = createLucideIcon("ArchiveRestore", [
["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
["path", { d: "M4 8v11a2 2 0 0 0 2 2h2", key: "tvwodi" }],
["path", { d: "M20 8v11a2 2 0 0 1-2 2h-2", key: "1gkqxj" }],
["path", { d: "m9 15 3-3 3 3", key: "1pd0qc" }],
["path", { d: "M12 12v9", key: "192myk" }]
]);
export { ArchiveRestore as default };
//# sourceMappingURL=archive-restore.js.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2015_symbol_wellknown: LibDefinition;
@@ -0,0 +1,326 @@
import { isServer } from "@tanstack/router-core/isServer";
//#region src/utils.ts
/**
* Return the last element of an array.
* Intended for non-empty arrays used within router internals.
*/
function last(arr) {
return arr[arr.length - 1];
}
function isFunction(d) {
return typeof d === "function";
}
/**
* Apply a value-or-updater to a previous value.
* Accepts either a literal value or a function of the previous value.
*/
function functionalUpdate(updater, previous) {
if (isFunction(updater)) return updater(previous);
return updater;
}
const hasOwn = Object.prototype.hasOwnProperty;
const isEnumerable = Object.prototype.propertyIsEnumerable;
function hasKeys(obj) {
for (const key in obj) if (hasOwn.call(obj, key)) return true;
return false;
}
const createNull = () => Object.create(null);
const nullReplaceEqualDeep = (prev, next) => replaceEqualDeep(prev, next, createNull);
/**
* This function returns `prev` if `_next` is deeply equal.
* If not, it will replace any deeply equal children of `b` with those of `a`.
* This can be used for structural sharing between immutable JSON values for example.
* Do not use this with signals
*/
function replaceEqualDeep(prev, _next, _makeObj = () => ({}), _depth = 0) {
if (isServer) return _next;
if (prev === _next) return prev;
if (_depth > 500) return _next;
const next = _next;
const array = isPlainArray(prev) && isPlainArray(next);
if (!array && !(isPlainObject(prev) && isPlainObject(next))) return next;
const prevItems = array ? prev : getEnumerableOwnKeys(prev);
if (!prevItems) return next;
const nextItems = array ? next : getEnumerableOwnKeys(next);
if (!nextItems) return next;
const prevSize = prevItems.length;
const nextSize = nextItems.length;
const copy = array ? new Array(nextSize) : _makeObj();
let equalItems = 0;
for (let i = 0; i < nextSize; i++) {
const key = array ? i : nextItems[i];
const p = prev[key];
const n = next[key];
if (p === n) {
copy[key] = p;
if (array ? i < prevSize : hasOwn.call(prev, key)) equalItems++;
continue;
}
if (p === null || n === null || typeof p !== "object" || typeof n !== "object") {
copy[key] = n;
continue;
}
const v = replaceEqualDeep(p, n, _makeObj, _depth + 1);
copy[key] = v;
if (v === p) equalItems++;
}
return prevSize === nextSize && equalItems === prevSize ? prev : copy;
}
/**
* Equivalent to `Reflect.ownKeys`, but ensures that objects are "clone-friendly":
* will return false if object has any non-enumerable properties.
*
* Optimized for the common case where objects have no symbol properties.
*/
function getEnumerableOwnKeys(o) {
const names = Object.getOwnPropertyNames(o);
for (const name of names) if (!isEnumerable.call(o, name)) return false;
const symbols = Object.getOwnPropertySymbols(o);
if (symbols.length === 0) return names;
const keys = names;
for (const symbol of symbols) {
if (!isEnumerable.call(o, symbol)) return false;
keys.push(symbol);
}
return keys;
}
function isPlainObject(o) {
if (!hasObjectPrototype(o)) return false;
const ctor = o.constructor;
if (typeof ctor === "undefined") return true;
const prot = ctor.prototype;
if (!hasObjectPrototype(prot)) return false;
if (!prot.hasOwnProperty("isPrototypeOf")) return false;
return true;
}
function hasObjectPrototype(o) {
return Object.prototype.toString.call(o) === "[object Object]";
}
/**
* Check if a value is a "plain" array (no extra enumerable keys).
*/
function isPlainArray(value) {
return Array.isArray(value) && value.length === Object.keys(value).length;
}
/**
* Perform a deep equality check with options for partial comparison and
* ignoring `undefined` values. Optimized for router state comparisons.
*/
function deepEqual(a, b, opts) {
if (a === b) return true;
if (typeof a !== typeof b) return false;
if (Array.isArray(a) && Array.isArray(b)) {
if (a.length !== b.length) return false;
for (let i = 0, l = a.length; i < l; i++) if (!deepEqual(a[i], b[i], opts)) return false;
return true;
}
if (isPlainObject(a) && isPlainObject(b)) {
const ignoreUndefined = opts?.ignoreUndefined ?? true;
if (opts?.partial) {
for (const k in b) if (!ignoreUndefined || b[k] !== void 0) {
if (!deepEqual(a[k], b[k], opts)) return false;
}
return true;
}
let aCount = 0;
if (!ignoreUndefined) aCount = Object.keys(a).length;
else for (const k in a) if (a[k] !== void 0) aCount++;
let bCount = 0;
for (const k in b) if (!ignoreUndefined || b[k] !== void 0) {
bCount++;
if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false;
}
return aCount === bCount;
}
return false;
}
/**
* Create a promise with exposed resolve/reject and status fields.
* Useful for coordinating async router lifecycle operations.
*/
function createControlledPromise(onResolve) {
let resolveLoadPromise;
let rejectLoadPromise;
const controlledPromise = new Promise((resolve, reject) => {
resolveLoadPromise = resolve;
rejectLoadPromise = reject;
});
controlledPromise.status = "pending";
controlledPromise.resolve = (value) => {
controlledPromise.status = "resolved";
controlledPromise.value = value;
resolveLoadPromise(value);
onResolve?.(value);
};
controlledPromise.reject = (e) => {
controlledPromise.status = "rejected";
rejectLoadPromise(e);
};
return controlledPromise;
}
/**
* Heuristically detect dynamic import "module not found" errors
* across major browsers for lazy route component handling.
*/
function isModuleNotFoundError(error) {
if (typeof error?.message !== "string") return false;
return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed");
}
function isPromise(value) {
return Boolean(value && typeof value === "object" && typeof value.then === "function");
}
function findLast(array, predicate) {
for (let i = array.length - 1; i >= 0; i--) {
const item = array[i];
if (predicate(item)) return item;
}
}
/**
* Remove control characters that can cause open redirect vulnerabilities.
* Characters like \r (CR) and \n (LF) can trick URL parsers into interpreting
* paths like "/\r/evil.com" as "http://evil.com".
*/
function sanitizePathSegment(segment) {
return segment.replace(/[\x00-\x1f\x7f]/g, "");
}
function decodeSegment(segment) {
let decoded;
try {
decoded = decodeURI(segment);
} catch {
decoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => {
try {
return decodeURI(match);
} catch {
return match;
}
});
}
return sanitizePathSegment(decoded);
}
/**
* Default list of URL protocols to allow in links, redirects, and navigation.
* Any absolute URL protocol not in this list is treated as dangerous by default.
*/
const DEFAULT_PROTOCOL_ALLOWLIST = [
"http:",
"https:",
"mailto:",
"tel:"
];
/**
* Check if a URL string uses a protocol that is not in the allowlist.
* Returns true for blocked protocols like javascript:, blob:, data:, etc.
*
* The URL constructor correctly normalizes:
* - Mixed case (JavaScript: → javascript:)
* - Whitespace/control characters (java\nscript: → javascript:)
* - Leading whitespace
*
* For relative URLs (no protocol), returns false (safe).
*
* @param url - The URL string to check
* @param allowlist - Set of protocols to allow
* @returns true if the URL uses a protocol that is not allowed
*/
function isDangerousProtocol(url, allowlist) {
if (!url) return false;
try {
const parsed = new URL(url);
return !allowlist.has(parsed.protocol);
} catch {
return false;
}
}
const HTML_ESCAPE_LOOKUP = {
"&": "\\u0026",
">": "\\u003e",
"<": "\\u003c",
"\u2028": "\\u2028",
"\u2029": "\\u2029"
};
const HTML_ESCAPE_REGEX = /[&><\u2028\u2029]/g;
/**
* Escape HTML special characters in a string to prevent XSS attacks
* when embedding strings in script tags during SSR.
*
* This is essential for preventing XSS vulnerabilities when user-controlled
* content is embedded in inline scripts.
*/
function escapeHtml(str) {
return str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]);
}
function decodePath(path) {
if (!path) return {
path,
handledProtocolRelativeURL: false
};
if (!/[%\\\x00-\x1f\x7f]/.test(path) && !path.startsWith("//")) return {
path,
handledProtocolRelativeURL: false
};
const re = /%25|%5C/gi;
let cursor = 0;
let result = "";
let match;
while (null !== (match = re.exec(path))) {
result += decodeSegment(path.slice(cursor, match.index)) + match[0];
cursor = re.lastIndex;
}
result = result + decodeSegment(cursor ? path.slice(cursor) : path);
let handledProtocolRelativeURL = false;
if (result.startsWith("//")) {
handledProtocolRelativeURL = true;
result = "/" + result.replace(/^\/+/, "");
}
return {
path: result,
handledProtocolRelativeURL
};
}
/**
* Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing.
*
* This function encodes:
* - Whitespace characters (spaces → %20, tabs → %09, etc.)
* - Non-ASCII/Unicode characters (emojis, accented characters, etc.)
*
* It preserves:
* - Already percent-encoded sequences (won't double-encode %2F, %25, etc.)
* - ASCII special characters valid in URL paths (@, $, &, +, etc.)
* - Forward slashes as path separators
*
* Used to generate proper href values for SSR without constructing URL objects.
*
* @example
* encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf'
* encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E'
* encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved)
*/
function encodePathLikeUrl(path) {
if (!/\s|[^\u0000-\u007F]/.test(path)) return path;
return path.replace(/\s|[^\u0000-\u007F]/gu, encodeURIComponent);
}
/**
* Builds the dev-mode CSS styles URL for route-scoped CSS collection.
* Used by HeadContent components in all framework implementations to construct
* the URL for the `/@tanstack-start/styles.css` endpoint.
*
* @param basepath - The router's basepath (may or may not have leading slash)
* @param routeIds - Array of matched route IDs to include in the CSS collection
* @returns The full URL path for the dev styles CSS endpoint
*/
function buildDevStylesUrl(basepath, routeIds) {
const trimmedBasepath = basepath.replace(/^\/+|\/+$/g, "");
return `${trimmedBasepath === "" ? "" : `/${trimmedBasepath}`}/@tanstack-start/styles.css?routes=${encodeURIComponent(routeIds.join(","))}`;
}
function arraysEqual(a, b) {
if (a === b) return true;
if (a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
return true;
}
//#endregion
export { DEFAULT_PROTOCOL_ALLOWLIST, arraysEqual, buildDevStylesUrl, createControlledPromise, decodePath, deepEqual, encodePathLikeUrl, escapeHtml, findLast, functionalUpdate, hasKeys, isDangerousProtocol, isModuleNotFoundError, isPlainArray, isPlainObject, isPromise, last, nullReplaceEqualDeep, replaceEqualDeep };
//# sourceMappingURL=utils.js.map
@@ -0,0 +1,76 @@
import type * as core from "../core/index.js";
import { visit } from "../core/visit.js";
import * as schemas from "./schemas.js";
/** Distributes `.partial()` through every object in a schema type, preserving the wrappers around them. */
// biome-ignore format: preserve vertical layout for readability.
export type DeepPartial<T extends core.SomeType> =
T extends schemas.ZodObject<infer Shape, infer Config>
? schemas.ZodObject<
{ -readonly [K in keyof Shape]: schemas.ZodOptional<DeepPartial<Shape[K]>> },
Config
>
// Must precede ZodUnion; degrades to it, matching the runtime.
: T extends schemas.ZodDiscriminatedUnion<infer Options, any>
? schemas.ZodUnion<
{ -readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I] }
>
: T extends schemas.ZodUnion<infer Options>
? schemas.ZodUnion<
{ -readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I] }
>
: T extends schemas.ZodArray<infer El>
? schemas.ZodArray<DeepPartial<El>>
: T extends schemas.ZodTuple<infer Items, infer Rest>
? schemas.ZodTuple<
{ -readonly [K in keyof Items]: Items[K] extends core.SomeType ? DeepPartial<Items[K]> : Items[K] },
Rest extends core.SomeType ? DeepPartial<Rest> : Rest
>
: T extends schemas.ZodIntersection<infer A, infer B>
? schemas.ZodIntersection<DeepPartial<A>, DeepPartial<B>>
: T extends schemas.ZodRecord<infer K, infer V>
? schemas.ZodRecord<K, DeepPartial<V>>
: T extends schemas.ZodMap<infer K, infer V>
? schemas.ZodMap<K, DeepPartial<V>>
: T extends schemas.ZodSet<infer El>
? schemas.ZodSet<DeepPartial<El>>
: T extends schemas.ZodOptional<infer Inner>
? schemas.ZodOptional<DeepPartial<Inner>>
: T extends schemas.ZodNullable<infer Inner>
? schemas.ZodNullable<DeepPartial<Inner>>
: T extends schemas.ZodDefault<infer Inner>
? schemas.ZodDefault<DeepPartial<Inner>>
: T extends schemas.ZodPrefault<infer Inner>
? schemas.ZodPrefault<DeepPartial<Inner>>
: T extends schemas.ZodNonOptional<infer Inner>
? schemas.ZodNonOptional<DeepPartial<Inner>>
: T extends schemas.ZodCatch<infer Inner>
? schemas.ZodCatch<DeepPartial<Inner>>
: T extends schemas.ZodReadonly<infer Inner>
? schemas.ZodReadonly<DeepPartial<Inner>>
: T extends schemas.ZodSuccess<infer Inner>
? schemas.ZodSuccess<DeepPartial<Inner>>
: T extends schemas.ZodPromise<infer Inner>
? schemas.ZodPromise<DeepPartial<Inner>>
// Must precede ZodPipe, which both extend structurally, or the subtype is lost.
: T extends schemas.ZodCodec<infer A, infer B>
? schemas.ZodCodec<DeepPartial<A>, DeepPartial<B>>
: T extends schemas.ZodPreprocess<infer B>
? schemas.ZodPreprocess<DeepPartial<B>>
: T extends schemas.ZodPipe<infer A, infer B>
? schemas.ZodPipe<DeepPartial<A>, DeepPartial<B>>
: T extends schemas.ZodLazy<infer Inner>
? schemas.ZodLazy<DeepPartial<Inner>>
: T;
/** Returns a copy of the schema with every nested object's properties made optional. */
export function deepPartial<T extends core.SomeType>(schema: T): DeepPartial<T> {
return visit(schema, {
object: (s) => (s as schemas.ZodObject).partial(),
// Every partialed option now admits `undefined`, which the constructor rejects as a duplicate.
union: (s) => {
const def = s._zod.def as core.$ZodDiscriminatedUnionDef;
return def.discriminator === undefined ? s : schemas.union(def.options as schemas.ZodType[]);
},
}) as unknown as DeepPartial<T>;
}
@@ -0,0 +1,67 @@
import { Feature, resolveVariant } from 'motion-dom';
let id = 0;
class ExitAnimationFeature extends Feature {
constructor() {
super(...arguments);
this.id = id++;
this.isExitComplete = false;
}
update() {
if (!this.node.presenceContext)
return;
const { isPresent, onExitComplete } = this.node.presenceContext;
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
if (!this.node.animationState || isPresent === prevIsPresent) {
return;
}
if (isPresent && prevIsPresent === false) {
/**
* When re-entering, if the exit animation already completed
* (element is at rest), reset to initial values so the enter
* animation replays from the correct position.
*/
if (this.isExitComplete) {
const { initial, custom } = this.node.getProps();
if (typeof initial === "string") {
const resolved = resolveVariant(this.node, initial, custom);
if (resolved) {
const { transition, transitionEnd, ...target } = resolved;
for (const key in target) {
this.node
.getValue(key)
?.jump(target[key]);
}
}
}
this.node.animationState.reset();
this.node.animationState.animateChanges();
}
else {
this.node.animationState.setActive("exit", false);
}
this.isExitComplete = false;
return;
}
const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
if (onExitComplete && !isPresent) {
exitAnimation.then(() => {
this.isExitComplete = true;
onExitComplete(this.id);
});
}
}
mount() {
const { register, onExitComplete } = this.node.presenceContext || {};
if (onExitComplete) {
onExitComplete(this.id);
}
if (register) {
this.unmount = register(this.id);
}
}
unmount() { }
}
export { ExitAnimationFeature };
//# sourceMappingURL=exit.mjs.map
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/primitive.tsx"],
"sourcesContent": ["/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n\n if (activeDescendant) {\n const id = activeElement.getAttribute('aria-activedescendant');\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n"],
"mappings": ";AAGO,IAAM,YAAY,CAAC,EACxB,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAIX,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAC,MAAM,kBAAkB;AACjE,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;AAEO,SAAS,eAAe,SAAkC;AAC/D,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,SAAO,SAAS,eAAe,eAAe;AAChD;AAEO,SAAS,iBAAiB,SAAkC;AACjE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AAEA,SAAO,SAAS,iBAAiB;AACnC;AAMO,SAAS,iBACd,MACA,mBAAmB,OACC;AACpB,QAAM,EAAE,cAAc,IAAI,iBAAiB,IAAI;AAC/C,MAAI,CAAC,eAAe,UAAU;AAG5B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,aAAa,KAAK,cAAc,iBAAiB;AAC3D,WAAO,iBAAiB,cAAc,gBAAgB,MAAM,gBAAgB;AAAA,EAC9E;AAEA,MAAI,kBAAkB;AACpB,UAAM,KAAK,cAAc,aAAa,uBAAuB;AAC7D,QAAI,IAAI;AACN,YAAM,UAAU,iBAAiB,aAAa,EAAE,eAAe,EAAE;AACjE,UAAI,SAAS;AACX,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,QAAQ,SAAgD;AACtE,SAAO,QAAQ,YAAY;AAC7B;",
"names": []
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_z","132":"B"},B:{"132":"_I","260":"_K"},C:{"1":"_NP","516":"_GJ _lB"},D:{"1":"_AC _TJ _iN","2":"_6N","132":"_iH _8G","260":"_6J"},E:{"1":"_iG OD","2":"_4","2052":"_7C"},F:{"1":"_c"},G:{"2":"_d","1025":"_t"},H:{"1025":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"2052":"_A"},O:{"1025":"bC"},P:{"1":"_F"},Q:{"260":"JE"},R:{"1":"KE"},S:{"516":"_C"}},B:1,C:"autocomplete attribute: on & off values",D:true};
@@ -0,0 +1,50 @@
# get-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Robustly get the [[Prototype]] of an object. Uses the best available method.
## Getting started
```sh
npm install --save get-proto
```
## Usage/Examples
```js
const assert = require('assert');
const getProto = require('get-proto');
const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
const b = { c: 3, __proto__: a };
assert.equal(getProto(b), a);
assert.equal(getProto(a), Object.prototype);
assert.equal(getProto({ __proto__: null }), null);
```
## Tests
Clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/get-proto
[npm-version-svg]: https://versionbadg.es/ljharb/get-proto.svg
[deps-svg]: https://david-dm.org/ljharb/get-proto.svg
[deps-url]: https://david-dm.org/ljharb/get-proto
[dev-deps-svg]: https://david-dm.org/ljharb/get-proto/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/get-proto#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/get-proto.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/get-proto.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/get-proto.svg
[downloads-url]: https://npm-stat.com/charts.html?package=get-proto
[codecov-image]: https://codecov.io/gh/ljharb/get-proto/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/get-proto/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-proto
[actions-url]: https://github.com/ljharb/get-proto/actions
@@ -0,0 +1,49 @@
#ifndef DEBOUNCE_H
#define DEBOUNCE_H
#include <thread>
#include <unordered_map>
#include <functional>
#include "Signal.hh"
#define MIN_WAIT_TIME 50
#define MAX_WAIT_TIME 500
#ifdef __wasm32__
extern "C" {
int set_timeout(int ms, void *ctx);
void clear_timeout(int timeout);
void on_timeout(void *ctx);
};
#endif
class Debounce {
public:
static std::shared_ptr<Debounce> getShared();
Debounce();
~Debounce();
void add(void *key, std::function<void()> cb);
void remove(void *key);
void trigger();
void notify();
private:
bool mRunning;
std::mutex mMutex;
#ifdef __wasm32__
int mTimeout;
#else
Signal mWaitSignal;
std::thread mThread;
#endif
std::unordered_map<void *, std::function<void()>> mCallbacks;
std::chrono::time_point<std::chrono::steady_clock> mLastTime;
void loop();
void notifyIfReady();
void wait();
};
#endif
@@ -0,0 +1 @@
{"version":3,"file":"map-pin-x.js","sources":["../../../src/icons/map-pin-x.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkuNzUyIDExLjkwMUE3Ljc4IDcuNzggMCAwIDAgMjAgMTBhOCA4IDAgMCAwLTE2IDBjMCA0Ljk5MyA1LjUzOSAxMC4xOTMgNy4zOTkgMTEuNzk5YTEgMSAwIDAgMCAxLjIwMiAwIDE5IDE5IDAgMCAwIC4wOS0uMDc3IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTAiIHI9IjMiIC8+CiAgPHBhdGggZD0ibTIxLjUgMTUuNS01IDUiIC8+CiAgPHBhdGggZD0ibTIxLjUgMjAuNS01LTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/map-pin-x\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 MapPinX = createLucideIcon('MapPinX', [\n [\n 'path',\n {\n d: 'M19.752 11.901A7.78 7.78 0 0 0 20 10a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 1.202 0 19 19 0 0 0 .09-.077',\n key: 'y0ewhp',\n },\n ],\n ['circle', { cx: '12', cy: '10', r: '3', key: 'ilqhr7' }],\n ['path', { d: 'm21.5 15.5-5 5', key: '11iqnx' }],\n ['path', { d: 'm21.5 20.5-5-5', key: '1bylgx' }],\n]);\n\nexport default MapPinX;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,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,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,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,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,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,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,23 @@
/**
* @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 Wand = createLucideIcon("Wand", [
["path", { d: "M15 4V2", key: "z1p9b7" }],
["path", { d: "M15 16v-2", key: "px0unx" }],
["path", { d: "M8 9h2", key: "1g203m" }],
["path", { d: "M20 9h2", key: "19tzq7" }],
["path", { d: "M17.8 11.8 19 13", key: "yihg8r" }],
["path", { d: "M15 9h.01", key: "x1ddxp" }],
["path", { d: "M17.8 6.2 19 5", key: "fd4us0" }],
["path", { d: "m3 21 9-9", key: "1jfql5" }],
["path", { d: "M12.2 6.2 11 5", key: "i3da3b" }]
]);
export { Wand as default };
//# sourceMappingURL=wand.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_ZE","2":"_x","260":"G"},C:{"1":"_H _lB","2":"_qL"},D:{"1":"_aE","2":"_8H","194":"5B"},E:{"1":"_QB","2":"_CI","260":"QD"},F:{"1":"_BF","2":"_RK","194":"sB"},G:{"1":"_BB","2":"_AI","260":"jD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"CSS Variables (Custom Properties)",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../src/utils/mix/index.ts"],"sourcesContent":["import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix<T>(from: T, to: T): Mixer<T>\nexport function mix(from: number, to: number, p: number): number\nexport function mix<T>(from: T, to: T, p?: T): Mixer<T> | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer<T>\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;SAMgB,GAAG,CAAI,IAAO,EAAE,EAAK,EAAE,CAAK,EAAA;IACxC,IACI,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,EAAE,KAAK,QAAQ;AACtB,QAAA,OAAO,CAAC,KAAK,QAAQ,EACvB;QACE,OAAOA,SAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C;AAEA,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;AAC5B,IAAA,OAAO,KAAK,CAAC,IAAW,EAAE,EAAS,CAAa;AACpD;;;;"}
@@ -0,0 +1,24 @@
import { type Minipass } from 'minipass';
/** has a warn method */
export type Warner = {
warn(code: string, message: string | Error, data: unknown): void;
file?: string;
cwd?: string;
strict?: boolean;
emit(event: 'warn', code: string, message: string, data?: WarnData): void;
emit(event: 'error', error: TarError): void;
};
export type WarnEvent<T = Buffer> = Minipass.Events<T> & {
warn: [code: string, message: string, data: WarnData];
};
export type WarnData = {
file?: string;
cwd?: string;
code?: string;
tarCode?: string;
recoverable?: boolean;
[k: string]: unknown;
};
export type TarError = Error & WarnData;
export declare const warnMethod: (self: Warner, code: string, message: string | Error, data?: WarnData) => void;
//# sourceMappingURL=warn-method.d.ts.map
@@ -0,0 +1,53 @@
module.exports = abbrev
function abbrev (...args) {
let list = args
if (args.length === 1 && (Array.isArray(args[0]) || typeof args[0] === 'string')) {
list = [].concat(args[0])
}
for (let i = 0, l = list.length; i < l; i++) {
list[i] = typeof list[i] === 'string' ? list[i] : String(list[i])
}
// sort them lexicographically, so that they're next to their nearest kin
list = list.sort(lexSort)
// walk through each, seeing how much it has in common with the next and previous
const abbrevs = {}
let prev = ''
for (let ii = 0, ll = list.length; ii < ll; ii++) {
const current = list[ii]
const next = list[ii + 1] || ''
let nextMatches = true
let prevMatches = true
if (current === next) {
continue
}
let j = 0
const cl = current.length
for (; j < cl; j++) {
const curChar = current.charAt(j)
nextMatches = nextMatches && curChar === next.charAt(j)
prevMatches = prevMatches && curChar === prev.charAt(j)
if (!nextMatches && !prevMatches) {
j++
break
}
}
prev = current
if (j === cl) {
abbrevs[current] = current
continue
}
for (let a = current.slice(0, j); j <= cl; j++) {
abbrevs[a] = current
a += current.charAt(j)
}
}
return abbrevs
}
function lexSort (a, b) {
return a === b ? 0 : a > b ? 1 : -1
}
@@ -0,0 +1 @@
{"version":3,"sources":["../lib/v3/index.ts","../lib/v3/isZodErrorLike.ts","../lib/v3/ValidationError.ts","../lib/v3/isValidationError.ts","../lib/v3/isValidationErrorLike.ts","../lib/v3/fromZodIssue.ts","../lib/v3/MessageBuilder.ts","../lib/utils/NonEmptyArray.ts","../lib/utils/stringify.ts","../lib/utils/joinPath.ts","../lib/v3/config.ts","../lib/v3/errorMap.ts","../lib/v3/fromZodError.ts","../lib/v3/toValidationError.ts","../lib/v3/fromError.ts"],"sourcesContent":["export { ValidationError, type ErrorOptions } from './ValidationError.ts';\nexport { isValidationError } from './isValidationError.ts';\nexport { isValidationErrorLike } from './isValidationErrorLike.ts';\nexport { isZodErrorLike } from './isZodErrorLike.ts';\nexport { errorMap } from './errorMap.ts';\nexport { fromError } from './fromError.ts';\nexport { fromZodIssue, type FromZodIssueOptions } from './fromZodIssue.ts';\nexport {\n fromZodError,\n type FromZodErrorOptions,\n type ZodError,\n} from './fromZodError.ts';\nexport { toValidationError } from './toValidationError.ts';\nexport {\n type MessageBuilder,\n type ZodIssue,\n createMessageBuilder,\n} from './MessageBuilder.ts';\nexport { type NonEmptyArray } from '../utils/NonEmptyArray.ts';\n","import type * as zod from 'zod/v3';\n\nexport function isZodErrorLike(err: unknown): err is zod.ZodError {\n return (\n err instanceof Error &&\n err.name === 'ZodError' &&\n 'issues' in err &&\n Array.isArray(err.issues)\n );\n}\n","import { isZodErrorLike } from './isZodErrorLike.ts';\nimport type * as zod from 'zod/v3';\n\n// make zod-validation-error compatible with\n// earlier to es2022 typescript configurations\n// @see https://github.com/causaly/zod-validation-error/issues/226\nexport interface ErrorOptions {\n cause?: unknown;\n}\n\nexport class ValidationError extends Error {\n name: 'ZodValidationError';\n details: Array<zod.ZodIssue>;\n\n constructor(message?: string, options?: ErrorOptions) {\n super(message, options);\n this.name = 'ZodValidationError';\n this.details = getIssuesFromErrorOptions(options);\n }\n\n toString(): string {\n return this.message;\n }\n}\n\nfunction getIssuesFromErrorOptions(\n options?: ErrorOptions\n): Array<zod.ZodIssue> {\n if (options) {\n const cause = options.cause;\n\n if (isZodErrorLike(cause)) {\n return cause.issues;\n }\n }\n\n return [];\n}\n","import { ValidationError } from './ValidationError.ts';\n\nexport function isValidationError(err: unknown): err is ValidationError {\n return err instanceof ValidationError;\n}\n","import type { ValidationError } from './ValidationError.ts';\n\nexport function isValidationErrorLike(err: unknown): err is ValidationError {\n return err instanceof Error && err.name === 'ZodValidationError';\n}\n","import * as zod from 'zod/v3';\n\nimport {\n type MessageBuilder,\n type CreateMessageBuilderProps,\n type ZodIssue,\n createMessageBuilder,\n} from './MessageBuilder.ts';\nimport { ValidationError } from './ValidationError.ts';\n\nexport type FromZodIssueOptions =\n | {\n messageBuilder: MessageBuilder;\n }\n // maintain backwards compatibility\n | Omit<CreateMessageBuilderProps, 'maxIssuesInMessage'>;\n\nexport function fromZodIssue(\n issue: ZodIssue,\n options: FromZodIssueOptions = {}\n): ValidationError {\n const messageBuilder = createMessageBuilderFromOptions(options);\n const message = messageBuilder([issue]);\n\n return new ValidationError(message, { cause: new zod.ZodError([issue]) });\n}\n\nfunction createMessageBuilderFromOptions(\n options: FromZodIssueOptions\n): MessageBuilder {\n if ('messageBuilder' in options) {\n return options.messageBuilder;\n }\n\n return createMessageBuilder(options);\n}\n","import * as zod from 'zod/v3';\nimport { type NonEmptyArray, isNonEmptyArray } from '../utils/NonEmptyArray.ts';\nimport { joinPath } from '../utils/joinPath.ts';\nimport {\n ISSUE_SEPARATOR,\n MAX_ISSUES_IN_MESSAGE,\n PREFIX,\n PREFIX_SEPARATOR,\n UNION_SEPARATOR,\n} from './config.ts';\n\nexport type ZodIssue = zod.ZodIssue;\n\nexport type MessageBuilder = (issues: NonEmptyArray<ZodIssue>) => string;\n\nexport type CreateMessageBuilderProps = {\n issueSeparator?: string;\n unionSeparator?: string;\n prefix?: string | null;\n prefixSeparator?: string;\n includePath?: boolean;\n maxIssuesInMessage?: number;\n};\n\nexport function createMessageBuilder(\n props: CreateMessageBuilderProps = {}\n): MessageBuilder {\n const {\n issueSeparator = ISSUE_SEPARATOR,\n unionSeparator = UNION_SEPARATOR,\n prefixSeparator = PREFIX_SEPARATOR,\n prefix = PREFIX,\n includePath = true,\n maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE,\n } = props;\n return (issues) => {\n const message = issues\n // limit max number of issues printed in the reason section\n .slice(0, maxIssuesInMessage)\n // format error message\n .map((issue) =>\n getMessageFromZodIssue({\n issue,\n Line truncated
@@ -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 TicketSlash = createLucideIcon("TicketSlash", [
[
"path",
{
d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",
key: "qn84l0"
}
],
["path", { d: "m9.5 14.5 5-5", key: "qviqfa" }]
]);
export { TicketSlash as default };
//# sourceMappingURL=ticket-slash.js.map
@@ -0,0 +1,47 @@
/**
* Protocol-independent DOM-style event fan-out.
*
* Owners perform event-specific state updates before calling
* {@link dispatch}. Dispatch then invokes the singular handler followed by a
* snapshot of listeners in insertion order.
*
* @typeParam EventMap - Maps event names to their listener parameter types.
*/
export declare class EventDispatcher<EventMap extends Record<string, unknown>> {
private readonly _eventSlots;
/** Set, replace, or clear the singular handler for an event. */
setHandler<K extends keyof EventMap>(event: K, handler: ((params: EventMap[K]) => void) | undefined): void;
/** Get the singular handler for an event, if one is set. */
getHandler<K extends keyof EventMap>(event: K): ((params: EventMap[K]) => void) | undefined;
/** Add a listener. Listeners run in insertion order after the handler. */
addEventListener<K extends keyof EventMap>(event: K, handler: (params: EventMap[K]) => void): void;
/** Remove the first matching listener, if present. */
removeEventListener<K extends keyof EventMap>(event: K, handler: (params: EventMap[K]) => void): void;
/**
* Dispatch an event to its singular handler and a listener snapshot.
* Listener mutations during dispatch take effect on the next dispatch.
*/
dispatch<K extends keyof EventMap>(event: K, params: EventMap[K]): void;
private _ensureEventSlot;
}
/**
* Tracks which JSON-RPC methods already have a handler registered through the
* owning `App` / `AppBridge`, so a second direct `setRequestHandler` /
* `setNotificationHandler` call for the same method throws instead of
* silently replacing the first handler (the base SDK `Protocol` replaces).
*
* The `on*` setters use {@link replace} for DOM-style replace semantics, and
* `removeRequestHandler` / `removeNotificationHandler` use {@link release}.
*
* @internal
*/
export declare class MethodRegistry {
private readonly _methods;
/** Claim `method`. Throws if a handler is already registered for it. */
claim(method: string, via: string): void;
/** Claim `method` with replace semantics (never throws). */
replace(method: string): void;
/** Release `method` so it can be claimed again. */
release(method: string): void;
has(method: string): boolean;
}
@@ -0,0 +1,50 @@
"use client";
import { dummyMatchContext, matchContext } from "./matchContext.js";
import { useRouter } from "./useRouter.js";
import { invariant, replaceEqualDeep } from "@tanstack/router-core";
import * as React$1 from "react";
import { useStore } from "@tanstack/react-store";
import { isServer } from "@tanstack/router-core/isServer";
//#region src/useMatch.tsx
var dummyStore = {
get: () => void 0,
subscribe: () => ({ unsubscribe: () => {} })
};
/**
* Read and select the nearest or targeted route match.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook
*/
function useMatch(opts) {
const router = useRouter();
const nearestMatchId = React$1.useContext(opts.from ? dummyMatchContext : matchContext);
const key = opts.from ?? nearestMatchId;
const matchStore = key ? opts.from ? router.stores.getRouteMatchStore(key) : router.stores.matchStores.get(key) : void 0;
if (isServer ?? router.isServer) {
const match = matchStore?.get();
if ((opts.shouldThrow ?? true) && !match) {
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}`);
invariant();
}
if (match === void 0) return;
return opts.select ? opts.select(match) : match;
}
const previousResult = React$1.useRef(void 0);
return useStore(matchStore ?? dummyStore, (match) => {
if ((opts.shouldThrow ?? true) && !match) {
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}`);
invariant();
}
if (match === void 0) return;
const selected = opts.select ? opts.select(match) : match;
if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {
const shared = replaceEqualDeep(previousResult.current, selected);
previousResult.current = shared;
return shared;
}
return selected;
});
}
//#endregion
export { useMatch };
//# sourceMappingURL=useMatch.js.map
@@ -0,0 +1,27 @@
import Pool from './pool'
import MockAgent from './mock-agent'
import { Interceptable, MockInterceptor } from './mock-interceptor'
import Dispatcher from './dispatcher'
export default MockPool
/** MockPool extends the Pool API and allows one to mock requests. */
declare class MockPool extends Pool implements Interceptable {
constructor (origin: string, options: MockPool.Options)
/** Intercepts any matching requests that use the same origin as this mock pool. */
intercept (options: MockInterceptor.Options): MockInterceptor
/** Dispatches a mocked request. */
dispatch (options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandler): boolean
/** Closes the mock pool and gracefully waits for enqueued requests to complete. */
close (): Promise<void>
/** Clean up all the prepared mocks. */
cleanMocks (): void
}
declare namespace MockPool {
/** MockPool options. */
export interface Options extends Pool.Options {
/** The agent to associate this MockPool with. */
agent: MockAgent;
}
}
@@ -0,0 +1,23 @@
'use strict';
var replace = String.prototype.replace;
var percentTwenties = /%20/g;
var Format = {
RFC1738: 'RFC1738',
RFC3986: 'RFC3986'
};
module.exports = {
'default': Format.RFC3986,
formatters: {
RFC1738: function (value) {
return replace.call(value, percentTwenties, '+');
},
RFC3986: function (value) {
return String(value);
}
},
RFC1738: Format.RFC1738,
RFC3986: Format.RFC3986
};
@@ -0,0 +1 @@
{"version":3,"file":"panel-bottom-inactive.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,16 @@
/**
* @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 Lock = createLucideIcon("Lock", [
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
]);
export { Lock as default };
//# sourceMappingURL=lock.js.map
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isCompatTag;
function isCompatTag(tagName) {
return !!tagName && /^[a-z]/.test(tagName);
}
//# sourceMappingURL=isCompatTag.js.map
@@ -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 HeartCrack = createLucideIcon("HeartCrack", [
[
"path",
{
d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",
key: "c3ymky"
}
],
["path", { d: "m12 13-1-1 2-2-3-3 2-2", key: "xjdxli" }]
]);
export { HeartCrack as default };
//# sourceMappingURL=heart-crack.js.map
@@ -0,0 +1 @@
{"version":3,"file":"shimsWorkerd.d.mts","names":[],"sources":["../src/shimsWorkerd.ts"],"sourcesContent":[],"mappings":";;;cAwBa;;EAAA,SAAA,MAOZ,EAAA,KAAA"}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPromiseAggregatorMethod = isPromiseAggregatorMethod;
const type_utils_1 = require("@typescript-eslint/type-utils");
const utils_1 = require("@typescript-eslint/utils");
const misc_1 = require("./misc");
const PROMISE_CONSTRUCTOR_ARRAY_METHODS = new Set([
'all',
'allSettled',
'race',
'any',
]);
function isPromiseAggregatorMethod(context, services, node) {
if (node.callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) {
return false;
}
const staticAccessValue = (0, misc_1.getStaticMemberAccessValue)(node.callee, context);
if (!PROMISE_CONSTRUCTOR_ARRAY_METHODS.has(staticAccessValue)) {
return false;
}
return (0, type_utils_1.isPromiseConstructorLike)(services.program, (0, type_utils_1.getConstrainedTypeAtLocation)(services, node.callee.object));
}
@@ -0,0 +1,55 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
const gtFive = z.bigint().gt(BigInt(5));
const gteFive = z.bigint().gte(BigInt(5));
const ltFive = z.bigint().lt(BigInt(5));
const lteFive = z.bigint().lte(BigInt(5));
const positive = z.bigint().positive();
const negative = z.bigint().negative();
const nonnegative = z.bigint().nonnegative();
const nonpositive = z.bigint().nonpositive();
const multipleOfFive = z.bigint().multipleOf(BigInt(5));
test("passing validations", () => {
z.bigint().parse(BigInt(1));
z.bigint().parse(BigInt(0));
z.bigint().parse(BigInt(-1));
gtFive.parse(BigInt(6));
gteFive.parse(BigInt(5));
gteFive.parse(BigInt(6));
ltFive.parse(BigInt(4));
lteFive.parse(BigInt(5));
lteFive.parse(BigInt(4));
positive.parse(BigInt(3));
negative.parse(BigInt(-2));
nonnegative.parse(BigInt(0));
nonnegative.parse(BigInt(7));
nonpositive.parse(BigInt(0));
nonpositive.parse(BigInt(-12));
multipleOfFive.parse(BigInt(15));
});
test("failing validations", () => {
expect(() => gtFive.parse(BigInt(5))).toThrow();
expect(() => gteFive.parse(BigInt(4))).toThrow();
expect(() => ltFive.parse(BigInt(5))).toThrow();
expect(() => lteFive.parse(BigInt(6))).toThrow();
expect(() => positive.parse(BigInt(0))).toThrow();
expect(() => positive.parse(BigInt(-2))).toThrow();
expect(() => negative.parse(BigInt(0))).toThrow();
expect(() => negative.parse(BigInt(3))).toThrow();
expect(() => nonnegative.parse(BigInt(-1))).toThrow();
expect(() => nonpositive.parse(BigInt(1))).toThrow();
expect(() => multipleOfFive.parse(BigInt(13))).toThrow();
});
test("min max getters", () => {
expect(z.bigint().min(BigInt(5)).minValue).toEqual(BigInt(5));
expect(z.bigint().min(BigInt(5)).min(BigInt(10)).minValue).toEqual(BigInt(10));
expect(z.bigint().max(BigInt(5)).maxValue).toEqual(BigInt(5));
expect(z.bigint().max(BigInt(5)).max(BigInt(1)).maxValue).toEqual(BigInt(1));
});
@@ -0,0 +1,13 @@
// Shim globals in cjs bundle
// There's a weird bug that esbuild will always inject importMetaUrl
// if we export it as `const importMetaUrl = ... __filename ...`
// But using a function will not cause this issue
const getImportMetaUrl = () =>
typeof document === "undefined"
? new URL(`file:${__filename}`).href
: (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
? document.currentScript.src
: new URL("main.js", document.baseURI).href;
export const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_IB","132":"E"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_c"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"CSS Generated content for pseudo-elements",D:true};
@@ -0,0 +1,96 @@
"use strict";
exports.__esModule = true;
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */
var Benchmark = require("benchmark");
var mod_js_1 = require("./mod.js");
var fast_levenshtein_1 = require("fast-levenshtein");
var fs = require("fs");
var jslevenshtein = require("js-levenshtein");
var leven = require("leven");
var levenshteinEditDistance = require("levenshtein-edit-distance");
var suite = new Benchmark.Suite();
var randomstring = function (length) {
var result = "";
var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
};
var randomstringArr = function (stringSize, arraySize) {
var i = 0;
var arr = [];
for (i = 0; i < arraySize; i++) {
arr.push(randomstring(stringSize));
}
return arr;
};
var arrSize = 1000;
if (!fs.existsSync("data.json")) {
var data_1 = [
randomstringArr(4, arrSize),
randomstringArr(8, arrSize),
randomstringArr(16, arrSize),
randomstringArr(32, arrSize),
randomstringArr(64, arrSize),
randomstringArr(128, arrSize),
randomstringArr(256, arrSize),
randomstringArr(512, arrSize),
randomstringArr(1024, arrSize),
];
fs.writeFileSync("data.json", JSON.stringify(data_1));
}
var data = JSON.parse(fs.readFileSync("data.json", "utf8"));
var _loop_1 = function (i) {
var datapick = data[i];
if (process.argv[2] !== "no") {
suite
.add("".concat(i, " - js-levenshtein"), function () {
for (var j = 0; j < arrSize - 1; j += 2) {
jslevenshtein(datapick[j], datapick[j + 1]);
}
})
.add("".concat(i, " - leven"), function () {
for (var j = 0; j < arrSize - 1; j += 2) {
leven(datapick[j], datapick[j + 1]);
}
})
.add("".concat(i, " - fast-levenshtein"), function () {
for (var j = 0; j < arrSize - 1; j += 2) {
(0, fast_levenshtein_1.get)(datapick[j], datapick[j + 1]);
}
})
.add("".concat(i, " - levenshtein-edit-distance"), function () {
for (var j = 0; j < arrSize - 1; j += 2) {
levenshteinEditDistance(datapick[j], datapick[j + 1]);
}
});
}
suite.add("".concat(i, " - fastest-levenshtein"), function () {
for (var j = 0; j < arrSize - 1; j += 2) {
(0, mod_js_1.distance)(datapick[j], datapick[j + 1]);
}
});
};
// BENCHMARKS
for (var i = 0; i < 9; i++) {
_loop_1(i);
}
var results = new Map();
suite
.on("cycle", function (event) {
console.log(String(event.target));
if (results.has(event.target.name[0])) {
results.get(event.target.name[0]).push(event.target.hz);
}
else {
results.set(event.target.name[0], [event.target.hz]);
}
})
.on("complete", function () {
console.log(results);
})
// run async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I,MAAM,EAAE,CAAC;oBACX,IAAI,CAAC,IAAI,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,CAAA;gBACtC,CAAC;gBACD,qBAAqB;gBACrB,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,KAAK,IAAI,GAAG,EAAE,KAAK,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,EAAE,CAAC,CAAA;gBACnE,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,KAAK,IAAI,GAAG,EAAE,KAAK,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,EAAE,CAAC,CAAA;gBACnE,oBAAoB;YACtB,CAAC;QACH,CAAC;QAED,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAW,CAAA;QACzB,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,GAAG,IAAI,GAAG,CAAC,CAAC,CAAW,CAAA;QACzB,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,GAAG,KAAK,IAAI,CAAC,KAAK,CAAA;QACpC,IAAI,IAAI,CALine truncated
@@ -0,0 +1,29 @@
import * as core from "../core/index.js";
import { $ZodError } from "../core/index.js";
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
export type ZodIssue = core.$ZodIssue;
/** An Error-like class used to store Zod validation issues. */
export interface ZodError<T = unknown> extends $ZodError<T> {
/** @deprecated Use the `z.treeifyError(err)` function instead. */
format(): core.$ZodFormattedError<T>;
format<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFormattedError<T, U>;
/** @deprecated Use the `z.treeifyError(err)` function instead. */
flatten(): core.$ZodFlattenedError<T>;
flatten<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFlattenedError<T, U>;
/** @deprecated Push directly to `.issues` instead. */
addIssue(issue: core.$ZodIssue): void;
/** @deprecated Push directly to `.issues` instead. */
addIssues(issues: core.$ZodIssue[]): void;
/** @deprecated Check `err.issues.length === 0` instead. */
isEmpty: boolean;
}
export declare const ZodError: core.$constructor<ZodError>;
export declare const ZodRealError: core.$constructor<ZodError>;
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
export type ZodFlattenedError<T, U = string> = core.$ZodFlattenedError<T, U>;
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
export type ZodFormattedError<T, U = string> = core.$ZodFormattedError<T, U>;
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
export type ZodErrorMap<T extends core.$ZodIssueBase = core.$ZodIssue> = core.$ZodErrorMap<T>;
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
export type IssueData = core.$ZodRawIssue;
@@ -0,0 +1,26 @@
import { Env, Schema } from "../../types.js";
import { Hono } from "../../hono.js";
import { HandleOptions, handle } from "./handler.js";
//#region src/adapter/service-worker/index.d.ts
/**
* Registers a Hono app to handle fetch events in a service worker.
* This sets up `addEventListener('fetch', handle(app, options))` for the provided app.
*
* @param app - The Hono application instance
* @param options - Options for handling requests (fetch defaults to undefined)
* @example
* ```ts
* import { Hono } from 'hono'
* import { fire } from 'hono/service-worker'
*
* const app = new Hono()
*
* app.get('/', (c) => c.text('Hi'))
*
* fire(app)
* ```
*/
declare const fire: <E extends Env, S extends Schema, BasePath extends string>(app: Hono<E, S, BasePath>, options?: HandleOptions) => void;
//#endregion
export { fire, handle };
export {};
@@ -0,0 +1,68 @@
'use strict';
var test = require('tape');
var getProto = require('../');
test('getProto', function (t) {
t.equal(typeof getProto, 'function', 'is a function');
t.test('can get', { skip: !getProto }, function (st) {
if (getProto) { // TS doesn't understand tape's skip
var proto = { b: 2 };
st.equal(getProto(proto), Object.prototype, 'proto: returns the [[Prototype]]');
st.test('nullish value', function (s2t) {
// @ts-expect-error
s2t['throws'](function () { return getProto(undefined); }, TypeError, 'undefined is not an object');
// @ts-expect-error
s2t['throws'](function () { return getProto(null); }, TypeError, 'null is not an object');
s2t.end();
});
// @ts-expect-error
st['throws'](function () { getProto(true); }, 'throws for true');
// @ts-expect-error
st['throws'](function () { getProto(false); }, 'throws for false');
// @ts-expect-error
st['throws'](function () { getProto(42); }, 'throws for 42');
// @ts-expect-error
st['throws'](function () { getProto(NaN); }, 'throws for NaN');
// @ts-expect-error
st['throws'](function () { getProto(0); }, 'throws for +0');
// @ts-expect-error
st['throws'](function () { getProto(-0); }, 'throws for -0');
// @ts-expect-error
st['throws'](function () { getProto(Infinity); }, 'throws for ∞');
// @ts-expect-error
st['throws'](function () { getProto(-Infinity); }, 'throws for -∞');
// @ts-expect-error
st['throws'](function () { getProto(''); }, 'throws for empty string');
// @ts-expect-error
st['throws'](function () { getProto('foo'); }, 'throws for non-empty string');
st.equal(getProto(/a/g), RegExp.prototype);
st.equal(getProto(new Date()), Date.prototype);
st.equal(getProto(function () {}), Function.prototype);
st.equal(getProto([]), Array.prototype);
st.equal(getProto({}), Object.prototype);
var nullObject = { __proto__: null };
if ('toString' in nullObject) {
st.comment('no null objects in this engine');
st.equal(getProto(nullObject), Object.prototype, '"null" object has Object.prototype as [[Prototype]]');
} else {
st.equal(getProto(nullObject), null, 'null object has null [[Prototype]]');
}
}
st.end();
});
t.test('can not get', { skip: !!getProto }, function (st) {
st.equal(getProto, null);
st.end();
});
t.end();
});
@@ -0,0 +1 @@
{"version":3,"file":"sparkle.js","sources":["../../../src/icons/sparkle.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Sparkle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOS45MzcgMTUuNUEyIDIgMCAwIDAgOC41IDE0LjA2M2wtNi4xMzUtMS41ODJhLjUuNSAwIDAgMSAwLS45NjJMOC41IDkuOTM2QTIgMiAwIDAgMCA5LjkzNyA4LjVsMS41ODItNi4xMzVhLjUuNSAwIDAgMSAuOTYzIDBMMTQuMDYzIDguNUEyIDIgMCAwIDAgMTUuNSA5LjkzN2w2LjEzNSAxLjU4MWEuNS41IDAgMCAxIDAgLjk2NEwxNS41IDE0LjA2M2EyIDIgMCAwIDAtMS40MzcgMS40MzdsLTEuNTgyIDYuMTM1YS41LjUgMCAwIDEtLjk2MyAweiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/sparkle\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 Sparkle = createLucideIcon('Sparkle', [\n [\n 'path',\n {\n d: 'M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z',\n key: '4pj2yx',\n },\n ],\n]);\n\nexport default Sparkle;\n"],"names":[],"mappings":";;;;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,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,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,16 @@
import { auto } from './auto.mjs';
import { number } from './numbers/index.mjs';
import { px, percent, degrees, vw, vh } from './numbers/units.mjs';
import { testValueType } from './test.mjs';
/**
* A list of value types commonly used for dimensions
*/
const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];
/**
* Tests a dimensional value against the list of dimension ValueTypes
*/
const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));
export { dimensionValueTypes, findDimensionValueType };
//# sourceMappingURL=dimensions.mjs.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_z"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_0L","2":"_VF"},E:{"2":"_R"},F:{"1":"_a","2":"_T"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"1":"B","2":"A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:5,C:"Resource Hints: prerender",D:true};