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":"image-upscale.js","sources":["../../../src/icons/image-upscale.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ImageUpscale\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgM2g1djUiIC8+CiAgPHBhdGggZD0iTTE3IDIxaDJhMiAyIDAgMCAwIDItMiIgLz4KICA8cGF0aCBkPSJNMjEgMTJ2MyIgLz4KICA8cGF0aCBkPSJtMjEgMy01IDUiIC8+CiAgPHBhdGggZD0iTTMgN1Y1YTIgMiAwIDAgMSAyLTIiIC8+CiAgPHBhdGggZD0ibTUgMjEgNC4xNDQtNC4xNDRhMS4yMSAxLjIxIDAgMCAxIDEuNzEyIDBMMTMgMTkiIC8+CiAgPHBhdGggZD0iTTkgM2gzIiAvPgogIDxyZWN0IHg9IjMiIHk9IjExIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHJ4PSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/image-upscale\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 ImageUpscale = createLucideIcon('ImageUpscale', [\n ['path', { d: 'M16 3h5v5', key: '1806ms' }],\n ['path', { d: 'M17 21h2a2 2 0 0 0 2-2', key: '130fy9' }],\n ['path', { d: 'M21 12v3', key: '1wzk3p' }],\n ['path', { d: 'm21 3-5 5', key: '1g5oa7' }],\n ['path', { d: 'M3 7V5a2 2 0 0 1 2-2', key: 'kk3yz1' }],\n ['path', { d: 'm5 21 4.144-4.144a1.21 1.21 0 0 1 1.712 0L13 19', key: 'fyekpt' }],\n ['path', { d: 'M9 3h3', key: 'd52fa' }],\n ['rect', { x: '3', y: '11', width: '10', height: '10', rx: '1', key: '1wpmix' }],\n]);\n\nexport default ImageUpscale;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,72 @@
/**
* Creates a `transformPagePoint` function that corrects pointer coordinates
* for a parent container with CSS transforms (rotation, scale, skew).
*
* When dragging elements inside a transformed parent, pointer coordinates
* need to be transformed through the inverse of the parent's transform
* so the drag offset is in local space.
*
* Works with both static and continuously animating transforms.
*
* @example
* ```jsx
* function App() {
* const ref = useRef(null)
*
* return (
* <motion.div ref={ref} style={{ rotate: 90 }}>
* <MotionConfig transformPagePoint={correctParentTransform(ref)}>
* <motion.div drag />
* </MotionConfig>
* </motion.div>
* )
* }
* ```
*
* @param parentRef - A React ref to the transformed parent element
* @returns A transformPagePoint function for use with MotionConfig
*
* @public
*/
function correctParentTransform(parentRef) {
return (point) => {
const parent = parentRef.current;
if (!parent)
return point;
const inv = getInverseMatrix(parent);
if (!inv)
return point;
// Get center of rotation in page space
const rect = parent.getBoundingClientRect();
const cx = rect.left + window.scrollX + rect.width / 2;
const cy = rect.top + window.scrollY + rect.height / 2;
// Transform (point - center) through inverse, then add center back
const dx = point.x - cx;
const dy = point.y - cy;
return {
x: cx + inv.a * dx + inv.c * dy,
y: cy + inv.b * dx + inv.d * dy,
};
};
}
function getInverseMatrix(element) {
const { transform } = getComputedStyle(element);
if (!transform || transform === "none")
return null;
const match = transform.match(/^matrix3d\((.*)\)$/u) ||
transform.match(/^matrix\((.*)\)$/u);
if (!match)
return null;
const v = match[1].split(",").map(Number);
const is3d = transform.startsWith("matrix3d");
const a = v[0], b = v[1];
const c = is3d ? v[4] : v[2];
const d = is3d ? v[5] : v[3];
const det = a * d - b * c;
if (Math.abs(det) < 1e-10)
return null;
return { a: d / det, b: -b / det, c: -c / det, d: a / det };
}
export { correctParentTransform };
//# sourceMappingURL=transform-rotated-parent.mjs.map
@@ -0,0 +1 @@
module.exports={C:{"52":0.07138,"78":0.01298,"91":0.00649,"103":0.01298,"113":0.00649,"115":0.44774,"120":0.27903,"121":0.55805,"123":0.00649,"124":0.00649,"125":0.00649,"127":0.00649,"128":0.01298,"131":0.00649,"133":0.00649,"135":0.00649,"136":0.01298,"138":0.00649,"139":0.00649,"140":0.10382,"142":0.00649,"143":0.00649,"144":0.00649,"145":0.00649,"146":0.00649,"147":0.03245,"148":0.00649,"149":0.02596,"150":0.03245,"151":0.01298,"152":0.20116,"153":0.05191,"154":0.20765,"155":0.66188,"156":0.70081,"157":0.02596,_:"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 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 102 104 105 106 107 108 109 110 111 112 114 116 117 118 119 122 126 129 130 132 134 137 141 158 159 160 3.5 3.6"},D:{"49":0.02596,"51":0.00649,"61":0.01298,"62":0.00649,"69":0.00649,"70":0.01298,"78":0.00649,"80":0.00649,"81":0.02596,"83":0.01947,"85":0.00649,"86":0.01947,"87":0.01298,"90":0.00649,"91":0.01947,"92":0.11031,"95":0.00649,"96":0.00649,"97":0.01947,"100":0.00649,"102":0.00649,"103":0.25956,"104":0.25307,"105":0.25307,"106":0.33743,"107":0.25307,"108":0.25956,"109":2.28413,"110":0.25307,"111":0.26605,"112":0.25307,"114":0.01947,"116":0.68135,"117":0.25307,"118":0.81113,"119":0.56454,"120":0.89548,"121":0.02596,"122":0.06489,"123":0.07787,"124":0.26605,"125":0.03245,"126":0.01298,"127":0.01298,"128":0.03245,"129":0.01298,"130":0.01947,"131":0.51912,"132":0.01947,"133":0.57103,"134":0.12978,"135":0.06489,"136":0.03893,"137":0.02596,"138":0.09085,"139":0.02596,"140":0.04542,"141":0.03893,"142":0.14276,"143":0.03893,"144":0.04542,"145":0.08436,"146":0.14276,"147":0.06489,"148":0.20765,"149":0.24009,"150":0.7073,"151":1.05122,"152":5.8401,"153":6.20348,"154":1.54438,"155":0.01947,"156":0.00649,_:"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 63 64 65 66 67 68 71 72 73 74 75 76 77 79 84 88 89 93 94 98 99 101 113 115 157"},F:{"36":0.02596,"46":0.00649,"68":0.01298,"76":0.00649,"77":0.25956,"79":0.03245,"80":0.00649,"82":0.00649,"84":0.00649,"85":0.03245,"86":0.01947,"95":0.8825,"96":0.00649,"100":0.01298,"101":0.05191,"102":0.01298,"106":0.00649,"109":0.00649,"112":0.00649,"113":0.00649,"117":0.00649,"119":0.00649,"121":0.01947,"122":0.01298,"125":0.01298,"126":0.00649,"127":0.00649,"131":0.02596,"132":0.00649,"133":0.03245,"134":0.26605,"135":2.91356,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 69 70 71 72 73 74 75 78 81 83 87 88 89 90 91 92 93 94 97 98 99 103 104 105 107 108 110 111 114 115 116 118 120 123 124 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"16":0.00649,"92":0.01947,"109":0.04542,"119":0.28552,"120":0.27903,"121":0.01298,"122":0.00649,"129":0.00649,"131":0.00649,"133":0.00649,"135":0.00649,"138":0.00649,"139":0.00649,"140":0.01298,"141":0.01947,"142":0.01947,"143":0.01947,"144":0.01947,"145":0.01298,"146":0.01298,"147":0.01298,"148":0.01947,"149":0.02596,"150":0.07787,"151":0.13627,"152":1.54438,"153":1.8883,"154":0.52561,_:"12 13 14 15 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 123 124 125 126 127 128 130 132 134 136 137"},E:{"14":0.00649,"27":0.09085,_:"4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 27.1 27.2 TP","13.1":0.01947,"14.1":0.01947,"15.6":0.05191,"16.3":0.01298,"16.5":0.01947,"16.6":0.08436,"17.0":0.00649,"17.1":0.04542,"17.2":0.00649,"17.3":0.00649,"17.4":0.00649,"17.5":0.01298,"17.6":0.04542,"18.0":0.00649,"18.1":0.00649,"18.2":0.00649,"18.3":0.01298,"18.4":0.00649,"18.5-18.7":0.00649,"26.0":0.00649,"26.1":0.00649,"26.2":0.03245,"26.3":0.03245,"26.4":0.02596,"26.5":0.08436,"26.6":0.48668},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00058,"5.0-5.1":0.00058,"6.0-6.1":0,"7.0-7.1":0.00117,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00583,"11.0-11.2":0.00058,"11.3-11.4":0.00117,"12.0-12.1":0,"12.2-12.5":0.01515,"13.0-13.1":0,"13.2":0.00291,"13.3":0,"13.4-13.7":0.00058,"14.0-14.4":0.00233,"14.5-14.8":0.0035,"15.0-15.1":0.0035,"15.2-15.3":0.00233,"15.4":0.00291,"15.5":0.0035,"15.6-15.8":0.07577,"16.0":0.00583,"16.1":0.01049,"16.2":0.00583,"16.3":0.01282,"16.4":0.00291,"16.5":0.00466,"16.6-16.7":0.10549,"17.0":0.00408,"17.1":0.00583,"17.2":0.00583,"17.3":0.00874,"17.4":0.01224,"17.5":0.0239,"17.6-17.7":0.06178,"18.0":0.01282,"18.1":0.02564,"18.2":0.03497,"18.3":0.06061,"18.4":0.03788,"18.5-18.7":0.78274,"26.0":0.03788,"26.1":0.03847,"26.2":0.10025,"26.3":0.10841,"26.4":0.07926,"26.5":0.53095,"26.6":3.27606,"27.0":0.2512,"27.1":0,"27.2":0.00641},P:{"4":0.03335,"22":0.00834,"25":0.00834,"26":0.0083Line truncated
@@ -0,0 +1,20 @@
import DictionaryL33tMatcher from '../dictionary/variants/matching/l33t';
import DictionaryReverseMatcher from '../dictionary/variants/matching/reverse';
import DictionaryMatcher from '../dictionary/matching';
import Options from '../../Options';
import { MatchOptions, WordSequenceMatch, MatcherBaseClass } from '../../types';
declare class MatchWordSequence extends MatcherBaseClass {
dictionary: DictionaryMatcher;
dictionaryL33t: DictionaryL33tMatcher;
dictionaryReverse: DictionaryReverseMatcher;
constructor(options: Options);
match(matchOptions: MatchOptions): WordSequenceMatch[];
private filterDictionaryMatches;
private convertToWordMatches;
private findWordSequences;
private findSequencesFromStart;
private isValidWordSequence;
private createWordSequenceMatch;
private getMostCommon;
}
export default MatchWordSequence;
@@ -0,0 +1,55 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class UseFilePlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string} filename filename
* @param {string | ResolveStepHook} target target
*/
constructor(source, filename, target) {
this.source = source;
this.filename = filename;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync("UseFilePlugin", (request, resolveContext, callback) => {
const filePath = resolver.join(
/** @type {string} */ (request.path),
this.filename,
);
/** @type {ResolveRequest} */
const obj = {
...request,
path: filePath,
relativePath:
request.relativePath &&
resolver.join(request.relativePath, this.filename),
};
resolver.doResolve(
target,
obj,
`using path: ${filePath}`,
resolveContext,
callback,
);
});
}
};
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_iterator: LibDefinition;
@@ -0,0 +1,3 @@
declare const x: typeof Reflect.getPrototypeOf | null;
export = x;
@@ -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 ChevronsLeft = createLucideIcon("ChevronsLeft", [
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
]);
export { ChevronsLeft as default };
//# sourceMappingURL=chevrons-left.js.map
@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_router_trie_router_router = require("./router.js");
exports.TrieRouter = require_router_trie_router_router.TrieRouter;
@@ -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 ReplaceAll = createLucideIcon("ReplaceAll", [
["path", { d: "M14 14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2", key: "1yyzbs" }],
["path", { d: "M14 4a2 2 0 0 1 2-2", key: "1w2hp7" }],
["path", { d: "M16 10a2 2 0 0 1-2-2", key: "shjach" }],
["path", { d: "M20 14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2", key: "zfj4xr" }],
["path", { d: "M20 2a2 2 0 0 1 2 2", key: "188mtx" }],
["path", { d: "M22 8a2 2 0 0 1-2 2", key: "ddf4tu" }],
["path", { d: "m3 7 3 3 3-3", key: "x25e72" }],
["path", { d: "M6 10V5a 3 3 0 0 1 3-3h1", key: "1ageje" }],
["rect", { x: "2", y: "14", width: "8", height: "8", rx: "2", key: "4rksxw" }]
]);
export { ReplaceAll as default };
//# sourceMappingURL=replace-all.js.map
@@ -0,0 +1,38 @@
'use strict'
const test = require('tape')
const {
stringArrayToHexStripped,
removeDotSegments
} = require('../lib/utils')
test('stringArrayToHexStripped', (t) => {
const testCases = [
[['0', '0', '0', '0'], ''],
[['0', '0', '0', '1'], '1'],
[['0', '0', '1', '0'], '10'],
[['0', '1', '0', '0'], '100'],
[['1', '0', '0', '0'], '1000'],
[['1', '0', '0', '1'], '1001'],
]
t.plan(testCases.length)
testCases.forEach(([input, expected]) => {
t.same(stringArrayToHexStripped(input), expected)
})
})
// Just fixtures, because this function already tested by resolve
test('removeDotSegments', (t) => {
const testCases = []
// https://github.com/fastify/fast-uri/issues/139
testCases.push(['WS:/WS://1305G130505:1&%0D:1&C(XXXXX*)))))))XXX130505:UUVUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaa13a',
'WS:/WS://1305G130505:1&%0D:1&C(XXXXX*)))))))XXX130505:UUVUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaa13a'])
t.plan(testCases.length)
testCases.forEach(([input, expected]) => {
t.same(removeDotSegments(input), expected)
})
})
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './circle-chevron-right.js';
//# sourceMappingURL=chevron-right-circle.js.map
@@ -0,0 +1,10 @@
//#region src/helper/streaming/utils.ts
let isOldBunVersion = () => {
const version = typeof Bun !== "undefined" ? Bun.version : void 0;
if (version === void 0) return false;
const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0.");
isOldBunVersion = () => result;
return result;
};
//#endregion
export { isOldBunVersion };
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/scroll/index.ts"],"sourcesContent":["import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n onScroll: OnScroll | AnimationPlaybackControls,\n {\n axis = \"y\",\n container = document.scrollingElement as Element,\n ...options\n }: ScrollOptions = {}\n): VoidFunction {\n if (!container) return noop as VoidFunction\n\n const optionsWithDefaults = { axis, container, ...options }\n\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults)\n}\n"],"names":[],"mappings":";;;;SAMgB,MAAM,CAClB,QAA8C,EAC9C,EACI,IAAI,GAAG,GAAG,EACV,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,GAAG,OAAO,KACK,EAAE,EAAA;AAErB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB;IAE3C,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE;IAE3D,OAAO,OAAO,QAAQ,KAAK;AACvB,UAAE,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB;AAChD,UAAE,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AAC1D;;;;"}
@@ -0,0 +1,23 @@
import { existsSync, readFileSync } from 'node:fs';
import path from 'node:path';
import convertSourceMap from 'convert-source-map';
// based on vite
// https://github.com/vitejs/vite/blob/84079a84ad94de4c1ef4f1bdb2ab448ff2c01196/packages/vite/src/node/server/sourcemap.ts#L149
function extractSourcemapFromFile(code, filePath) {
const map = (convertSourceMap.fromSource(code) || convertSourceMap.fromMapFileSource(code, createConvertSourceMapReadMap(filePath)))?.toObject();
return map ? { map } : undefined;
}
function createConvertSourceMapReadMap(originalFileName) {
return (filename) => {
// convertSourceMap can detect invalid filename from comments.
// fallback to empty source map to avoid errors.
const targetPath = path.resolve(path.dirname(originalFileName), filename);
if (existsSync(targetPath)) {
return readFileSync(targetPath, "utf-8");
}
return "{}";
};
}
export { extractSourcemapFromFile };
@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _iterableToArrayLimit;
function _iterableToArrayLimit(arr, i) {
var iterator = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (iterator == null) return;
var _arr = [];
var iteratorNormalCompletion = true;
var didIteratorError = false;
var step, iteratorError, next, _return;
try {
next = (iterator = iterator.call(arr)).next;
if (i === 0) {
if (Object(iterator) !== iterator) return;
iteratorNormalCompletion = false;
} else {
for (; !(iteratorNormalCompletion = (step = next.call(iterator)).done); iteratorNormalCompletion = true) {
_arr.push(step.value);
if (_arr.length === i) break;
}
}
} catch (err) {
didIteratorError = true;
iteratorError = err;
} finally {
try {
if (!iteratorNormalCompletion && iterator["return"] != null) {
_return = iterator["return"]();
if (Object(_return) !== _return) return;
}
} finally {
if (didIteratorError) throw iteratorError;
}
}
return _arr;
}
//# sourceMappingURL=iterableToArrayLimit.js.map
@@ -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 ArrowDownFromLine = createLucideIcon("ArrowDownFromLine", [
["path", { d: "M19 3H5", key: "1236rx" }],
["path", { d: "M12 21V7", key: "gj6g52" }],
["path", { d: "m6 15 6 6 6-6", key: "h15q88" }]
]);
export { ArrowDownFromLine as default };
//# sourceMappingURL=arrow-down-from-line.js.map
@@ -0,0 +1 @@
{"version":3,"file":"form-data.d.ts","sourceRoot":"","sources":["../../../web/form-data.ts"],"names":[],"mappings":"AA2DA,QAAA,MAAM,cAAc,KA2ClB,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypeScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class TypeScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.type, upperScope, block, false);
}
}
exports.TypeScope = TypeScope;
@@ -0,0 +1 @@
{"version":3,"file":"allOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/allOf.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;YAC3C,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC;gBAAE,OAAM;YACtC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAC,EAAE,KAAK,CAAC,CAAA;YACtE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}
@@ -0,0 +1,43 @@
import { RequestHandler } from 'express';
import { OAuthTokenVerifier } from '../provider.js';
import { AuthInfo } from '../types.js';
export type BearerAuthMiddlewareOptions = {
/**
* A provider used to verify tokens.
*/
verifier: OAuthTokenVerifier;
/**
* Optional scopes that the token must have.
*/
requiredScopes?: string[];
/**
* Optional resource metadata URL to include in WWW-Authenticate header.
*/
resourceMetadataUrl?: string;
/**
* Accept only tokens issued for this resource (the token's audience): the value the authorization server puts
* into tokens meant for this server, usually the server's URL.
* When set, a token is accepted only if the verifier reports that value in `AuthInfo.resource`
* (compared as strings, ignoring a fragment and one trailing slash); any other token is refused with `401 invalid_token`.
* When unset, `AuthInfo.resource` is not compared with anything.
*/
expectedResource?: URL;
};
declare module 'express-serve-static-core' {
interface Request {
/**
* Information about the validated access token, if the `requireBearerAuth` middleware was used.
*/
auth?: AuthInfo;
}
}
/**
* Middleware that requires a valid Bearer token in the Authorization header.
*
* This will validate the token with the auth provider and add the resulting auth info to the request object.
*
* If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header
* for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec.
*/
export declare function requireBearerAuth({ verifier, requiredScopes, resourceMetadataUrl, expectedResource }: BearerAuthMiddlewareOptions): RequestHandler;
//# sourceMappingURL=bearerAuth.d.ts.map
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('.')} */
module.exports = Error;
@@ -0,0 +1,4 @@
type Resolve = (source: string | null) => string;
export = function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve;
export {};
//# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"transform-viewbox-point.mjs","sources":["../../../src/utils/transform-viewbox-point.ts"],"sourcesContent":["import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef<SVGSVGElement>(null)\n *\n * return (\n * <MotionConfig transformPagePoint={transformViewBoxPoint(svgRef)}>\n * <svg ref={svgRef} viewBox=\"0 0 100 100\" width={500} height={500}>\n * <motion.rect drag width={10} height={10} />\n * </svg>\n * </MotionConfig>\n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject<SVGSVGElement | null>\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.y - svgY) * scaleY + svgY,\n }\n }\n}\n"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,SAAU,qBAAqB,CACjC,MAAuC,EAAA;IAEvC,OAAO,CAAC,KAAY,KAAW;AAC3B,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO;QAC1B,IAAI,CAAC,GAAG,EAAE;AACN,YAAA,OAAO,KAAK;QAChB;;AAGA,QAAA,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO;AACpC,QAAA,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,KAAK,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;;AAE3D,YAAA,OAAO,KAAK;QAChB;;AAGA,QAAA,MAAM,IAAI,GAAG,GAAG,CAAC,qBAAqB,EAAE;AACxC,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AACvC,YAAA,OAAO,KAAK;QAChB;;QAGA,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;QACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;;QAG3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO;;;;;QAMtC,OAAO;YACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI;YACnC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI;SACtC;AACL,IAAA,CAAC;AACL;;;;"}
@@ -0,0 +1,820 @@
export default `flf2a$ 8 6 20 -1 2
Tanja was written for -=Tanja Lynnx Jackson=- by
Christopher J. Pirillo "The Locker Gnome" <pirill44@iscssun.uni.edu>
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
!) @
!)11 @
!)11 @
!) @
@
!) @
@
@@
*** *** @
## ## @
## ## @
@
@
@
@
@@
#) 33 @
#)3333333 @
#) 33 @
#) 33 @
#)3333333 @
#) 33 @
@
@@
S) @
S)4444 @
S) 44 @
S)4444 @
S) 44 @
S)44444 @
S) @
@@
%) 555 @
%) 555 @
%)5 @
%)5 @
%)5 55 @
%)5 55 @
@
@@
&)77 @
&) 77 @
&)77 @
&) 77 @
&) 77 @
&)77777 @
@
@@
*** @
## @
## @
@
@
@
@
@@
() @
() @
() @
() @
() @
() @
@
@@
)) @
)) @
)) @
)) @
)) @
)) @
@
@@
*) @
*) 8 88 @
*)8 8 @
*)8888888 @
*)8 8 @
*) 8 88 @
*) @
@@
@
@
## @
###### @
## @
@
@
@@
@
@
@
@
*** @
## @
## @
@@
@
@
@
####### @
@
@
@
@@
@
@
@
@
** @
## @
@
@@
/)? @
/)? @
/)? @
/)? @
/)? @
/)? @
@
@@
0)))) @
0) ))) @
0) ) )) @
0) ) )) @
0)) )) @
0)))) @
@
@@
1)! @
1)!! @
1) @
1) @
1) @
1)!!!!! @
@
@@
2)AAA @
2) AA @
2) @
2) @
2) @
2)AAAAA @
@
@@
3)### @
3) ## @
3)# @
3) @
3) ## @
3)### @
@
@@
4) SS @
4) SS @
4)SSSSS @
4) @
4) @
4) @
@
@@
5)%%%% @
5) @
5)%%%% @
5) @
5) @
5)%%%% @
@
@@
6)NNN @
6) @
6)NNNN @
6) NN @
6) NN @
6)NNN @
@
@@
7)&&&&& @
7) @
7) @
7) @
7) @
7) @
@
@@
8)*** @
8) ** @
8)*** @
8) ** @
8) ** @
8)*** @
@
@@
9)((( @
9) (( @
9)(((( @
9) @
9) (( @
9)((( @
@
@@
@
@
## @
@
## @
@
@
@@
@
@
## @
@
*** @
## @
## @
@@
<) @
<) @
<) @
<) @
<) @
<) @
<) @
@@
@
@
####### @
@
####### @
@
@
@@
>) @
>) @
>) @
>) @
>) @
>) @
>) @
@@
?)//// @
?) // @
?) @
?) @
@
?) @
@
@@
A)222 @
A) 2 @
A) 2222 @
A) 2 2 @
A) 222 @
A) @
@
@@
A)aa @
A) aa @
A) aa @
A)aaaaaa @
A) aa @
A) aa @
@
@@
B)bbbb @
B) bb @
B)bbbb @
B) bb @
B) bb @
B)bbbbb @
@
@@
C)ccc @
C) cc @
C) @
C) @
C) cc @
C)ccc @
@
@@
D)dddd @
D) dd @
D) dd @
D) dd @
D) dd @
D)ddddd @
@
@@
E)eeeeee @
E) @
E)eeeee @
E) @
E) @
E)eeeeee @
@
@@
F)ffffff @
F) @
F)fffff @
F) @
F) @
F) @
@
@@
G)gggg @
G) @
G) ggg @
G) gg @
G) gg @
G)ggg @
@
@@
H) hh @
H) hh @
H)hhhhhh @
H) hh @
H) hh @
H) hh @
@
@@
I)iiii @
I) @
I) @
I) @
I) @
I)iiii @
@
@@
J)jjjjjj @
J) @
J) @
J) jj @
J) jj @
J)jj @
@
@@
K) kk @
K) kk @
K)kkk @
K) kk @
K) kk @
K) kk @
@
@@
L) @
L) @
L) @
L) @
L) @
L)llllll @
@
@@
M)mm mmm @
M) mm mm @
M) mm mm @
M) mm mm @
M) mm @
M) mm @
@
@@
N)n nn @
N)nn nn @
N) nn nn @
N) nnnn @
N) nnn @
N) nn @
@
@@
O)oooo @
O) oo @
O) oo @
O) oo @
O) oo @
O)oooo @
@
@@
P)ppppp @
P) pp @
P)ppppp @
P) @
P) @
P) @
@
@@
Q)qqqq @
Q) qq @
Q) qq @
Q) qq q @
Q) qq @
Q)qqq q @
@
@@
R)rrrrr @
R) rr @
R) rrr @
R) rr @
R) rr @
R) rr @
@
@@
S)ssss @
S) ss @
S)ss @
S) @
S) ss @
S)ssss @
@
@@
T)tttttt @
T) @
T) @
T) @
T) @
T) @
@
@@
U) uu @
U) uu @
U) uu @
U) uu @
U) uu @
U)uuuu @
@
@@
V) vv @
V) vv @
V) vv @
V) vv @
V)vv @
V) @
@
@@
W) ww @
W) ww @
W) ww ww @
W) ww ww @
W) ww ww @
W)ww www @
@
@@
X) xx @
X) xx @
X)xx @
X)xx @
X) xx @
X) xx @
@
@@
Y) yy @
Y) yy @
Y)yy @
Y) @
Y) @
Y) @
@
@@
Z)zzzzzz @
Z) @
Z) @
Z) @
Z) @
Z)zzzzzz @
@
@@
[){{ @
[) @
[) @
[) @
[) @
[){{ @
@
@@
\\)| @
\\)| @
\\)| @
\\)| @
\\)| @
\\)| @
@
@@
])}} @
]) @
]) @
]) @
]) @
])}} @
@
@@
** @
## ## @
@
@
@
@
@
@@
@
@
@
@
@
####### @
@
@@
*** @
## @
## @
@
@
@
@
@@
@
@
a)AAAA @
a)AAA @
a) A @
a)AAAA @
@
@@
b) @
b) @
b)BBBB @
b) BB @
b) BB @
b)BBBB @
@
@@
@
@
c)CCCC @
c) @
c) @
c)CCCC @
@
@@
d) @
d) @
d)DDDD @
d) DD @
d) DD @
d)DDDD @
@
@@
@
@
e)EEEEE @
e)EEEE @
e) @
e)EEEE @
@
@@
f)FFF @
f) @
f)FFF @
f) @
f) @
f) @
@
@@
@
@
g)GGG @
g) GG @
g) GG @
g)GGGG @
GG @
g)GGGG @@
h) @
h) @
h)HHHH @
h) HH @
h) HH @
h) HH @
@
@@
## @
@
i) @
i) @
i) @
i) @
@
@@
## @
@
j) @
j) @
j) @
j) @
j) JJ @
j)JJJ @@
k) @
k) @
k) KK @
k)KK @
k) KK @
k) KK @
@
@@
l)L @
l) @
l) @
l) @
l) @
l)LL @
@
@@
@
@
m)MM MMM @
m) MM MM @
m) MM MM @
m) MM @
@
@@
@
@
n)NNNN @
n) NN @
n) NN @
n) NN @
@
@@
@
@
o)OOO @
o) OO @
o) OO @
o)OOO @
@
@@
@
@
p)PPPP @
p) PP @
p) PP @
p)PPPP @
p) @
p) @@
@
@
q)QQQ @
q) QQ @
q) QQ @
q)QQQQ @
q) @
q) @@
@
@
r)RRR @
r) RR @
r) @
r) @
@
@@
@
@
s)SSSS @
s)SSSS @
s) @
s)SSSS @
@
@@
t) @
t)tTTT @
t) @
t) @
t) @
t)T @
@
@@
@
@
u) UU @
u) UU @
u) UU @
u)UUU @
@
@@
@
@
v) VV @
v) VV @
v)VV @
v) @
@
@@
@
@
w) WW @
w) WW WW @
w) WW WW @
w)WW WWW @
@
@@
@
@
x) XX @
x)X @
x)X @
x) XX @
@
@@
@
@
y) YY @
y) YY @
y) YY @
y)YYYY @
y) @
y)YYYY @@
@
@
z)ZZZZZ @
z) @
z) @
z)ZZZZZ @
@
@@
{)[[[ @
{) @
[{) @
{) @
{) @
{)[[[ @
@
@@
|)\\ @
|)\\ @
|)\\ @
|)\\ @
|)\\ @
|)\\ @
@
@@
})]]] @
}) @
})] @
}) @
}) @
})]]] @
@
@@
@
_-\`-_-\` @
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
\\ / @
, . ><>< . , @
\\\\ /..\\ // @
, \\\\ \\__/ // , @
\\\\ \\\\ // // @
\\\\ \\\\__// // @
\\\\__\\__/__// @
~~~~~~~~ @@
@
@
@
@
@
@
@
@@
#### #### @
##...##...## @
#T........C# @
#A......H# @
#N....R# @
#J..I# @
#AS# @
## @@
`
@@ -0,0 +1,27 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./AST"), exports);
__exportStar(require("./Config"), exports);
__exportStar(require("./ESLint"), exports);
__exportStar(require("./Linter"), exports);
__exportStar(require("./Parser"), exports);
__exportStar(require("./ParserOptions"), exports);
__exportStar(require("./Processor"), exports);
__exportStar(require("./Rule"), exports);
__exportStar(require("./RuleTester"), exports);
__exportStar(require("./Scope"), exports);
__exportStar(require("./SourceCode"), exports);
@@ -0,0 +1,74 @@
/**
* @fileoverview disallow use of the Buffer() constructor
* @author Teddy Katz
* @deprecated in ESLint v7.0.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Node.js rules were moved out of ESLint core.",
url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
deprecatedSince: "7.0.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"eslint-plugin-n now maintains deprecated Node.js-related rules.",
plugin: {
name: "eslint-plugin-n",
url: "https://github.com/eslint-community/eslint-plugin-n",
},
rule: {
name: "no-deprecated-api",
url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-deprecated-api.md",
},
},
],
},
type: "problem",
docs: {
description: "Disallow use of the `Buffer()` constructor",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-buffer-constructor",
},
schema: [],
messages: {
deprecated:
"{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead.",
},
},
create(context) {
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
return {
"CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(
node,
) {
context.report({
node,
messageId: "deprecated",
data: {
expr:
node.type === "CallExpression"
? "Buffer()"
: "new Buffer()",
},
});
},
};
},
};
@@ -0,0 +1,131 @@
import { RuleOptions, UnprefixedRuleOptions } from "./rule-options.js";
import { ESLint, Linter, Rule } from "eslint";
//#region dts/options.d.ts
type IndentRuleOptions = UnprefixedRuleOptions['indent'];
interface StylisticCustomizeOptions {
/**
* The name of the registered plugin, used to prefix rule IDs
* @default '@stylistic'
*/
pluginName?: string;
/**
* Indentation level
* Similar to the `tabWidth` and `useTabs` options in Prettier
*
* @default 2
*/
indent?: IndentRuleOptions[0] | IndentRuleOptions;
/**
* Quote style
* Similar to `singleQuote` option in Prettier
*
* @default 'single'
*/
quotes?: 'single' | 'double' | 'backtick';
/**
* Whether to enable semicolons
* Similar to `semi` option in Prettier
*
* @default false
*/
semi?: boolean;
/**
* Enable JSX support
* @default true
*/
jsx?: boolean;
/**
* When to enable arrow parenthesis
* Similar to `arrowParens` option in Prettier
*
* @default false
*/
arrowParens?: boolean;
/**
* Which brace style to use
* @default 'stroustrup'
*/
braceStyle?: '1tbs' | 'stroustrup' | 'allman';
/**
* Whether to require spaces around braces
* Similar to `bracketSpacing` option in Prettier
*
* @default true
*/
blockSpacing?: boolean;
/**
* When to enable prop quoting
* Similar to `quoteProps` option in Prettier
*
* @default 'consistent-as-needed'
*/
quoteProps?: 'always' | 'as-needed' | 'consistent' | 'consistent-as-needed';
/**
* When to enable comma dangles
* Similar to `trailingComma` option in Prettier
*
* @default 'always-multiline'
*/
commaDangle?: 'never' | 'always' | 'always-multiline' | 'only-multiline';
/**
* Severity level of the rules
* Determines how violations are reported.
*
* @default 'error'
*/
severity?: 'error' | 'warn';
/**
* Enable the experimental rules
*
* @default false
*/
experimental?: boolean;
}
//#endregion
//#region dts/configs.d.ts
declare function customize(options?: StylisticCustomizeOptions): Linter.Config;
declare const configs: {
/**
* Disable all legacy rules from `eslint`, `@typescript-eslint` and `eslint-plugin-react`
*
* This config works for both flat and legacy config format
*/
'disable-legacy': Linter.Config;
/**
* A factory function to customize the recommended config
*/
'customize': typeof customize;
/**
* The default recommended config in Flat Config Format
*/
'recommended': Linter.Config;
/**
* The default recommended config in Flat Config Format
*
* @deprecated use `recommended` instead.
*/
'recommended-flat': Linter.Config;
/**
* Enable all rules, in Flat Config Format
*/
'all': Linter.Config;
/**
* Enable all rules, in Flat Config Format
*
* @deprecated use `all` instead.
*/
'all-flat': Linter.Config;
};
type Configs = typeof configs;
//#endregion
//#region dts/rules.d.ts
type Rules = { [K in keyof UnprefixedRuleOptions]: Rule.RuleModule };
//#endregion
//#region dts/index.d.ts
declare const plugin: {
rules: Rules;
configs: ESLint.Plugin['configs'] & Configs;
};
//#endregion
export { type Configs, type RuleOptions, type Rules, type StylisticCustomizeOptions, type UnprefixedRuleOptions, plugin as default };
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Jesse Feng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"file":"crown.js","sources":["../../../src/icons/crown.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Crown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEuNTYyIDMuMjY2YS41LjUgMCAwIDEgLjg3NiAwTDE1LjM5IDguODdhMSAxIDAgMCAwIDEuNTE2LjI5NEwyMS4xODMgNS41YS41LjUgMCAwIDEgLjc5OC41MTlsLTIuODM0IDEwLjI0NmExIDEgMCAwIDEtLjk1Ni43MzRINS44MWExIDEgMCAwIDEtLjk1Ny0uNzM0TDIuMDIgNi4wMmEuNS41IDAgMCAxIC43OTgtLjUxOWw0LjI3NiAzLjY2NGExIDEgMCAwIDAgMS41MTYtLjI5NHoiIC8+CiAgPHBhdGggZD0iTTUgMjFoMTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/crown\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 Crown = createLucideIcon('Crown', [\n [\n 'path',\n {\n d: 'M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z',\n key: '1vdc57',\n },\n ],\n ['path', { d: 'M5 21h14', key: '11awu3' }],\n]);\n\nexport default Crown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"camera-off.js","sources":["../../../src/icons/camera-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CameraOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMiIgeDI9IjIyIiB5MT0iMiIgeTI9IjIyIiAvPgogIDxwYXRoIGQ9Ik03IDdINGEyIDIgMCAwIDAtMiAydjlhMiAyIDAgMCAwIDIgMmgxNiIgLz4KICA8cGF0aCBkPSJNOS41IDRoNUwxNyA3aDNhMiAyIDAgMCAxIDIgMnY3LjUiIC8+CiAgPHBhdGggZD0iTTE0LjEyMSAxNS4xMjFBMyAzIDAgMSAxIDkuODggMTAuODgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/camera-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CameraOff = createLucideIcon('CameraOff', [\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n ['path', { d: 'M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16', key: 'qmtpty' }],\n ['path', { d: 'M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5', key: '1ufyfc' }],\n ['path', { d: 'M14.121 15.121A3 3 0 1 1 9.88 10.88', key: '11zox6' }],\n]);\n\nexport default CameraOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACtE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"store.mjs","sources":["../../../../src/animation/optimized-appear/store.ts"],"sourcesContent":["export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map<AppearElementId, AppearStoreEntry>()\n\nexport const appearComplete = new Map<AppearElementId, IsComplete>()\n"],"names":[],"mappings":"AASO,MAAM,oBAAoB,GAAG,IAAI,GAAG;AAEpC,MAAM,cAAc,GAAG,IAAI,GAAG;;;;"}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/visually-hidden.tsx"],
"sourcesContent": ["export {\n VisuallyHidden,\n //\n Root,\n //\n VISUALLY_HIDDEN_STYLES,\n} from './visually-hidden';\nexport type { VisuallyHiddenProps } from './visually-hidden';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/\n\nconst VISUALLY_HIDDEN_STYLES = Object.freeze({\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n}) satisfies React.CSSProperties;\n\nconst NAME = 'VisuallyHidden';\n\ntype VisuallyHiddenElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface VisuallyHiddenProps extends PrimitiveSpanProps {}\n\nconst VisuallyHidden = React.forwardRef<VisuallyHiddenElement, VisuallyHiddenProps>(\n (props, forwardedRef) => {\n return (\n <Primitive.span\n {...props}\n ref={forwardedRef}\n style={{ ...VISUALLY_HIDDEN_STYLES, ...props.style }}\n />\n );\n }\n);\n\nVisuallyHidden.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = VisuallyHidden;\n\nexport {\n VisuallyHidden,\n //\n Root,\n //\n VISUALLY_HIDDEN_STYLES,\n};\nexport type { VisuallyHiddenProps };\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AA6BpB;AAvBN,IAAM,yBAAyB,OAAO,OAAO;AAAA;AAAA,EAE3C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AACZ,CAAC;AAED,IAAM,OAAO;AAMb,IAAM,iBAAuB;AAAA,EAC3B,CAAC,OAAO,iBAAiB;AACvB,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,OAAO,EAAE,GAAG,wBAAwB,GAAG,MAAM,MAAM;AAAA;AAAA,IACrD;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAI7B,IAAM,OAAO;",
"names": []
}
@@ -0,0 +1,8 @@
// This file is a shim which defers loading the real module until the compile cache is enabled.
try {
const { enableCompileCache } = require("node:module");
if (enableCompileCache) {
enableCompileCache();
}
} catch {}
module.exports = require("./_tsc.js");
@@ -0,0 +1,158 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-unsafe-type-assertion',
meta: {
type: 'problem',
docs: {
description: 'Disallow type assertions that narrow a type',
requiresTypeChecking: true,
},
messages: {
unsafeOfAnyTypeAssertion: 'Unsafe assertion from {{type}} detected: consider using type guards or a safer assertion.',
unsafeToAnyTypeAssertion: 'Unsafe assertion to {{type}} detected: consider using a more specific type to ensure safety.',
unsafeToUnconstrainedTypeAssertion: "Unsafe type assertion: '{{type}}' could be instantiated with an arbitrary type which could be unrelated to the original type.",
unsafeTypeAssertion: "Unsafe type assertion: type '{{type}}' is more narrow than the original type.",
unsafeTypeAssertionAssignableToConstraint: "Unsafe type assertion: the original type is assignable to the constraint of type '{{type}}', but '{{type}}' could be instantiated with a different subtype of its constraint.",
},
schema: [],
},
defaultOptions: [],
create(context) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function getAnyTypeName(type) {
return tsutils.isIntrinsicErrorType(type) ? 'error typed' : '`any`';
}
function isObjectLiteralType(type) {
return (tsutils.isObjectType(type) &&
tsutils.isObjectFlagSet(type, ts.ObjectFlags.ObjectLiteral));
}
function checkExpression(node) {
const expressionType = services.getTypeAtLocation(node.expression);
const assertedType = services.getTypeAtLocation(node.typeAnnotation);
if (expressionType === assertedType) {
return;
}
// handle cases when asserting unknown ==> any.
if ((0, util_1.isTypeAnyType)(assertedType) && (0, util_1.isTypeUnknownType)(expressionType)) {
context.report({
node,
messageId: 'unsafeToAnyTypeAssertion',
data: {
type: '`any`',
},
});
return;
}
const unsafeExpressionAny = (0, util_1.isUnsafeAssignment)(expressionType, assertedType, checker, node.expression);
if (unsafeExpressionAny) {
context.report({
node,
messageId: 'unsafeOfAnyTypeAssertion',
data: {
type: getAnyTypeName(unsafeExpressionAny.sender),
},
});
return;
}
const unsafeAssertedAny = (0, util_1.isUnsafeAssignment)(assertedType, expressionType, checker, node.typeAnnotation);
if (unsafeAssertedAny) {
context.report({
node,
messageId: 'unsafeToAnyTypeAssertion',
data: {
type: getAnyTypeName(unsafeAssertedAny.sender),
},
});
return;
}
// Use the widened type in case of an object literal so `isTypeAssignableTo()`
// won't fail on excess property check.
const expressionWidenedType = isObjectLiteralType(expressionType)
? checker.getWidenedType(expressionType)
: expressionType;
const isAssertionSafe = checker.isTypeAssignableTo(expressionWidenedType, assertedType);
if (isAssertionSafe) {
return;
}
// Produce a more specific error message when targeting a type parameter
if (tsutils.isTypeParameter(assertedType)) {
const assertedTypeConstraint = checker.getBaseConstraintOfType(assertedType);
if (!assertedTypeConstraint) {
// asserting to an unconstrained type parameter is unsafe
context.report({
node,
messageId: 'unsafeToUnconstrainedTypeAssertion',
data: {
type: checker.typeToString(assertedType),
},
});
return;
}
// special case message if the original type is assignable to the
// constraint of the target type parameter
const isAssignableToConstraint = checker.isTypeAssignableTo(expressionWidenedType, assertedTypeConstraint);
if (isAssignableToConstraint) {
context.report({
node,
messageId: 'unsafeTypeAssertionAssignableToConstraint',
data: {
type: checker.typeToString(assertedType),
},
});
return;
}
}
// General error message
context.report({
node,
messageId: 'unsafeTypeAssertion',
data: {
type: checker.typeToString(assertedType),
},
});
}
return {
'TSAsExpression, TSTypeAssertion'(node) {
checkExpression(node);
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"}
@@ -0,0 +1,31 @@
import { ConsoleAppender, basicLogPrefix } from "base-log-factory";
import pc from "picocolors";
import { colors } from "./colors.mjs";
class ColorfulAppender extends ConsoleAppender {
/**
* Constructor (构造函数)
*/
constructor(opts = {}) {
super(opts.layout);
this.name = "colorful";
this.colors = opts.colors || colors;
}
/**
* Write log (写入日志)
* @param event Log event (日志事件)
*/
write(event) {
const { layout } = this;
if (layout) {
console.log(this.color(layout.format(event), event));
} else {
console.log(this.color(basicLogPrefix(event, this.dateFormat), event), ...event.message);
}
}
color(str, event) {
return pc[this.colors[event.level]](str);
}
}
export {
ColorfulAppender
};
@@ -0,0 +1,97 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_http_exception = require("../../http-exception.js");
const require_utils_buffer = require("../../utils/buffer.js");
//#region src/middleware/bearer-auth/index.ts
const TOKEN_STRINGS = "[A-Za-z0-9._~+/-]+=*";
const PREFIX = "Bearer";
const HEADER = "Authorization";
/**
* Bearer Auth Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/bearer-auth}
*
* @template E - The environment type.
* @param {BearerAuthOptions} options - The options for the bearer authentication middleware.
* @param {string | string[]} [options.token] - The string or array of strings to validate the incoming bearer token against.
* @param {Function} [options.verifyToken] - The function to verify the token.
* @param {string} [options.realm=""] - The domain name of the realm, as part of the returned WWW-Authenticate challenge header.
* @param {string} [options.prefix="Bearer"] - The prefix (or known as `schema`) for the Authorization header value. If set to the empty string, no prefix is expected.
* @param {string} [options.headerName=Authorization] - The header name.
* @param {Function} [options.hashFunction] - A function to handle hashing for safe comparison of authentication tokens.
* @param {string | object | MessageFunction} [options.noAuthenticationHeader.message="Unauthorized"] - The no authentication header message.
* @param {string | object | MessageFunction} [options.noAuthenticationHeader.wwwAuthenticateHeader="Bearer realm=\"\""] - The response header value for the WWW-Authenticate header when no authentication header is provided.
* @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.message="Bad Request"] - The invalid authentication header message.
* @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.wwwAuthenticateHeader="Bearer error=\"invalid_request\""] - The response header value for the WWW-Authenticate header when authentication header is invalid.
* @param {string | object | MessageFunction} [options.invalidToken.message="Unauthorized"] - The invalid token message.
* @param {string | object | MessageFunction} [options.invalidToken.wwwAuthenticateHeader="Bearer error=\"invalid_token\""] - The response header value for the WWW-Authenticate header when token is invalid.
* @returns {MiddlewareHandler<E>} The middleware handler function.
* @throws {Error} If neither "token" nor "verifyToken" options are provided.
* @throws {HTTPException} If authentication fails, with 401 status code for missing or invalid token, or 400 status code for invalid request.
*
* @example
* ```ts
* const app = new Hono()
*
* const token = 'honoishot'
*
* app.use('/api/*', bearerAuth({ token }))
*
* app.get('/api/page', (c) => {
* return c.json({ message: 'You are authorized' })
* })
* ```
*/
const bearerAuth = (options) => {
if (!("token" in options || "verifyToken" in options)) throw new Error("bearer auth middleware requires options for \"token\" or \"verifyToken\"");
if (!options.realm) options.realm = "";
if (options.prefix === void 0) options.prefix = PREFIX;
const realm = options.realm?.replace(/"/g, "\\\"");
const prefix = options.prefix;
const tokenRegexp = new RegExp(`^${TOKEN_STRINGS}$`);
const wwwAuthenticatePrefix = prefix === "" ? "" : `${prefix} `;
const throwHTTPException = async (c, status, wwwAuthenticateHeader, messageOption) => {
const wwwAuthenticateHeaderValue = typeof wwwAuthenticateHeader === "function" ? await wwwAuthenticateHeader(c) : wwwAuthenticateHeader;
const headers = { "WWW-Authenticate": typeof wwwAuthenticateHeaderValue === "string" ? wwwAuthenticateHeaderValue : `${wwwAuthenticatePrefix}${Object.entries(wwwAuthenticateHeaderValue).map(([key, value]) => `${key}="${value}"`).join(",")}` };
const responseMessage = typeof messageOption === "function" ? await messageOption(c) : messageOption;
const res = typeof responseMessage === "string" ? new Response(responseMessage, {
status,
headers
}) : new Response(JSON.stringify(responseMessage), {
status,
headers: {
...headers,
"content-type": "application/json"
}
});
throw new require_http_exception.HTTPException(status, { res });
};
return async function bearerAuth(c, next) {
const headerToken = c.req.header(options.headerName || HEADER);
if (!headerToken) await throwHTTPException(c, 401, options.noAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}realm="${realm}"`, options.noAuthenticationHeader?.message || options.noAuthenticationHeaderMessage || "Unauthorized");
else {
let tokenValue;
if (prefix === "") tokenValue = headerToken;
else {
const headerLower = headerToken.toLowerCase();
const prefixLower = prefix.toLowerCase();
if (headerLower.startsWith(prefixLower) && headerToken[prefix.length] === " ") tokenValue = headerToken.slice(prefix.length).trimStart();
}
if (!tokenValue || !tokenRegexp.test(tokenValue)) await throwHTTPException(c, 400, options.invalidAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_request"`, options.invalidAuthenticationHeader?.message || options.invalidAuthenticationHeaderMessage || "Bad Request");
else {
let equal = false;
if ("verifyToken" in options) equal = await options.verifyToken(tokenValue, c);
else if (typeof options.token === "string") equal = await require_utils_buffer.timingSafeEqual(options.token, tokenValue, options.hashFunction);
else if (Array.isArray(options.token) && options.token.length > 0) {
for (const token of options.token) if (await require_utils_buffer.timingSafeEqual(token, tokenValue, options.hashFunction)) {
equal = true;
break;
}
}
if (!equal) await throwHTTPException(c, 401, options.invalidToken?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_token"`, options.invalidToken?.message || options.invalidTokenMessage || "Unauthorized");
}
}
await next();
};
};
//#endregion
exports.bearerAuth = bearerAuth;
@@ -0,0 +1 @@
{"version":3,"file":"circle-dashed.js","sources":["../../../src/icons/circle-dashed.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleDashed\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAuMSAyLjE4MmExMCAxMCAwIDAgMSAzLjggMCIgLz4KICA8cGF0aCBkPSJNMTMuOSAyMS44MThhMTAgMTAgMCAwIDEtMy44IDAiIC8+CiAgPHBhdGggZD0iTTE3LjYwOSAzLjcyMWExMCAxMCAwIDAgMSAyLjY5IDIuNyIgLz4KICA8cGF0aCBkPSJNMi4xODIgMTMuOWExMCAxMCAwIDAgMSAwLTMuOCIgLz4KICA8cGF0aCBkPSJNMjAuMjc5IDE3LjYwOWExMCAxMCAwIDAgMS0yLjcgMi42OSIgLz4KICA8cGF0aCBkPSJNMjEuODE4IDEwLjFhMTAgMTAgMCAwIDEgMCAzLjgiIC8+CiAgPHBhdGggZD0iTTMuNzIxIDYuMzkxYTEwIDEwIDAgMCAxIDIuNy0yLjY5IiAvPgogIDxwYXRoIGQ9Ik02LjM5MSAyMC4yNzlhMTAgMTAgMCAwIDEtMi42OS0yLjciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-dashed\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 CircleDashed = createLucideIcon('CircleDashed', [\n ['path', { d: 'M10.1 2.182a10 10 0 0 1 3.8 0', key: '5ilxe3' }],\n ['path', { d: 'M13.9 21.818a10 10 0 0 1-3.8 0', key: '11zvb9' }],\n ['path', { d: 'M17.609 3.721a10 10 0 0 1 2.69 2.7', key: '1iw5b2' }],\n ['path', { d: 'M2.182 13.9a10 10 0 0 1 0-3.8', key: 'c0bmvh' }],\n ['path', { d: 'M20.279 17.609a10 10 0 0 1-2.7 2.69', key: '1ruxm7' }],\n ['path', { d: 'M21.818 10.1a10 10 0 0 1 0 3.8', key: 'qkgqxc' }],\n ['path', { d: 'M3.721 6.391a10 10 0 0 1 2.7-2.69', key: '1mcia2' }],\n ['path', { d: 'M6.391 20.279a10 10 0 0 1-2.69-2.7', key: '1fvljs' }],\n]);\n\nexport default CircleDashed;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
{"version":3,"file":"types-DsbMXNFL.d.cts","names":["draft","$schema","MaybeReadonlyArray","T","Array","ReadonlyArray","ValueOf","JSONSchema","Value","SchemaType","Record","TypeValue","TypeName","Exclude","Interface","KeywordByType","Any","Pick","Number","Object","String","ContentEncoding","Format","keywords"],"sources":["../../../node_modules/.pnpm/json-schema-typed@8.0.2/node_modules/json-schema-typed/draft_2020_12.d.ts","../../core-internal/src/validators/types.ts"],"sourcesContent":["export declare const draft: \"2020-12\";\r\nexport declare const $schema: \"https://json-schema.org/draft/2020-12/schema\";\r\ntype MaybeReadonlyArray<T> = Array<T> | ReadonlyArray<T>;\r\ntype ValueOf<T> = T[keyof T];\r\n/**\r\n * JSON Schema [Draft 2020-12](https://json-schema.org/draft/2020-12/json-schema-validation.html)\r\n */\r\nexport type JSONSchema<Value = any, SchemaType = Value extends boolean ? \"boolean\" : Value extends null ? \"null\" : Value extends number ? \"number\" | \"integer\" : Value extends string ? \"string\" : Value extends unknown[] ? \"array\" : Value extends Record<string | number, unknown> ? \"object\" : JSONSchema.TypeValue> = boolean | {\r\n /**\r\n * Using JSON Pointer fragments requires knowledge of the structure of the\r\n * schema. When writing schema documents with the intention to provide\r\n * re-usable schemas, it may be preferable to use a plain name fragment\r\n * that is not tied to any particular structural location. This allows a\r\n * subschema to be relocated without requiring JSON Pointer references to\r\n * be updated.\r\n *\r\n * The `$anchor` keyword is used to specify such a fragment. It is an\r\n * identifier keyword that can only be used to create plain name fragments.\r\n *\r\n * If present, the value of this keyword MUST be a string, which MUST start\r\n * with a letter `[A-Za-z]`, followed by any number of letters, digits\r\n * `[0-9]`, hyphens `-`, underscores `_`, colons `:`,\r\n * or periods `.`.\r\n *\r\n * Note that the anchor string does not include the `#` character,\r\n * as it is not a URI-reference. An `{\"$anchor\": \"foo\"}` becomes the\r\n * fragment `#foo` when used in a URI.\r\n *\r\n * The base URI to which the resulting fragment is appended is determined\r\n * by the `$id` keyword as explained in the previous section.\r\n * Two `$anchor` keywords in the same schema document MAY have the same\r\n * value if they apply to different base URIs, as the resulting full URIs\r\n * will be distinct. However, the effect of two `$anchor` keywords\r\n * with the same value and the same base URI is undefined. Implementations\r\n * MAY raise an error if such usage is detected.\r\n */\r\n $anchor?: string;\r\n /**\r\n * This keyword reserves a location for comments from schema authors to\r\n * readers or maintainers of the schema.\r\n *\r\n * The value of this keyword MUST be a string. Implementations MUST NOT\r\n * present this string to end users. Tools for editing schemas SHOULD\r\n * support displaying and editing this keyword. The value of this keyword\r\n * MAY be used in debug or error output which is intended for developers\r\n * making use of schemas.\r\n *\r\n * Schema vocabularies SHOULD allow `$comment` within any object\r\n * containing vocabulary keywords. Implementations MAY assume `$comment`\r\n * is allowed unless the vocabulary specifically forbids it. Vocabularies\r\n * MUST NOT specify any effect of `$comment` beyond what is described in\r\n * this specification.\r\n *\r\n * Tools that translate other media types or programming languages\r\n * to and from `application/schema+json` MAY choose to convert that media\r\n * type or programming language's native comments to or from `$comment`\r\n * values. The behavior of such translation when both native comments and\r\n * `$comment` properties are present is implementation-dependent.\r\n *\r\n * Implementations MAY strip `$comment` values at any point during\r\n * processing. In particular, this allows for shortening schemas when the\r\n * size of deployed schemas is a concern.\r\n *\r\n * Implementations MUST NOT take any other action based on the presence,\r\n * absence, or contents of `$comment` properties. In particular, the\r\n * value of `$comment` MUST NOT be collected as an annotation result.\r\n */\r\n $comment?: string;\r\n /**\r\n * The `$defs` keyword reserves a location for schema authors to inline\r\n * re-usable JSON Schemas into a more general schema. The keyword does not\r\n * directly affect the validation result.\r\n *\r\n * This keyword's value MUST be an object. Each member value of this object\r\n * MUST be a valid JSON Schema.\r\n */\r\n $defs?: Record<string, JSONSchema>;\r\n /**\r\n * \"The `$dLine truncated
@@ -0,0 +1,20 @@
/**
* @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 AlarmClockOff = createLucideIcon("AlarmClockOff", [
["path", { d: "M6.87 6.87a8 8 0 1 0 11.26 11.26", key: "3on8tj" }],
["path", { d: "M19.9 14.25a8 8 0 0 0-9.15-9.15", key: "15ghsc" }],
["path", { d: "m22 6-3-3", key: "1opdir" }],
["path", { d: "M6.26 18.67 4 21", key: "yzmioq" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M4 4 2 6", key: "1ycko6" }]
]);
export { AlarmClockOff as default };
//# sourceMappingURL=alarm-clock-off.js.map
@@ -0,0 +1 @@
{"version":3,"file":"message-circle-dashed.js","sources":["../../../src/icons/message-circle-dashed.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageCircleDashed\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuNSAzLjFjLS41IDAtMS0uMS0xLjUtLjFzLTEgLjEtMS41LjEiIC8+CiAgPHBhdGggZD0iTTE5LjMgNi44YTEwLjQ1IDEwLjQ1IDAgMCAwLTIuMS0yLjEiIC8+CiAgPHBhdGggZD0iTTIwLjkgMTMuNWMuMS0uNS4xLTEgLjEtMS41cy0uMS0xLS4xLTEuNSIgLz4KICA8cGF0aCBkPSJNMTcuMiAxOS4zYTEwLjQ1IDEwLjQ1IDAgMCAwIDIuMS0yLjEiIC8+CiAgPHBhdGggZD0iTTEwLjUgMjAuOWMuNS4xIDEgLjEgMS41LjFzMS0uMSAxLjUtLjEiIC8+CiAgPHBhdGggZD0iTTMuNSAxNy41IDIgMjJsNC41LTEuNSIgLz4KICA8cGF0aCBkPSJNMy4xIDEwLjVjMCAuNS0uMSAxLS4xIDEuNXMuMSAxIC4xIDEuNSIgLz4KICA8cGF0aCBkPSJNNi44IDQuN2ExMC40NSAxMC40NSAwIDAgMC0yLjEgMi4xIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/message-circle-dashed\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 MessageCircleDashed = createLucideIcon('MessageCircleDashed', [\n ['path', { d: 'M13.5 3.1c-.5 0-1-.1-1.5-.1s-1 .1-1.5.1', key: '16ll65' }],\n ['path', { d: 'M19.3 6.8a10.45 10.45 0 0 0-2.1-2.1', key: '1nq77a' }],\n ['path', { d: 'M20.9 13.5c.1-.5.1-1 .1-1.5s-.1-1-.1-1.5', key: '1sf7wn' }],\n ['path', { d: 'M17.2 19.3a10.45 10.45 0 0 0 2.1-2.1', key: 'x1hs5g' }],\n ['path', { d: 'M10.5 20.9c.5.1 1 .1 1.5.1s1-.1 1.5-.1', key: '19m18z' }],\n ['path', { d: 'M3.5 17.5 2 22l4.5-1.5', key: '1f36qi' }],\n ['path', { d: 'M3.1 10.5c0 .5-.1 1-.1 1.5s.1 1 .1 1.5', key: '1vz3ju' }],\n ['path', { d: 'M6.8 4.7a10.45 10.45 0 0 0-2.1 2.1', key: '19f9do' }],\n]);\n\nexport default MessageCircleDashed;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
{"version":3,"file":"memo.mjs","sources":["../../src/memo.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport function memo<T extends any>(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n"],"names":[],"mappings":"AAAA;AACM,SAAU,IAAI,CAAgB,QAAiB,EAAA;AACjD,IAAA,IAAI,MAAqB;AAEzB,IAAA,OAAO,MAAK;QACR,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,GAAG,QAAQ,EAAE;AAC7C,QAAA,OAAO,MAAM;AACjB,IAAA,CAAC;AACL;;;;"}
@@ -0,0 +1,80 @@
'use strict';
module.exports = function generate__limitItems(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $errorKeyword;
var $data = 'data' + ($dataLvl || '');
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
if (!($isData || typeof $schema == 'number')) {
throw new Error($keyword + ' must be number');
}
var $op = $keyword == 'maxItems' ? '>' : '<';
out += 'if ( ';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
}
out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';
var $errorKeyword = $keyword;
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should NOT have ';
if ($keyword == 'maxItems') {
out += 'more';
} else {
out += 'fewer';
}
out += ' than ';
if ($isData) {
out += '\' + ' + ($schemaValue) + ' + \'';
} else {
out += '' + ($schema);
}
out += ' items\' ';
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + ($schema);
}
out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += '} ';
if ($breakOnError) {
out += ' else { ';
}
return out;
}
@@ -0,0 +1,18 @@
/**
* @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 SmartphoneNfc = createLucideIcon("SmartphoneNfc", [
["rect", { width: "7", height: "12", x: "2", y: "6", rx: "1", key: "5nje8w" }],
["path", { d: "M13 8.32a7.43 7.43 0 0 1 0 7.36", key: "1g306n" }],
["path", { d: "M16.46 6.21a11.76 11.76 0 0 1 0 11.58", key: "uqvjvo" }],
["path", { d: "M19.91 4.1a15.91 15.91 0 0 1 .01 15.8", key: "ujntz3" }]
]);
export { SmartphoneNfc as default };
//# sourceMappingURL=smartphone-nfc.js.map
@@ -0,0 +1,53 @@
import type {ErrorNoParams, Vocabulary} from "../../types"
import additionalItems, {AdditionalItemsError} from "./additionalItems"
import prefixItems from "./prefixItems"
import items from "./items"
import items2020, {ItemsError} from "./items2020"
import contains, {ContainsError} from "./contains"
import dependencies, {DependenciesError} from "./dependencies"
import propertyNames, {PropertyNamesError} from "./propertyNames"
import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties"
import properties from "./properties"
import patternProperties from "./patternProperties"
import notKeyword, {NotKeywordError} from "./not"
import anyOf, {AnyOfError} from "./anyOf"
import oneOf, {OneOfError} from "./oneOf"
import allOf from "./allOf"
import ifKeyword, {IfKeywordError} from "./if"
import thenElse from "./thenElse"
export default function getApplicator(draft2020 = false): Vocabulary {
const applicator = [
// any
notKeyword,
anyOf,
oneOf,
allOf,
ifKeyword,
thenElse,
// object
propertyNames,
additionalProperties,
dependencies,
properties,
patternProperties,
]
// array
if (draft2020) applicator.push(prefixItems, items2020)
else applicator.push(additionalItems, items)
applicator.push(contains)
return applicator
}
export type ApplicatorKeywordError =
| ErrorNoParams<"false schema">
| AdditionalItemsError
| ItemsError
| ContainsError
| AdditionalPropertiesError
| DependenciesError
| IfKeywordError
| AnyOfError
| OneOfError
| NotKeywordError
| PropertyNamesError
@@ -0,0 +1,90 @@
/*
Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @import * as types from "eslint-scope" */
/** @import Reference from "./reference.js" */
/**
* A Variable represents a locally scoped identifier. These include arguments to
* functions.
* @constructor Variable
* @implements {types.Variable}
*/
class Variable {
constructor(name, scope) {
/**
* The variable name, as given in the source code.
* @member {string} Variable#name
*/
this.name = name;
/**
* List of defining occurrences of this variable (like in 'var ...'
* statements or as parameter), as AST nodes.
* @member {espree.Identifier[]} Variable#identifiers
*/
this.identifiers = [];
/**
* List of {@link Reference|references} of this variable (excluding parameter entries)
* in its defining scope and all nested scopes. For defining
* occurrences only see {@link Variable#defs}.
* @member {Reference[]} Variable#references
*/
this.references = [];
/**
* List of defining occurrences of this variable (like in 'var ...'
* statements or as parameter), as custom objects.
* @member {Definition[]} Variable#defs
*/
this.defs = [];
this.tainted = false;
/**
* Whether this is a stack variable.
* @member {boolean} Variable#stack
*/
this.stack = true;
/**
* Reference to the enclosing Scope.
* @member {Scope} Variable#scope
*/
this.scope = scope;
}
}
Variable.CatchClause = "CatchClause";
Variable.Parameter = "Parameter";
Variable.FunctionName = "FunctionName";
Variable.ClassName = "ClassName";
Variable.Variable = "Variable";
Variable.ImportBinding = "ImportBinding";
Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";
export default Variable;
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1,117 @@
export const xmlReplacer = /["$&'<>\u0080-\uFFFF]/g;
const xmlCodeMap = new Map([
[34, "&quot;"],
[38, "&amp;"],
[39, "&apos;"],
[60, "&lt;"],
[62, "&gt;"],
]);
// For compatibility with node < 4, we wrap `codePointAt`
export const getCodePoint =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
String.prototype.codePointAt == null
? (c, index) => (c.charCodeAt(index) & 64512) === 55296
? (c.charCodeAt(index) - 55296) * 1024 +
c.charCodeAt(index + 1) -
56320 +
65536
: c.charCodeAt(index)
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
(input, index) => input.codePointAt(index);
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using XML entities.
*
* If a character has no equivalent entity, a
* numeric hexadecimal reference (eg. `&#xfc;`) will be used.
*/
export function encodeXML(input) {
let returnValue = "";
let lastIndex = 0;
let match;
while ((match = xmlReplacer.exec(input)) !== null) {
const { index } = match;
const char = input.charCodeAt(index);
const next = xmlCodeMap.get(char);
if (next === undefined) {
returnValue += `${input.substring(lastIndex, index)}&#x${getCodePoint(input, index).toString(16)};`;
// Increase by 1 if we have a surrogate pair
lastIndex = xmlReplacer.lastIndex += Number((char & 64512) === 55296);
}
else {
returnValue += input.substring(lastIndex, index) + next;
lastIndex = index + 1;
}
}
return returnValue + input.substr(lastIndex);
}
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using numeric hexadecimal reference (eg. `&#xfc;`).
*
* Have a look at `escapeUTF8` if you want a more concise output at the expense
* of reduced transportability.
*
* @param data String to escape.
*/
export const escape = encodeXML;
/**
* Creates a function that escapes all characters matched by the given regular
* expression using the given map of characters to escape to their entities.
*
* @param regex Regular expression to match characters to escape.
* @param map Map of characters to escape to their entities.
*
* @returns Function that escapes all characters matched by the given regular
* expression using the given map of characters to escape to their entities.
*/
function getEscaper(regex, map) {
return function escape(data) {
let match;
let lastIndex = 0;
let result = "";
while ((match = regex.exec(data))) {
if (lastIndex !== match.index) {
result += data.substring(lastIndex, match.index);
}
// We know that this character will be in the map.
result += map.get(match[0].charCodeAt(0));
// Every match will be of length 1
lastIndex = match.index + 1;
}
return result + data.substring(lastIndex);
};
}
/**
* Encodes all characters not valid in XML documents using XML entities.
*
* Note that the output will be character-set dependent.
*
* @param data String to escape.
*/
export const escapeUTF8 = /* #__PURE__ */ getEscaper(/["&'<>]/g, xmlCodeMap);
/**
* Encodes all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
export const escapeAttribute =
/* #__PURE__ */ getEscaper(/["&\u00A0]/g, new Map([
[34, "&quot;"],
[38, "&amp;"],
[160, "&nbsp;"],
]));
/**
* Encodes all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
export const escapeText = /* #__PURE__ */ getEscaper(/[&<>\u00A0]/g, new Map([
[38, "&amp;"],
[60, "&lt;"],
[62, "&gt;"],
[160, "&nbsp;"],
]));
//# sourceMappingURL=escape.js.map
@@ -0,0 +1,444 @@
import { AnySchema, AnyObjectSchema, SchemaOutput } from '../server/zod-compat.js';
import { ClientCapabilities, GetTaskRequest, GetTaskPayloadRequest, ListTasksResultSchema, CancelTaskResultSchema, JSONRPCRequest, Progress, RequestId, Result, ServerCapabilities, RequestMeta, RequestInfo, GetTaskResult, TaskCreationParams, RelatedTaskMetadata, Task, Request, Notification } from '../types.js';
import { Transport, TransportSendOptions } from './transport.js';
import { AuthInfo } from '../server/auth/types.js';
import { TaskStore, TaskMessageQueue, CreateTaskOptions } from '../experimental/tasks/interfaces.js';
import { ResponseMessage } from './responseMessage.js';
/**
* Callback for progress notifications.
*/
export type ProgressCallback = (progress: Progress) => void;
/**
* Additional initialization options.
*/
export type ProtocolOptions = {
/**
* Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
*
* Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
*
* Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true.
*/
enforceStrictCapabilities?: boolean;
/**
* An array of notification method names that should be automatically debounced.
* Any notifications with a method in this list will be coalesced if they
* occur in the same tick of the event loop.
* e.g., ['notifications/tools/list_changed']
*/
debouncedNotificationMethods?: string[];
/**
* Optional task storage implementation. If provided, enables task-related request handlers
* and provides task storage capabilities to request handlers.
*/
taskStore?: TaskStore;
/**
* Optional task message queue implementation for managing server-initiated messages
* that will be delivered through the tasks/result response stream.
*/
taskMessageQueue?: TaskMessageQueue;
/**
* Default polling interval (in milliseconds) for task status checks when no pollInterval
* is provided by the server. Defaults to 5000ms if not specified.
*/
defaultTaskPollInterval?: number;
/**
* Maximum number of messages that can be queued per task for side-channel delivery.
* If undefined, the queue size is unbounded.
* When the limit is exceeded, the TaskMessageQueue implementation's enqueue() method
* will throw an error. It's the implementation's responsibility to handle overflow
* appropriately (e.g., by failing the task, dropping messages, etc.).
*/
maxTaskQueueSize?: number;
};
/**
* The default request timeout, in miliseconds.
*/
export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
/**
* Options that can be given per request.
*/
export type RequestOptions = {
/**
* If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
*
* For task-augmented requests: progress notifications continue after CreateTaskResult is returned and stop automatically when the task reaches a terminal status.
*/
onprogress?: ProgressCallback;
/**
* Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request().
*/
signal?: AbortSignal;
/**
* A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request().
*
* If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout.
*/
timeout?: number;
/**
* If true, receiving a progress notification will reset the request timeout.
* This is useful for long-running operations that send periodic progress updates.
* Default: false
*/
resetTimeoutOnProgress?: boolean;
/**
* Maximum total time (in milliseconds) to wait for a response.
* If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications.
* If not specified, there is no maximum total timeout.
*/
maxTotalTimeout?: number;
/**
* If provided, augments the request with task creation parameters to enable call-now, fetch-later execution patterns.
*/
task?: TaskCreationParams;
/**
* If provided, associates this request with a related task.
*/
relatedTask?: RelatedTaskMetadata;
} & TransportSendOptions;
/**
* Options that can be given per notification.
*/
export type NotificationOptions = {
/**
* May be used to indicate to the transport which incoming request to associate this outgoing notification with.
*/
relatedRequestId?: RequestId;
/**
* If provided, associates this notification with a related task.
*/
relatedTask?: RelatedTaskMetadata;
};
/**
* Options that can be given per request.
*/
export type TaskRequestOptions = Omit<RequestOptions, 'relatedTask'>;
/**
* Request-scoped TaskStore interface.
*/
export interface RequestTaskStore {
/**
* Creates a new task with the given creation parameters.
* The implementation generates a unique taskId and createdAt timestamp.
*
* @param taskParams - The task creation parameters from the request
* @returns The created task object
*/
createTask(taskParams: CreateTaskOptions): Promise<Task>;
/**
* Gets the current status of a task.
*
* @param taskId - The task identifier
* @returns The task object
* @throws If the task does not exist
*/
getTask(taskId: string): Promise<Task>;
/**
* Stores the result of a task and sets its final status.
*
* @param taskId - The task identifier
* @param status - The final status: 'completed' for success, 'failed' for errors
* @param result - The result to store
*/
storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result): Promise<void>;
/**
* Retrieves the stored result of a task.
*
* @param taskId - The task identifier
* @returns The stored result
*/
getTaskResult(taskId: string): Promise<Result>;
/**
* Updates a task's status (e.g., to 'cancelled', 'failed', 'completed').
*
* @param taskId - The task identifier
* @param status - The new status
* @param statusMessage - Optional diagnostic message for failed tasks or other status information
*/
updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string): Promise<void>;
/**
* Lists tasks, optionally starting from a pagination cursor.
*
* @param cursor - Optional cursor for pagination
* @returns An object containing the tasks array and an optional nextCursor
*/
listTasks(cursor?: string): Promise<{
tasks: Task[];
nextCursor?: string;
}>;
}
/**
* Extra data given to request handlers.
*/
export type RequestHandlerExtra<SendRequestT extends Request, SendNotificationT extends Notification> = {
/**
* An abort signal used to communicate if the request was cancelled from the sender's side.
*/
signal: AbortSignal;
/**
* Information about a validated access token, provided to request handlers.
*/
authInfo?: AuthInfo;
/**
* The session ID from the transport, if available.
*/
sessionId?: string;
/**
* Metadata from the original request.
*/
_meta?: RequestMeta;
/**
* The JSON-RPC ID of the request being handled.
* This can be useful for tracking or logging purposes.
*/
requestId: RequestId;
taskId?: string;
taskStore?: RequestTaskStore;
taskRequestedTtl?: number;
/**
* The original HTTP request.
*/
requestInfo?: RequestInfo;
/**
* Sends a notification that relates to the current request being handled.
*
* This is used by certain transports to correctly associate related messages.
*/
sendNotification: (notification: SendNotificationT) => Promise<void>;
/**
* Sends a request that relates to the current request being handled.
*
* This is used by certain transports to correctly associate related messages.
*/
sendRequest: <U extends AnySchema>(request: SendRequestT, resultSchema: U, options?: TaskRequestOptions) => Promise<SchemaOutput<U>>;
/**
* Closes the SSE stream for this request, triggering client reconnection.
* Only available when using StreamableHTTPServerTransport with eventStore configured.
* Use this to implement polling behavior during long-running operations.
*/
closeSSEStream?: () => void;
/**
* Closes the standalone GET SSE stream, triggering client reconnection.
* Only available when using StreamableHTTPServerTransport with eventStore configured.
* Use this to implement polling behavior for server-initiated notifications.
*/
closeStandaloneSSEStream?: () => void;
};
/**
* Implements MCP protocol framing on top of a pluggable transport, including
* features like request/response linking, notifications, and progress.
*/
export declare abstract class Protocol<SendRequestT extends Request, SendNotificationT extends Notification, SendResultT extends Result> {
private _options?;
private _transport?;
private _requestMessageId;
private _requestHandlers;
private _requestHandlerAbortControllers;
private _notificationHandlers;
private _responseHandlers;
private _progressHandlers;
private _timeoutInfo;
private _pendingDebouncedNotifications;
private _taskProgressTokens;
private _taskStore?;
private _taskMessageQueue?;
private _requestResolvers;
/**
* Callback for when the connection is closed for any reason.
*
* This is invoked when close() is called as well.
*/
onclose?: () => void;
/**
* Callback for when an error occurs.
*
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
*/
onerror?: (error: Error) => void;
/**
* A handler to invoke for any request types that do not have their own handler installed.
*/
fallbackRequestHandler?: (request: JSONRPCRequest, extra: RequestHandlerExtra<SendRequestT, SendNotificationT>) => Promise<SendResultT>;
/**
* A handler to invoke for any notification types that do not have their own handler installed.
*/
fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
constructor(_options?: ProtocolOptions | undefined);
private _oncancel;
private _setupTimeout;
private _resetTimeout;
private _cleanupTimeout;
/**
* Attaches to the given transport, starts it, and starts listening for messages.
*
* The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
*/
connect(transport: Transport): Promise<void>;
private _onclose;
private _onerror;
private _onnotification;
private _onrequest;
private _onprogress;
private _onresponse;
get transport(): Transport | undefined;
/**
* Closes the connection.
*/
close(): Promise<void>;
/**
* A method to check if a capability is supported by the remote side, for the given method to be called.
*
* This should be implemented by subclasses.
*/
protected abstract assertCapabilityForMethod(method: SendRequestT['method']): void;
/**
* A method to check if a notification is supported by the local side, for the given method to be sent.
*
* This should be implemented by subclasses.
*/
protected abstract assertNotificationCapability(method: SendNotificationT['method']): void;
/**
* A method to check if a request handler is supported by the local side, for the given method to be handled.
*
* This should be implemented by subclasses.
*/
protected abstract assertRequestHandlerCapability(method: string): void;
/**
* A method to check if task creation is supported for the given request method.
*
* This should be implemented by subclasses.
*/
protected abstract assertTaskCapability(method: string): void;
/**
* A method to check if task handler is supported by the local side, for the given method to be handled.
*
* This should be implemented by subclasses.
*/
protected abstract assertTaskHandlerCapability(method: string): void;
/**
* Sends a request and returns an AsyncGenerator that yields response messages.
* The generator is guaranteed to end with either a 'result' or 'error' message.
*
* @example
* ```typescript
* const stream = protocol.requestStream(request, resultSchema, options);
* for await (const message of stream) {
* switch (message.type) {
* case 'taskCreated':
* console.log('Task created:', message.task.taskId);
* break;
* case 'taskStatus':
* console.log('Task status:', message.task.status);
* break;
* case 'result':
* console.log('Final result:', message.result);
* break;
* case 'error':
* console.error('Error:', message.error);
* break;
* }
* }
* ```
*
* @experimental Use `client.experimental.tasks.requestStream()` to access this method.
*/
protected requestStream<T extends AnySchema>(request: SendRequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator<ResponseMessage<SchemaOutput<T>>, void, void>;
/**
* Sends a request and waits for a response.
*
* Do not use this method to emit notifications! Use notification() instead.
*/
request<T extends AnySchema>(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise<SchemaOutput<T>>;
/**
* Gets the current status of a task.
*
* @experimental Use `client.experimental.tasks.getTask()` to access this method.
*/
protected getTask(params: GetTaskRequest['params'], options?: RequestOptions): Promise<GetTaskResult>;
/**
* Retrieves the result of a completed task.
*
* @experimental Use `client.experimental.tasks.getTaskResult()` to access this method.
*/
protected getTaskResult<T extends AnySchema>(params: GetTaskPayloadRequest['params'], resultSchema: T, options?: RequestOptions): Promise<SchemaOutput<T>>;
/**
* Lists tasks, optionally starting from a pagination cursor.
*
* @experimental Use `client.experimental.tasks.listTasks()` to access this method.
*/
protected listTasks(params?: {
cursor?: string;
}, options?: RequestOptions): Promise<SchemaOutput<typeof ListTasksResultSchema>>;
/**
* Cancels a specific task.
*
* @experimental Use `client.experimental.tasks.cancelTask()` to access this method.
*/
protected cancelTask(params: {
taskId: string;
}, options?: RequestOptions): Promise<SchemaOutput<typeof CancelTaskResultSchema>>;
/**
* Emits a notification, which is a one-way message that does not expect a response.
*/
notification(notification: SendNotificationT, options?: NotificationOptions): Promise<void>;
/**
* Registers a handler to invoke when this protocol object receives a request with the given method.
*
* Note that this will replace any previous request handler for the same method.
*/
setRequestHandler<T extends AnyObjectSchema>(requestSchema: T, handler: (request: SchemaOutput<T>, extra: RequestHandlerExtra<SendRequestT, SendNotificationT>) => SendResultT | Promise<SendResultT>): void;
/**
* Removes the request handler for the given method.
*/
removeRequestHandler(method: string): void;
/**
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
*/
assertCanSetRequestHandler(method: string): void;
/**
* Registers a handler to invoke when this protocol object receives a notification with the given method.
*
* Note that this will replace any previous notification handler for the same method.
*/
setNotificationHandler<T extends AnyObjectSchema>(notificationSchema: T, handler: (notification: SchemaOutput<T>) => void | Promise<void>): void;
/**
* Removes the notification handler for the given method.
*/
removeNotificationHandler(method: string): void;
/**
* Cleans up the progress handler associated with a task.
* This should be called when a task reaches a terminal status.
*/
private _cleanupTaskProgressHandler;
/**
* Enqueues a task-related message for side-channel delivery via tasks/result.
* @param taskId The task ID to associate the message with
* @param message The message to enqueue
* @param sessionId Optional session ID for binding the operation to a specific session
* @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow)
*
* Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle
* the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer
* simply propagates the error.
*/
private _enqueueTaskMessage;
/**
* Clears the message queue for a task and rejects any pending request resolvers.
* @param taskId The task ID whose queue should be cleared
* @param sessionId Optional session ID for binding the operation to a specific session
*/
private _clearTaskQueue;
/**
* Waits for a task update (new messages or status change) with abort signal support.
* Uses polling to check for updates at the task's configured poll interval.
* @param taskId The task ID to wait for
* @param signal Abort signal to cancel the wait
* @param sessionId Session of the request that waits, passed to the task store
* @returns Promise that resolves when an update occurs or rejects if aborted
*/
private _waitForTaskUpdate;
private requestTaskStore;
}
export declare function mergeCapabilities(base: ServerCapabilities, additional: Partial<ServerCapabilities>): ServerCapabilities;
export declare function mergeCapabilities(base: ClientCapabilities, additional: Partial<ClientCapabilities>): ClientCapabilities;
//# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2021_string: LibDefinition;
@@ -0,0 +1,6 @@
function isValid(date) {
return date.toString() !== "Invalid Date";
}
export {
isValid as default
};
@@ -0,0 +1 @@
{"version":3,"file":"map-pin-check-inside.js","sources":["../../../src/icons/map-pin-check-inside.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinCheckInside\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTBjMCA0Ljk5My01LjUzOSAxMC4xOTMtNy4zOTkgMTEuNzk5YTEgMSAwIDAgMS0xLjIwMiAwQzkuNTM5IDIwLjE5MyA0IDE0Ljk5MyA0IDEwYTggOCAwIDAgMSAxNiAwIiAvPgogIDxwYXRoIGQ9Im05IDEwIDIgMiA0LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/map-pin-check-inside\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 MapPinCheckInside = createLucideIcon('MapPinCheckInside', [\n [\n 'path',\n {\n d: 'M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0',\n key: '1r0f0z',\n },\n ],\n ['path', { d: 'm9 10 2 2 4-4', key: '1gnqz4' }],\n]);\n\nexport default MapPinCheckInside;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAC9D,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;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,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,4 @@
import parse = require('./parse')
import stringify = require('./stringify')
export {parse, stringify}
@@ -0,0 +1,141 @@
# `@humanfs/node`
by [Nicholas C. Zakas](https://humanwhocodes.com)
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.
## Description
The `hfs` bindings for use in Node.js and Node.js-compatible runtimes.
> [!WARNING]
> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production!
## Installation
Install using your favorite package manager:
```shell
npm install @humanfs/node
# or
pnpm install @humanfs/node
# or
yarn add @humanfs/node
# or
bun install @humanfs/node
```
## Usage
The easiest way to use hfs in your project is to import the `hfs` object:
```js
import { hfs } from "@humanfs/node";
```
Then, you can use the API methods:
```js
// 1. Files
// read from a text file
const text = await hfs.text("file.txt");
// read from a JSON file
const json = await hfs.json("file.json");
// read raw bytes from a text file
const arrayBuffer = await hfs.arrayBuffer("file.txt");
// write text to a file
await hfs.write("file.txt", "Hello world!");
// write bytes to a file
await hfs.write("file.txt", new TextEncoder().encode("Hello world!"));
// append text to a file
await hfs.append("file.txt", "Hello world!");
// append bytes to a file
await hfs.append("file.txt", new TextEncoder().encode("Hello world!"));
// does the file exist?
const found = await hfs.isFile("file.txt");
// how big is the file?
const size = await hfs.size("file.txt");
// when was the file modified?
const mtime = await hfs.lastModified("file.txt");
// copy a file from one location to another
await hfs.copy("file.txt", "file-copy.txt");
// move a file from one location to another
await hfs.move("file.txt", "renamed.txt");
// delete a file
await hfs.delete("file.txt");
// 2. Directories
// create a directory
await hfs.createDirectory("dir");
// create a directory recursively
await hfs.createDirectory("dir/subdir");
// does the directory exist?
const dirFound = await hfs.isDirectory("dir");
// copy the entire directory
hfs.copyAll("from-dir", "to-dir");
// move the entire directory
hfs.moveAll("from-dir", "to-dir");
// delete a directory
await hfs.delete("dir");
// delete a non-empty directory
await hfs.deleteAll("dir");
```
If you'd like to create your own instance, import the `NodeHfs` constructor:
```js
import { NodeHfs } from "@humanfs/node";
import fsp from "fs/promises";
const hfs = new NodeHfs();
// optionally specify the fs/promises object to use
const hfs = new NodeHfs({ fsp });
```
If you'd like to use just the impl, import the `NodeHfsImpl` constructor:
```js
import { NodeHfsImpl } from "@humanfs/node";
import fsp from "fs/promises";
const hfs = new NodeHfsImpl();
// optionally specify the fs/promises object to use
const hfs = new NodeHfsImpl({ fsp });
```
## Errors Handled
* `ENOENT` - in most cases, these errors are handled silently.
* `ENFILE` and `EMFILE` - calls that result in these errors are retried for up to 60 seconds before giving up for good.
## License
Apache 2.0
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,69 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
import { parsedType } from "../../util.js";
test("parsedType", () => {
expect(parsedType("string")).toBe("string");
expect(parsedType(1)).toBe("number");
expect(parsedType(true)).toBe("boolean");
expect(parsedType(null)).toBe("null");
expect(parsedType(undefined)).toBe("undefined");
expect(parsedType([])).toBe("array");
expect(parsedType({})).toBe("object");
expect(parsedType(new Date())).toBe("Date");
expect(parsedType(new Map())).toBe("Map");
expect(parsedType(new Set())).toBe("Set");
expect(parsedType(new Error())).toBe("Error");
const nullPrototype = Object.create(null);
expect(parsedType(nullPrototype)).toBe("object");
const doubleNullPrototype = Object.create(Object.create(null));
expect(parsedType(doubleNullPrototype)).toBe("object");
expect(parsedType(Number.NaN)).toBe("nan");
});
test("locales - tr", () => {
z.config(z.locales.tr());
const invalidType = z.number().safeParse("a");
expect(invalidType.error!.issues[0].code).toBe("invalid_type");
expect(invalidType.error!.issues[0].message).toBe("Geçersiz değer: beklenen number, alınan string");
const invalidType2 = z.string().safeParse(1);
expect(invalidType2.error!.issues[0].code).toBe("invalid_type");
expect(invalidType2.error!.issues[0].message).toBe("Geçersiz değer: beklenen string, alınan number");
const invalidValue = z.enum(["a", "b"]).safeParse(1);
expect(invalidValue.error!.issues[0].code).toBe("invalid_value");
expect(invalidValue.error!.issues[0].message).toBe('Geçersiz seçenek: aşağıdakilerden biri olmalı: "a"|"b"');
const tooBig = z.number().max(10).safeParse(15);
expect(tooBig.error!.issues[0].code).toBe("too_big");
expect(tooBig.error!.issues[0].message).toBe("Çok büyük: beklenen number <=10");
const tooSmall = z.number().min(10).safeParse(5);
expect(tooSmall.error!.issues[0].code).toBe("too_small");
expect(tooSmall.error!.issues[0].message).toBe("Çok küçük: beklenen number >=10");
const invalidFormatRegex = z.string().regex(/abcd/).safeParse("invalid-string");
expect(invalidFormatRegex.error!.issues[0].code).toBe("invalid_format");
expect(invalidFormatRegex.error!.issues[0].message).toBe("Geçersiz metin: /abcd/ desenine uymalı");
const invalidFormatStartsWith = z.string().startsWith("abcd").safeParse("invalid-string");
expect(invalidFormatStartsWith.error!.issues[0].code).toBe("invalid_format");
expect(invalidFormatStartsWith.error!.issues[0].message).toBe('Geçersiz metin: "abcd" ile başlamalı');
const notMultipleOf = z.number().multipleOf(3).safeParse(10);
expect(notMultipleOf.error!.issues[0].code).toBe("not_multiple_of");
expect(notMultipleOf.error!.issues[0].message).toBe("Geçersiz sayı: 3 ile tam bölünebilmeli");
const unrecognizedKeys = z.object({ a: z.string(), b: z.number() }).strict().safeParse({ a: "a", b: 1, c: 2 });
expect(unrecognizedKeys.error!.issues[0].code).toBe("unrecognized_keys");
expect(unrecognizedKeys.error!.issues[0].message).toBe('Tanınmayan anahtar: "c"');
const invalidUnion = z.union([z.string(), z.number()]).safeParse(true);
expect(invalidUnion.error!.issues[0].code).toBe("invalid_union");
expect(invalidUnion.error!.issues[0].message).toBe("Geçersiz değer");
});
@@ -0,0 +1 @@
{"version":3,"file":"development.js","names":[],"sources":["../../../src/isServer/development.ts"],"sourcesContent":["// Development/test mode - returns undefined so fallback to router.isServer is used\nexport const isServer: boolean | undefined = undefined\n"],"mappings":";AACA,MAAa,WAAgC,KAAA"}
@@ -0,0 +1,28 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.2](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.1...v1.0.2) - 2024-12-10
### Commits
- [types] fix generics ordering [`1b62e94`](https://github.com/ljharb/side-channel-weakmap/commit/1b62e94a2ad6ed30b640ba73c4a2535836c67289)
## [v1.0.1](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.0...v1.0.1) - 2024-12-10
### Commits
- [types] fix generics ordering [`08a4a5d`](https://github.com/ljharb/side-channel-weakmap/commit/08a4a5dbffedc3ebc79f1aaaf5a3dd6d2196dc1b)
- [Deps] update `side-channel-map` [`b53fe44`](https://github.com/ljharb/side-channel-weakmap/commit/b53fe447dfdd3a9aebedfd015b384eac17fce916)
## v1.0.0 - 2024-12-10
### Commits
- Initial implementation, tests, readme, types [`53c0fa4`](https://github.com/ljharb/side-channel-weakmap/commit/53c0fa4788435a006f58b9d7b43cb65989ecee49)
- Initial commit [`a157947`](https://github.com/ljharb/side-channel-weakmap/commit/a157947f26fcaf2c4a941d3a044e76bf67343532)
- npm init [`54dfc55`](https://github.com/ljharb/side-channel-weakmap/commit/54dfc55bafb16265910d5aad4e743c43aee5bbbb)
- Only apps should have lockfiles [`0ddd6c7`](https://github.com/ljharb/side-channel-weakmap/commit/0ddd6c7b07fe8ee04d67b2e9f7255af7ce62c07d)
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_Z","132":"_A"},B:{"132":"_I","1028":"_K"},C:{"2":"_ZI","1028":"_3O","2564":"_WO _cG","3076":"_jI _KD _HE"},D:{"16":"_KC","132":"_XN _OH _ED","388":"E","1028":"_AH"},E:{"16":"_k","132":"mB _DI mC","1028":"_pB"},F:{"2":"_T","132":"_CJ","1028":"_HI"},G:{"16":"_d","132":"_wD _JD","1028":"_AB"},H:{"2":"1D"},I:{"132":"_HL","292":"_LB","1028":"I"},J:{"16":"D","132":"A"},K:{"2":"_D","1028":"H"},L:{"1028":"I"},M:{"1028":"YC"},N:{"132":"_A"},O:{"1028":"bC"},P:{"132":"_F"},Q:{"1028":"JE"},R:{"1028":"KE"},S:{"1028":"ME","2564":"LE"}},B:4,C:"DOMMatrix",D:true};
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './circle-percent.js';
//# sourceMappingURL=percent-circle.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './panel-left-dashed.js';
//# sourceMappingURL=panel-left-inactive.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"2":"_HF","132":"_QI"},D:{"1":"_jQ _HC","2":"_UC","16":"_A"},E:{"1":"_DB","2":"_e"},F:{"1":"_a","2":"_T"},G:{"1":"_eB","16":"lC"},H:{"2":"1D"},I:{"1":"_8B","2":"_n"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"132":"YC"},N:{"1":"A","2":"B"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"132":"_C"}},B:6,C:"AAC audio file format",D:true};
@@ -0,0 +1,8 @@
import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../types.cjs";
export declare namespace partialUtil {
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
}, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
}
@@ -0,0 +1,16 @@
// packages/react/id/src/id.tsx
import * as React from "react";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
var count = 0;
function useId(deterministicId) {
const [id, setId] = React.useState(useReactId());
useLayoutEffect(() => {
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
}, [deterministicId]);
return deterministicId || (id ? `radix-${id}` : "");
}
export {
useId
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,91 @@
/**
* Generate secure URL-friendly unique ID.
*
* By default, the ID will have 21 symbols to have a collision probability
* similar to UUID v4.
*
* ```js
* import { nanoid } from 'nanoid'
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
* ```
*
* @param size Size of the ID. The default size is 21.
* @returns A random string.
*/
export function nanoid(size?: number): string
/**
* Generate secure unique ID with custom alphabet.
*
* Alphabet must contain 256 symbols or less. Otherwise, the generator
* will not be secure.
*
* @param alphabet Alphabet used to generate the ID.
* @param defaultSize Size of the ID. The default size is 21.
* @returns A random string generator.
*
* ```js
* const { customAlphabet } = require('nanoid')
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
* nanoid() //=> "8ё56а"
* ```
*/
export function customAlphabet(
alphabet: string,
defaultSize?: number
): (size?: number) => string
/**
* Generate unique ID with custom random generator and alphabet.
*
* Alphabet must contain 256 symbols or less. Otherwise, the generator
* will not be secure.
*
* ```js
* import { customRandom } from 'nanoid/format'
*
* const nanoid = customRandom('abcdef', 5, size => {
* const random = []
* for (let i = 0; i < size; i++) {
* random.push(randomByte())
* }
* return random
* })
*
* nanoid() //=> "fbaef"
* ```
*
* @param alphabet Alphabet used to generate a random string.
* @param size Size of the random string.
* @param random A random bytes generator.
* @returns A random string generator.
*/
export function customRandom(
alphabet: string,
size: number,
random: (bytes: number) => Uint8Array
): () => string
/**
* URL safe symbols.
*
* ```js
* import { urlAlphabet } from 'nanoid'
* const nanoid = customAlphabet(urlAlphabet, 10)
* nanoid() //=> "Uakgb_J5m9"
* ```
*/
export const urlAlphabet: string
/**
* Generate an array of random bytes collected from hardware noise.
*
* ```js
* import { customRandom, random } from 'nanoid'
* const nanoid = customRandom("abcdef", 5, random)
* ```
*
* @param bytes Size of the array.
* @returns An array of random bytes.
*/
export function random(bytes: number): Uint8Array
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2025_promise: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"useParams.js","names":[],"sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n params: ResolveUseParams<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TThrow,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseParamsResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Access the current route's path parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Specify the matched route and whether to enforce strict typing\n * - `select`: Project the params object to a derived value for memoized renders\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw if the route is not found in strict contexts\n *\n * @returns The params object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n */\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected,\n TStructuralSharing\n >,\n): ThrowOrOptional<\n UseParamsResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n> {\n return useMatch({\n from: opts.from!,\n shouldThrow: opts.shouldThrow,\n structuralSharing: opts.structuralSharing,\n strict: opts.strict,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n\n return opts.select ? opts.select(params) : params\n },\n }) as any\n}\n"],"mappings":";;;;;;;;;;;;;;AA2EA,SAAgB,UAQd,MAWA;AACA,QAAO,SAAS;EACd,MAAM,KAAK;EACX,aAAa,KAAK;EAClB,mBAAmB,KAAK;EACxB,QAAQ,KAAK;EACb,SAAS,UAAU;GACjB,MAAM,SAAS,KAAK,WAAW,QAAQ,MAAM,SAAS,MAAM;AAE5D,UAAO,KAAK,SAAS,KAAK,OAAO,OAAO,GAAG;;EAE9C,CAAC"}
@@ -0,0 +1,79 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface PromiseConstructor {
/**
* A reference to the prototype.
*/
readonly prototype: Promise<any>;
/**
* Creates a new Promise.
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
* a resolve callback used to resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* resolve, or rejected when any Promise is rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>;
// see: lib.es2015.iterable.d.ts
// all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
// see: lib.es2015.iterable.d.ts
// race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject<T = never>(reason?: any): Promise<T>;
/**
* Creates a new resolved promise.
* @returns A resolved promise.
*/
resolve(): Promise<void>;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
resolve<T>(value: T): Promise<Awaited<T>>;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
}
declare var Promise: PromiseConstructor;
@@ -0,0 +1,536 @@
/*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = contentDisposition
module.exports.parse = parse
/**
* TextDecoder instance for UTF-8 decoding when decodeURIComponent fails due to invalid byte sequences.
* @type {TextDecoder}
* @private
*/
const utf8Decoder = new TextDecoder('utf-8')
/**
* RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%")
* @private
*/
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex
/**
* RegExp to match non-latin1 characters.
* @private
*/
var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g
/**
* RegExp to match quoted-pair in RFC 2616
*
* quoted-pair = "\" CHAR
* CHAR = <any US-ASCII character (octets 0 - 127)>
* @private
*/
var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex
/**
* RegExp to match chars that must be quoted-pair in RFC 2616
* @private
*/
var QUOTE_REGEXP = /([\\"])/g
/**
* RegExp for various RFC 2616 grammar
*
* parameter = token "=" ( token | quoted-string )
* token = 1*<any CHAR except CTLs or separators>
* separators = "(" | ")" | "<" | ">" | "@"
* | "," | ";" | ":" | "\" | <">
* | "/" | "[" | "]" | "?" | "="
* | "{" | "}" | SP | HT
* quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
* qdtext = <any TEXT except <">>
* quoted-pair = "\" CHAR
* CHAR = <any US-ASCII character (octets 0 - 127)>
* TEXT = <any OCTET except CTLs, but including LWS>
* LWS = [CRLF] 1*( SP | HT )
* CRLF = CR LF
* CR = <US-ASCII CR, carriage return (13)>
* LF = <US-ASCII LF, linefeed (10)>
* SP = <US-ASCII SP, space (32)>
* HT = <US-ASCII HT, horizontal-tab (9)>
* CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
* OCTET = <any 8-bit sequence of data>
* @private
*/
var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex
var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/
var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/
/**
* RegExp for various RFC 5987 grammar
*
* ext-value = charset "'" [ language ] "'" value-chars
* charset = "UTF-8" / "ISO-8859-1" / mime-charset
* mime-charset = 1*mime-charsetc
* mime-charsetc = ALPHA / DIGIT
* / "!" / "#" / "$" / "%" / "&"
* / "+" / "-" / "^" / "_" / "`"
* / "{" / "}" / "~"
* language = ( 2*3ALPHA [ extlang ] )
* / 4ALPHA
* / 5*8ALPHA
* extlang = *3( "-" 3ALPHA )
* value-chars = *( pct-encoded / attr-char )
* pct-encoded = "%" HEXDIG HEXDIG
* attr-char = ALPHA / DIGIT
* / "!" / "#" / "$" / "&" / "+" / "-" / "."
* / "^" / "_" / "`" / "|" / "~"
* @private
*/
var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/
/**
* RegExp for various RFC 6266 grammar
*
* disposition-type = "inline" | "attachment" | disp-ext-type
* disp-ext-type = token
* disposition-parm = filename-parm | disp-ext-parm
* filename-parm = "filename" "=" value
* | "filename*" "=" ext-value
* disp-ext-parm = token "=" value
* | ext-token "=" ext-value
* ext-token = <the characters in token, followed by "*">
* @private
*/
var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex
/**
* Create an attachment Content-Disposition header.
*
* @param {string} [filename]
* @param {object} [options]
* @param {string} [options.type=attachment]
* @param {string|boolean} [options.fallback=true]
* @return {string}
* @public
*/
function contentDisposition (filename, options) {
var opts = options || {}
// get type
var type = opts.type || 'attachment'
// get parameters
var params = createparams(filename, opts.fallback)
// format into string
return format(new ContentDisposition(type, params))
}
/**
* Create parameters object from filename and fallback.
*
* @param {string} [filename]
* @param {string|boolean} [fallback=true]
* @return {object}
* @private
*/
function createparams (filename, fallback) {
if (filename === undefined) {
return
}
var params = {}
if (typeof filename !== 'string') {
throw new TypeError('filename must be a string')
}
// fallback defaults to true
if (fallback === undefined) {
fallback = true
}
if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {
throw new TypeError('fallback must be a string or boolean')
}
if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {
throw new TypeError('fallback must be ISO-8859-1 string')
}
// restrict to file base name
var name = basename(filename)
// determine if name is suitable for quoted string
var isQuotedString = TEXT_REGEXP.test(name)
// generate fallback name
var fallbackName = typeof fallback !== 'string'
? fallback && getlatin1(name)
: basename(fallback)
var hasFallback = typeof fallbackName === 'string' && fallbackName !== name
// set extended filename parameter
if (hasFallback || !isQuotedString || hasHexEscape(name)) {
params['filename*'] = name
}
// set filename parameter
if (isQuotedString || hasFallback) {
params.filename = hasFallback
? fallbackName
: name
}
return params
}
/**
* Format object to Content-Disposition header.
*
* @param {object} obj
* @param {string} obj.type
* @param {object} [obj.parameters]
* @return {string}
* @private
*/
function format (obj) {
var parameters = obj.parameters
var type = obj.type
if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {
throw new TypeError('invalid type')
}
// start with normalized type
var string = String(type).toLowerCase()
// append parameters
if (parameters && typeof parameters === 'object') {
var param
var params = Object.keys(parameters).sort()
for (var i = 0; i < params.length; i++) {
param = params[i]
var val = param.slice(-1) === '*'
? ustring(parameters[param])
: qstring(parameters[param])
string += '; ' + param + '=' + val
}
}
return string
}
/**
* Decode a RFC 5987 field value (gracefully).
*
* @param {string} str
* @return {string}
* @private
*/
function decodefield (str) {
const match = EXT_VALUE_REGEXP.exec(str)
if (!match) {
throw new TypeError('invalid extended field value')
}
const charset = match[1].toLowerCase()
const encoded = match[2]
switch (charset) {
case 'iso-8859-1':
{
const binary = decodeHexEscapes(encoded)
return getlatin1(binary)
}
case 'utf-8':
case 'utf8':
{
try {
return decodeURIComponent(encoded)
} catch {
// Failed to decode with decodeURIComponent, fallback to lenient decoding which replaces invalid UTF-8 byte sequences with the Unicode replacement character
// TODO: Consider removing in the next major version to be more strict about invalid percent-encodings
const binary = decodeHexEscapes(encoded)
const bytes = new Uint8Array(binary.length)
for (let idx = 0; idx < binary.length; idx++) {
bytes[idx] = binary.charCodeAt(idx)
}
return utf8Decoder.decode(bytes)
}
}
}
throw new TypeError('unsupported charset in extended field')
}
/**
* Get ISO-8859-1 version of string.
*
* @param {string} val
* @return {string}
* @private
*/
function getlatin1 (val) {
// simple Unicode -> ISO-8859-1 transformation
return String(val).replace(NON_LATIN1_REGEXP, '?')
}
/**
* Parse Content-Disposition header string.
*
* @param {string} string
* @return {object}
* @public
*/
function parse (string) {
if (!string || typeof string !== 'string') {
throw new TypeError('argument string is required')
}
var match = DISPOSITION_TYPE_REGEXP.exec(string)
if (!match) {
throw new TypeError('invalid type format')
}
// normalize type
var index = match[0].length
var type = match[1].toLowerCase()
var key
var names = []
var params = {}
var value
// calculate index to start at
index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';'
? index - 1
: index
// match parameters
while ((match = PARAM_REGEXP.exec(string))) {
if (match.index !== index) {
throw new TypeError('invalid parameter format')
}
index += match[0].length
key = match[1].toLowerCase()
value = match[2]
if (names.indexOf(key) !== -1) {
throw new TypeError('invalid duplicate parameter')
}
names.push(key)
if (key.indexOf('*') + 1 === key.length) {
// decode extended value
key = key.slice(0, -1)
value = decodefield(value)
// overwrite existing value
params[key] = value
continue
}
if (typeof params[key] === 'string') {
continue
}
if (value[0] === '"') {
// remove quotes and escapes
value = value
.slice(1, -1)
.replace(QESC_REGEXP, '$1')
}
params[key] = value
}
if (index !== -1 && index !== string.length) {
throw new TypeError('invalid parameter format')
}
return new ContentDisposition(type, params)
}
/**
* Percent encode a single character.
*
* @param {string} char
* @return {string}
* @private
*/
function pencode (char) {
return '%' + String(char)
.charCodeAt(0)
.toString(16)
.toUpperCase()
}
/**
* Quote a string for HTTP.
*
* @param {string} val
* @return {string}
* @private
*/
function qstring (val) {
var str = String(val)
return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
}
/**
* Encode a Unicode string for HTTP (RFC 5987).
*
* @param {string} val
* @return {string}
* @private
*/
function ustring (val) {
var str = String(val)
// percent encode as UTF-8
var encoded = encodeURIComponent(str)
.replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)
return 'UTF-8\'\'' + encoded
}
/**
* Class for parsed Content-Disposition header for v8 optimization
*
* @public
* @param {string} type
* @param {object} parameters
* @constructor
*/
function ContentDisposition (type, parameters) {
this.type = type
this.parameters = parameters
}
/**
* Return the last portion of a path
*
* @param {string} path
* @returns {string}
*/
function basename (path) {
const normalized = path.replaceAll('\\', '/')
let end = normalized.length
while (end > 0 && normalized[end - 1] === '/') {
end--
}
if (end === 0) {
return ''
}
let start = end - 1
while (start >= 0 && normalized[start] !== '/') {
start--
}
return normalized.slice(start + 1, end)
}
/**
* Check if a character is a hex digit [0-9A-Fa-f]
*
* @param {string} char
* @return {boolean}
* @private
*/
function isHexDigit (char) {
const code = char.charCodeAt(0)
return (
(code >= 48 && code <= 57) || // 0-9
(code >= 65 && code <= 70) || // A-F
(code >= 97 && code <= 102) // a-f
)
}
/**
* Check if a string contains percent encoding escapes.
*
* @param {string} str
* @return {boolean}
* @private
*/
function hasHexEscape (str) {
const maxIndex = str.length - 3
let lastIndex = -1
while ((lastIndex = str.indexOf('%', lastIndex + 1)) !== -1 && lastIndex <= maxIndex) {
if (isHexDigit(str[lastIndex + 1]) && isHexDigit(str[lastIndex + 2])) {
return true
}
}
return false
}
/**
* Decode hex escapes in a string (e.g., %20 -> space)
*
* @param {string} str
* @return {string}
* @private
*/
function decodeHexEscapes (str) {
const firstEscape = str.indexOf('%')
if (firstEscape === -1) return str
let result = str.slice(0, firstEscape)
for (let idx = firstEscape; idx < str.length; idx++) {
if (
str[idx] === '%' &&
idx + 2 < str.length &&
isHexDigit(str[idx + 1]) &&
isHexDigit(str[idx + 2])
) {
result += String.fromCharCode(Number.parseInt(str[idx + 1] + str[idx + 2], 16))
idx += 2
} else {
result += str[idx]
}
}
return result
}
@@ -0,0 +1,3 @@
# `react-popper`
This is an internal utility, not intended for public usage.