docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

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,71 @@
/**
* Constructs a RegExp that matches the exact string specified.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { exactRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: exactRegex('foo') },
* handler(id) {} // will only be called for `foo`
* }
* }
* ```
*/
export declare function exactRegex(str: string, flags?: string): RegExp;
/**
* Constructs a RegExp that matches a value that has the specified prefix.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { prefixRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: prefixRegex('foo') },
* handler(id) {} // will only be called for IDs starting with `foo`
* }
* }
* ```
*/
export declare function prefixRegex(str: string, flags?: string): RegExp;
type WidenString<T> = T extends string ? string : T;
/**
* Converts a id filter to match with an id with a query.
*
* @param input the id filters to convert.
*
* @example
* ```ts
* import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* transform: {
* filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
* // The handler will be called for IDs like:
* // - foo.js
* // - foo.js?foo
* // - foo.txt?foo.js
* // - foo.ts
* // - foo.ts?foo
* // - foo.txt?foo.ts
* handler(code, id) {}
* }
* }
* ```
*/
export declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
export declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
export declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
export {};
@@ -0,0 +1,17 @@
"use client";
import { useRef } from 'react';
import { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';
function useIsMounted() {
const isMounted = useRef(false);
useIsomorphicLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
}
export { useIsMounted };
//# sourceMappingURL=use-is-mounted.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"power-off.js","sources":["../../../src/icons/power-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PowerOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTguMzYgNi42NEE5IDkgMCAwIDEgMjAuNzcgMTUiIC8+CiAgPHBhdGggZD0iTTYuMTYgNi4xNmE5IDkgMCAxIDAgMTIuNjggMTIuNjgiIC8+CiAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/power-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 PowerOff = createLucideIcon('PowerOff', [\n ['path', { d: 'M18.36 6.64A9 9 0 0 1 20.77 15', key: 'dxknvb' }],\n ['path', { d: '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xC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
import { visit } from "../core/visit.js";
import * as schemas from "./schemas.js";
/** See `classic/deep-partial.ts`. Mini variant uses `mini.partial(...)`. */
export function deepPartial(schema) {
return visit(schema, {
object: (s) => schemas.partial(s),
// See `classic/deep-partial.ts`.
union: (s) => {
const def = s._zod.def;
return def.discriminator === undefined ? s : schemas.union(def.options);
},
});
}
@@ -0,0 +1 @@
{"version":3,"file":"partial-keyframes.mjs","sources":["../../../../../src/animation/waapi/supports/partial-keyframes.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n"],"names":[],"mappings":";;MAEa,wBAAwB,iBAAiB,IAAI,CAAC,MAAK;AAC5D,IAAA,IAAI;AACA,QAAA,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D;IAAE,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AACA,IAAA,OAAO,IAAI;AACf,CAAC;;;;"}
@@ -0,0 +1,129 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_url = require("./url.js");
//#region src/utils/cookie.ts
/**
* @module
* Cookie utility.
*/
const algorithm = {
name: "HMAC",
hash: "SHA-256"
};
const getCryptoKey = async (secret) => {
const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret;
return await crypto.subtle.importKey("raw", secretBuf, algorithm, false, ["sign", "verify"]);
};
const makeSignature = async (value, secret) => {
const key = await getCryptoKey(secret);
const signature = await crypto.subtle.sign(algorithm.name, key, new TextEncoder().encode(value));
return btoa(String.fromCharCode(...new Uint8Array(signature)));
};
const verifySignature = async (base64Signature, value, secret) => {
try {
const signatureBinStr = atob(base64Signature);
const signature = new Uint8Array(signatureBinStr.length);
for (let i = 0, len = signatureBinStr.length; i < len; i++) signature[i] = signatureBinStr.charCodeAt(i);
return await crypto.subtle.verify(algorithm, secret, signature, new TextEncoder().encode(value));
} catch {
return false;
}
};
const validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
const relaxedCookieNameRegEx = /^[!#-:<>-[\]-~]+$/;
const validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;
const trimCookieWhitespace = (value) => {
let start = 0;
let end = value.length;
while (start < end) {
const charCode = value.charCodeAt(start);
if (charCode !== 32 && charCode !== 9) break;
start++;
}
while (end > start) {
const charCode = value.charCodeAt(end - 1);
if (charCode !== 32 && charCode !== 9) break;
end--;
}
return start === 0 && end === value.length ? value : value.slice(start, end);
};
const parse = (cookie, name) => {
if (name && cookie.indexOf(name) === -1) return {};
const pairs = cookie.split(";");
const parsedCookie = Object.create(null);
for (const pairStr of pairs) {
const valueStartPos = pairStr.indexOf("=");
if (valueStartPos === -1) continue;
const cookieName = trimCookieWhitespace(pairStr.substring(0, valueStartPos));
if (name && name !== cookieName || !relaxedCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) continue;
let cookieValue = trimCookieWhitespace(pairStr.substring(valueStartPos + 1));
if (cookieValue.startsWith("\"") && cookieValue.endsWith("\"")) cookieValue = cookieValue.slice(1, -1);
if (validCookieValueRegEx.test(cookieValue)) {
parsedCookie[cookieName] = require_utils_url.tryDecodeURIComponent(cookieValue);
if (name) break;
}
}
return parsedCookie;
};
const parseSigned = async (cookie, secret, name) => {
const parsedCookie = Object.create(null);
const secretKey = await getCryptoKey(secret);
for (const [key, value] of Object.entries(parse(cookie, name))) {
const signatureStartPos = value.lastIndexOf(".");
if (signatureStartPos < 0) continue;
const signedValue = value.substring(0, signatureStartPos);
const signature = value.substring(signatureStartPos + 1);
if (signature.length !== 44 || !signature.endsWith("=")) continue;
parsedCookie[key] = await verifySignature(signature, signedValue, secretKey) ? signedValue : false;
}
return parsedCookie;
};
const _serialize = (name, value, opt = {}) => {
if (!validCookieNameRegEx.test(name)) throw new Error("Invalid cookie name");
let cookie = `${name}=${value}`;
if (name.startsWith("__Secure-") && !opt.secure) throw new Error("__Secure- Cookie must have Secure attributes");
if (name.startsWith("__Host-")) {
if (!opt.secure) throw new Error("__Host- Cookie must have Secure attributes");
if (opt.path !== "/") throw new Error("__Host- Cookie must have Path attributes with \"/\"");
if (opt.domain) throw new Error("__Host- Cookie must not have Domain attributes");
}
for (const key of [
"domain",
"path",
"sameSite",
"priority"
]) if (opt[key] && /[;\r\n]/.test(opt[key])) throw new Error(`${key} must not contain ";", "\\r", or "\\n"`);
if (opt && typeof opt.maxAge === "number" && opt.maxAge >= 0) {
if (opt.maxAge > 3456e4) throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");
cookie += `; Max-Age=${opt.maxAge | 0}`;
}
if (opt.domain && opt.prefix !== "host") cookie += `; Domain=${opt.domain}`;
if (opt.path) cookie += `; Path=${opt.path}`;
if (opt.expires) {
if (opt.expires.getTime() - Date.now() > 3456e7) throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");
cookie += `; Expires=${opt.expires.toUTCString()}`;
}
if (opt.httpOnly) cookie += "; HttpOnly";
if (opt.secure) cookie += "; Secure";
if (opt.sameSite) cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`;
if (opt.priority) cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`;
if (opt.partitioned) {
if (!opt.secure) throw new Error("Partitioned Cookie must have Secure attributes");
cookie += "; Partitioned";
}
return cookie;
};
const serialize = (name, value, opt) => {
value = encodeURIComponent(value);
return _serialize(name, value, opt);
};
const serializeSigned = async (name, value, secret, opt = {}) => {
const signature = await makeSignature(value, secret);
value = `${value}.${signature}`;
value = encodeURIComponent(value);
return _serialize(name, value, opt);
};
//#endregion
exports.parse = parse;
exports.parseSigned = parseSigned;
exports.serialize = serialize;
exports.serializeSigned = serializeSigned;
@@ -0,0 +1,96 @@
import Matching from './Matching'
import { TimeEstimates } from './TimeEstimates'
import Feedback from './Feedback'
import Options from './Options'
import debounce from './utils/debounce'
import {
Matcher,
MatchEstimated,
MatchExtended,
OptionsType,
ZxcvbnResult,
} from './types'
import Scoring from './scoring'
const time = () => new Date().getTime()
class ZxcvbnFactory {
private options: Options
private scoring: Scoring
private matching: Matching
private feedback: Feedback
private timeEstimates: TimeEstimates
constructor(
options: OptionsType = {},
customMatchers: Record<string, Matcher> = {},
) {
this.options = new Options(options, customMatchers)
this.scoring = new Scoring(this.options)
this.matching = new Matching(this.options)
this.feedback = new Feedback(this.options)
this.timeEstimates = new TimeEstimates(this.options)
}
private estimateAttackTimes(guesses: number) {
return this.timeEstimates.estimateAttackTimes(guesses)
}
private getFeedback(score: number, sequence: MatchEstimated[]) {
return this.feedback.getFeedback(score, sequence)
}
private createReturnValue(
resolvedMatches: MatchExtended[],
password: string,
start: number,
): ZxcvbnResult {
const matchSequence = this.scoring.mostGuessableMatchSequence(
password,
resolvedMatches,
)
const calcTime = time() - start
const attackTimes = this.estimateAttackTimes(matchSequence.guesses)
return {
calcTime,
...matchSequence,
...attackTimes,
feedback: this.getFeedback(attackTimes.score, matchSequence.sequence),
}
}
private main(password: string, userInputs?: (string | number)[]) {
const userInputsOptions = this.options.getUserInputsOptions(userInputs)
return this.matching.match(password, userInputsOptions)
}
public check(password: string, userInputs?: (string | number)[]) {
const reducedPassword = password.substring(0, this.options.maxLength)
const start = time()
const matches = this.main(reducedPassword, userInputs)
if (matches instanceof Promise) {
throw new Error(
'You are using a Promised matcher, please use `zxcvbnAsync` for it.',
)
}
return this.createReturnValue(matches, reducedPassword, start)
}
public async checkAsync(password: string, userInputs?: (string | number)[]) {
const reducedPassword = password.substring(0, this.options.maxLength)
const start = time()
const matches = await this.main(reducedPassword, userInputs)
return this.createReturnValue(matches, reducedPassword, start)
}
}
export * from './types'
export { ZxcvbnFactory, debounce, Options }
@@ -0,0 +1,138 @@
const SECOND = 1;
const MINUTE = SECOND * 60;
const HOUR = MINUTE * 60;
const DAY = HOUR * 24;
const MONTH = DAY * 31;
const YEAR = MONTH * 12;
const CENTURY = YEAR * 100;
const times = {
second: SECOND,
minute: MINUTE,
hour: HOUR,
day: DAY,
month: MONTH,
year: YEAR,
century: CENTURY
};
const timeEstimationValuesDefaults = {
scoring: {
0: 1e3,
1: 1e6,
2: 1e8,
3: 1e10
},
attackTime: {
onlineThrottlingXPerHour: 100,
onlineNoThrottlingXPerSecond: 10,
offlineSlowHashingXPerSecond: 1e4,
offlineFastHashingXPerSecond: 1e10
}
};
const checkTimeEstimationValues = timeEstimationValues => {
Object.entries(timeEstimationValues).forEach(([key, data]) => {
Object.entries(data).forEach(([subKey, value]) => {
// @ts-expect-error for testing purposes
if (value < timeEstimationValuesDefaults[key][subKey]) {
throw new Error('Time estimation values are not to be allowed to be less than default');
}
});
});
};
/*
* -------------------------------------------------------------------------------
* Estimates time for an attacker ---------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class TimeEstimates {
constructor(options) {
this.options = options;
}
estimateAttackTimes(guesses) {
const crackTimesSeconds = this.calculateCrackTimesSeconds(guesses);
const crackTimes = {};
Object.keys(crackTimesSeconds).forEach(crackTime => {
const usedScenario = crackTime;
const seconds = crackTimesSeconds[usedScenario];
const {
base,
displayStr
} = this.displayTime(seconds);
crackTimes[usedScenario] = {
base,
seconds,
display: this.translate(displayStr, base)
};
});
return {
crackTimes,
score: this.guessesToScore(guesses)
};
}
calculateCrackTimesSeconds(guesses) {
const attackTimesOptions = this.options.timeEstimationValues.attackTime;
return {
onlineThrottlingXPerHour: guesses / (attackTimesOptions.onlineThrottlingXPerHour / 3600),
onlineNoThrottlingXPerSecond: guesses / attackTimesOptions.onlineNoThrottlingXPerSecond,
offlineSlowHashingXPerSecond: guesses / attackTimesOptions.offlineSlowHashingXPerSecond,
offlineFastHashingXPerSecond: guesses / attackTimesOptions.offlineFastHashingXPerSecond
};
}
guessesToScore(guesses) {
const scoringOptions = this.options.timeEstimationValues.scoring;
const DELTA = 5;
if (guesses < scoringOptions[0] + DELTA) {
// risky password: "too guessable"
return 0;
}
if (guesses < scoringOptions[1] + DELTA) {
// modest protection from throttled online attacks: "very guessable"
return 1;
}
if (guesses < scoringOptions[2] + DELTA) {
// modest protection from unthrottled online attacks: "somewhat guessable"
return 2;
}
if (guesses < scoringOptions[3] + DELTA) {
// modest protection from offline attacks: "safely unguessable"
// assuming a salted, slow hash function like bcrypt, scrypt, PBKDF2, argon, etc
return 3;
}
// strong protection from offline attacks under same scenario: "very unguessable"
return 4;
}
displayTime(seconds) {
let displayStr = 'centuries';
let base = null;
const timeKeys = Object.keys(times);
const foundIndex = timeKeys.findIndex(time => seconds < times[time]);
if (foundIndex > -1) {
displayStr = timeKeys[foundIndex - 1];
if (foundIndex !== 0) {
base = Math.round(seconds / times[displayStr]);
} else {
displayStr = 'ltSecond';
}
}
return {
base,
displayStr
};
}
translate(displayStr, value) {
let key = displayStr;
if (value !== null && value !== 1) {
key += 's';
}
const {
timeEstimation
} = this.options.translations;
const translation = timeEstimation[key];
if (typeof translation === 'function') {
return translation(value);
}
return translation.replace('{base}', `${value}`);
}
}
export { TimeEstimates, checkTimeEstimationValues, timeEstimationValuesDefaults };
//# sourceMappingURL=TimeEstimates.mjs.map
@@ -0,0 +1,817 @@
/*
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 estraverse from "estraverse";
import esrecurse from "esrecurse";
import Reference from "./reference.js";
import Variable from "./variable.js";
import PatternVisitor from "./pattern-visitor.js";
import { Definition, ParameterDefinition } from "./definition.js";
import { assert } from "./assert.js";
/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */
const { Syntax } = estraverse;
/**
* Traverse identifier in pattern
* @param {Object} options options
* @param {ESTree.Pattern} rootPattern root pattern
* @param {?Referencer} referencer referencer
* @param {types.PatternVisitorCallback} callback callback
* @returns {void}
*/
function traverseIdentifierInPattern(
options,
rootPattern,
referencer,
callback,
) {
// Call the callback at left hand identifier nodes, and Collect right hand nodes.
const visitor = new PatternVisitor(options, rootPattern, callback);
visitor.visit(rootPattern);
// Process the right hand nodes recursively.
if (referencer !== null && referencer !== void 0) {
visitor.rightHandNodes.forEach(referencer.visit, referencer);
}
}
// Importing ImportDeclaration.
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
// FIXME: Now, we don't create module environment, because the context is
// implementation dependent.
/**
* Visitor for import specifiers.
*/
class Importer extends esrecurse.Visitor {
constructor(declaration, referencer) {
super(null, referencer.options);
this.declaration = declaration;
this.referencer = referencer;
}
visitImport(id, specifier) {
this.referencer.visitPattern(id, pattern => {
this.referencer
.currentScope()
.__define(
pattern,
new Definition(
Variable.ImportBinding,
pattern,
specifier,
this.declaration,
null,
null,
),
);
});
}
ImportNamespaceSpecifier(node) {
const local = node.local || node.id;
if (local) {
this.visitImport(local, node);
}
}
ImportDefaultSpecifier(node) {
const local = node.local || node.id;
this.visitImport(local, node);
}
ImportSpecifier(node) {
const local = node.local || node.id;
if (node.name) {
this.visitImport(node.name, node);
} else {
this.visitImport(local, node);
}
}
}
/**
* Referencing variables and creating bindings.
* @implements {types.Referencer}
*/
class Referencer extends esrecurse.Visitor {
constructor(options, scopeManager) {
super(null, options);
this.options = options;
this.scopeManager = scopeManager;
this.parent = null;
this.isInnerMethodDefinition = false;
}
currentScope() {
return this.scopeManager.__currentScope;
}
close(node) {
while (this.currentScope() && node === this.currentScope().block) {
this.scopeManager.__currentScope = this.currentScope().__close(
this.scopeManager,
);
}
}
pushInnerMethodDefinition(isInnerMethodDefinition) {
const previous = this.isInnerMethodDefinition;
this.isInnerMethodDefinition = isInnerMethodDefinition;
return previous;
}
popInnerMethodDefinition(isInnerMethodDefinition) {
this.isInnerMethodDefinition = isInnerMethodDefinition;
}
referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
const scope = this.currentScope();
assignments.forEach(assignment => {
scope.__referencing(
pattern,
Reference.WRITE,
assignment.right,
maybeImplicitGlobal,
pattern !== assignment.left,
init,
);
});
}
visitPattern(node, options, callback) {
let visitPatternOptions = options;
let visitPatternCallback = callback;
if (typeof options === "function") {
visitPatternCallback = options;
visitPatternOptions = { processRightHandNodes: false };
}
traverseIdentifierInPattern(
this.options,
node,
visitPatternOptions.processRightHandNodes ? this : null,
visitPatternCallback,
);
}
visitFunction(node) {
let i, iz;
// FunctionDeclaration name is defined in upper scope
// NOTE: Not referring variableScope. It is intended.
// Since
// in ES5, FunctionDeclaration should be in FunctionBody.
// in ES6, FunctionDeclaration should be block scoped.
if (node.type === Syntax.FunctionDeclaration) {
// id is defined in upper scope
this.currentScope().__define(
node.id,
new Definition(
Variable.FunctionName,
node.id,
node,
null,
null,
null,
),
);
}
// FunctionExpression with name creates its special scope;
// FunctionExpressionNameScope.
if (node.type === Syntax.FunctionExpression && node.id) {
this.scopeManager.__nestFunctionExpressionNameScope(node);
}
// Consider this function is in the MethodDefinition.
this.scopeManager.__nestFunctionScope(
node,
this.isInnerMethodDefinition,
);
const that = this;
/**
* Visit pattern callback
* @param {ESTree.Pattern} pattern pattern
* @param {Object} info info
* @returns {void}
*/
function visitPatternCallback(pattern, info) {
that.currentScope().__define(
pattern,
new ParameterDefinition(pattern, node, i, info.rest),
);
that.referencingDefaultValue(pattern, info.assignments, null, true);
}
// Process parameter declarations.
for (i = 0, iz = node.params.length; i < iz; ++i) {
this.visitPattern(
node.params[i],
{ processRightHandNodes: true },
visitPatternCallback,
);
}
// if there's a rest argument, add that
if (node.rest) {
this.visitPattern(
{
type: "RestElement",
argument: node.rest,
},
pattern => {
this.currentScope().__define(
pattern,
new ParameterDefinition(
pattern,
node,
node.params.length,
true,
),
);
},
);
}
// In TypeScript there are a number of function-like constructs which have no body,
// so check it exists before traversing
if (node.body) {
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
}
this.close(node);
}
visitClass(node) {
if (node.type === Syntax.ClassDeclaration) {
this.currentScope().__define(
node.id,
new Definition(
Variable.ClassName,
node.id,
node,
null,
null,
null,
),
);
}
this.scopeManager.__nestClassScope(node);
if (node.id) {
this.currentScope().__define(
node.id,
new Definition(Variable.ClassName, node.id, node),
);
}
this.visit(node.superClass);
this.visit(node.body);
this.close(node);
}
visitProperty(node) {
let previous;
if (node.computed) {
this.visit(node.key);
}
const isMethodDefinition = node.type === Syntax.MethodDefinition;
if (isMethodDefinition) {
previous = this.pushInnerMethodDefinition(true);
}
this.visit(node.value);
if (isMethodDefinition) {
this.popInnerMethodDefinition(previous);
}
}
visitForIn(node) {
if (
node.left.type === Syntax.VariableDeclaration &&
node.left.kind !== "var"
) {
this.scopeManager.__nestForScope(node);
}
if (node.left.type === Syntax.VariableDeclaration) {
this.visit(node.left);
this.visitPattern(node.left.declarations[0].id, pattern => {
this.currentScope().__referencing(
pattern,
Reference.WRITE,
node.right,
null,
true,
true,
);
});
} else {
this.visitPattern(
node.left,
{ processRightHandNodes: true },
(pattern, info) => {
let maybeImplicitGlobal = null;
if (!this.currentScope().isStrict) {
maybeImplicitGlobal = {
pattern,
node,
};
}
this.referencingDefaultValue(
pattern,
info.assignments,
maybeImplicitGlobal,
false,
);
this.currentScope().__referencing(
pattern,
Reference.WRITE,
node.right,
maybeImplicitGlobal,
true,
false,
);
},
);
}
this.visit(node.right);
this.visit(node.body);
this.close(node);
}
visitVariableDeclaration(variableTargetScope, type, node, index) {
const decl = node.declarations[index];
const init = decl.init;
this.visitPattern(
decl.id,
{ processRightHandNodes: true },
(pattern, info) => {
variableTargetScope.__define(
pattern,
new Definition(type, pattern, decl, node, index, node.kind),
);
this.referencingDefaultValue(
pattern,
info.assignments,
null,
true,
);
if (init) {
this.currentScope().__referencing(
pattern,
Reference.WRITE,
init,
null,
!info.topLevel,
true,
);
}
},
);
}
AssignmentExpression(node) {
if (PatternVisitor.isPattern(node.left)) {
if (node.operator === "=") {
this.visitPattern(
node.left,
{ processRightHandNodes: true },
(pattern, info) => {
let maybeImplicitGlobal = null;
if (!this.currentScope().isStrict) {
maybeImplicitGlobal = {
pattern,
node,
};
}
this.referencingDefaultValue(
pattern,
info.assignments,
maybeImplicitGlobal,
false,
);
this.currentScope().__referencing(
pattern,
Reference.WRITE,
node.right,
maybeImplicitGlobal,
!info.topLevel,
false,
);
},
);
} else {
this.currentScope().__referencing(
node.left,
Reference.RW,
node.right,
);
}
} else {
this.visit(node.left);
}
this.visit(node.right);
}
CatchClause(node) {
this.scopeManager.__nestCatchScope(node);
this.visitPattern(
node.param,
{ processRightHandNodes: true },
(pattern, info) => {
this.currentScope().__define(
pattern,
new Definition(
Variable.CatchClause,
pattern,
node,
null,
null,
null,
),
);
this.referencingDefaultValue(
pattern,
info.assignments,
null,
true,
);
},
);
this.visit(node.body);
this.close(node);
}
Program(node) {
this.scopeManager.__nestGlobalScope(node);
if (this.scopeManager.isGlobalReturn()) {
// Force strictness of GlobalScope to false when using node.js scope.
this.currentScope().isStrict = false;
this.scopeManager.__nestFunctionScope(node, false);
}
if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
this.scopeManager.__nestModuleScope(node);
}
if (
this.scopeManager.isStrictModeSupported() &&
this.scopeManager.isImpliedStrict()
) {
this.currentScope().isStrict = true;
}
this.visitChildren(node);
this.close(node);
}
Identifier(node) {
this.currentScope().__referencing(node);
}
// eslint-disable-next-line class-methods-use-this -- Desired as instance method
PrivateIdentifier() {
// Do nothing.
}
UpdateExpression(node) {
if (PatternVisitor.isPattern(node.argument)) {
this.currentScope().__referencing(
node.argument,
Reference.RW,
null,
);
} else {
this.visitChildren(node);
}
}
MemberExpression(node) {
this.visit(node.object);
if (node.computed) {
this.visit(node.property);
}
}
Property(node) {
this.visitProperty(node);
}
PropertyDefinition(node) {
const { computed, key, value } = node;
if (computed) {
this.visit(key);
}
if (value) {
this.scopeManager.__nestClassFieldInitializerScope(value);
this.visit(value);
this.close(value);
}
}
StaticBlock(node) {
this.scopeManager.__nestClassStaticBlockScope(node);
this.visitChildren(node);
this.close(node);
}
MethodDefinition(node) {
this.visitProperty(node);
}
BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method
ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method
LabeledStatement(node) {
this.visit(node.body);
}
ForStatement(node) {
// Create ForStatement declaration.
// NOTE: In ES6, ForStatement dynamically generates
// per iteration environment. However, escope is
// a static analyzer, we only generate one scope for ForStatement.
if (
node.init &&
node.init.type === Syntax.VariableDeclaration &&
node.init.kind !== "var"
) {
this.scopeManager.__nestForScope(node);
}
this.visitChildren(node);
this.close(node);
}
ClassExpression(node) {
this.visitClass(node);
}
ClassDeclaration(node) {
this.visitClass(node);
}
CallExpression(node) {
// Check this is direct call to eval
if (
!this.scopeManager.__ignoreEval() &&
node.callee.type === Syntax.Identifier &&
node.callee.name === "eval"
) {
// NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
// let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
this.currentScope().variableScope.__detectEval();
}
this.visitChildren(node);
}
BlockStatement(node) {
if (this.scopeManager.__isES6()) {
this.scopeManager.__nestBlockScope(node);
}
this.visitChildren(node);
this.close(node);
}
ThisExpression() {
this.currentScope().variableScope.__detectThis();
}
WithStatement(node) {
this.visit(node.object);
// Then nest scope for WithStatement.
this.scopeManager.__nestWithScope(node);
this.visit(node.body);
this.close(node);
}
VariableDeclaration(node) {
const variableTargetScope =
node.kind === "var"
? this.currentScope().variableScope
: this.currentScope();
for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
const decl = node.declarations[i];
this.visitVariableDeclaration(
variableTargetScope,
Variable.Variable,
node,
i,
);
if (decl.init) {
this.visit(decl.init);
}
}
}
// sec 13.11.8
SwitchStatement(node) {
this.visit(node.discriminant);
if (this.scopeManager.__isES6()) {
this.scopeManager.__nestSwitchScope(node);
}
for (let i = 0, iz = node.cases.length; i < iz; ++i) {
this.visit(node.cases[i]);
}
this.close(node);
}
FunctionDeclaration(node) {
this.visitFunction(node);
}
FunctionExpression(node) {
this.visitFunction(node);
}
ForOfStatement(node) {
this.visitForIn(node);
}
ForInStatement(node) {
this.visitForIn(node);
}
ArrowFunctionExpression(node) {
this.visitFunction(node);
}
ImportDeclaration(node) {
assert(
this.scopeManager.__isES6() && this.scopeManager.isModule(),
"ImportDeclaration should appear when the mode is ES6 and in the module context.",
);
const importer = new Importer(node, this);
importer.visit(node);
}
visitExportDeclaration(node) {
if (node.source) {
return;
}
if (node.declaration) {
this.visit(node.declaration);
return;
}
this.visitChildren(node);
}
// TODO: ExportDeclaration doesn't exist. for bc?
ExportDeclaration(node) {
this.visitExportDeclaration(node);
}
ExportAllDeclaration(node) {
this.visitExportDeclaration(node);
}
ExportDefaultDeclaration(node) {
this.visitExportDeclaration(node);
}
ExportNamedDeclaration(node) {
this.visitExportDeclaration(node);
}
ExportSpecifier(node) {
// TODO: `node.id` doesn't exist. for bc?
const local = node.id || node.local;
this.visit(local);
}
// eslint-disable-next-line class-methods-use-this -- Desired as instance method
MetaProperty() {
// do nothing.
}
JSXIdentifier(node) {
// Special case: "this" should not count as a reference
if (this.scopeManager.__isJSXEnabled() && node.name !== "this") {
this.currentScope().__referencing(node);
}
}
JSXMemberExpression(node) {
this.visit(node.object);
}
JSXElement(node) {
if (this.scopeManager.__isJSXEnabled()) {
this.visit(node.openingElement);
node.children.forEach(this.visit, this);
} else {
this.visitChildren(node);
}
}
JSXOpeningElement(node) {
if (this.scopeManager.__isJSXEnabled()) {
const nameNode = node.name;
const isComponentName =
nameNode.type === "JSXIdentifier" &&
nameNode.name[0].toUpperCase() === nameNode.name[0];
const isComponent =
isComponentName || nameNode.type === "JSXMemberExpression";
// we only want to visit JSXIdentifier nodes if they are capitalized
if (isComponent) {
this.visit(nameNode);
}
}
node.attributes.forEach(this.visit, this);
}
JSXAttribute(node) {
if (node.value) {
this.visit(node.value);
}
}
JSXExpressionContainer(node) {
this.visit(node.expression);
}
JSXNamespacedName(node) {
this.visit(node.namespace);
this.visit(node.name);
}
}
export default Referencer;
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1 @@
{"version":3,"file":"person-standing.js","sources":["../../../src/icons/person-standing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PersonStanding\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjUiIHI9IjEiIC8+CiAgPHBhdGggZD0ibTkgMjAgMy02IDMgNiIgLz4KICA8cGF0aCBkPSJtNiA4IDYgMiA2LTIiIC8+CiAgPHBhdGggZD0iTTEyIDEwdjQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/person-standing\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 PersonStanding = createLucideIcon('PersonStanding', [\n ['circle', { cx: '12', cy: '5', r: '1', key: 'gxeob9' }],\n ['path', { d: 'm9 20 3-6 3 6', key: 'se2kox' }],\n ['path', { d: 'm6 8 6 2 6-2', key: '4o3us4' }],\n ['path', { d: 'M12 10v4', key: '1kjpxc' }],\n]);\n\nexport default PersonStanding;\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,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAA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AAY,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,kEAAkE;IAClE,IAAI,YAAY,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACJ,mEAAmE;QACnE,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC7C,uEAAuE;YACvE,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACR,iCAAiC,IAAI,qCAAqC;gBACtE,oEAAoE;gBACpE,+CAA+C,CACtD,CAAC;QACN,CAAC;IACL,CAAC;IAED,2EAA2E;IAC3E,sEAAsE;IACtE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAExB,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -0,0 +1,98 @@
import * as _radix_ui_react_context from '@radix-ui/react-context';
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
type SlotProps$1 = React.ComponentPropsWithoutRef<typeof Slot>;
interface CollectionProps$1 extends SlotProps$1 {
scope: any;
}
declare function createCollection$1<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{
readonly Provider: React.FC<{
children?: React.ReactNode;
scope: any;
}>;
readonly Slot: React.ForwardRefExoticComponent<CollectionProps$1 & React.RefAttributes<HTMLElement>>;
readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & {
children: React.ReactNode;
scope: any;
}> & React.RefAttributes<ItemElement>>;
}, (scope: any) => () => ({
ref: React.RefObject<ItemElement | null>;
} & ItemData)[], _radix_ui_react_context.CreateScope];
declare class OrderedDict<K, V> extends Map<K, V> {
#private;
constructor(iterable?: Iterable<readonly [K, V]> | null | undefined);
set(key: K, value: V): this;
insert(index: number, key: K, value: V): this;
with(index: number, key: K, value: V): OrderedDict<K, V>;
before(key: K): [K, V] | undefined;
/**
* Sets a new key-value pair at the position before the given key.
*/
setBefore(key: K, newKey: K, value: V): this;
after(key: K): [K, V] | undefined;
/**
* Sets a new key-value pair at the position after the given key.
*/
setAfter(key: K, newKey: K, value: V): this;
first(): [K, V] | undefined;
last(): [K, V] | undefined;
clear(): void;
delete(key: K): boolean;
deleteAt(index: number): boolean;
at(index: number): V | undefined;
entryAt(index: number): [K, V] | undefined;
indexOf(key: K): number;
keyAt(index: number): K | undefined;
from(key: K, offset: number): V | undefined;
keyFrom(key: K, offset: number): K | undefined;
find(predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => boolean, thisArg?: any): [K, V] | undefined;
findIndex(predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => boolean, thisArg?: any): number;
filter<KK extends K, VV extends V>(predicate: (entry: [K, V], index: number, dict: OrderedDict<K, V>) => entry is [KK, VV], thisArg?: any): OrderedDict<KK, VV>;
filter(predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown, thisArg?: any): OrderedDict<K, V>;
map<U>(callbackfn: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => U, thisArg?: any): OrderedDict<K, U>;
reduce(callbackfn: (previousValue: [K, V], currentEntry: [K, V], currentIndex: number, dictionary: OrderedDict<K, V>) => [K, V]): [K, V];
reduce(callbackfn: (previousValue: [K, V], currentEntry: [K, V], currentIndex: number, dictionary: OrderedDict<K, V>) => [K, V], initialValue: [K, V]): [K, V];
reduce<U>(callbackfn: (previousValue: U, currentEntry: [K, V], currentIndex: number, dictionary: OrderedDict<K, V>) => U, initialValue: U): U;
reduceRight(callbackfn: (previousValue: [K, V], currentEntry: [K, V], currentIndex: number, dictionary: OrderedDict<K, V>) => [K, V]): [K, V];
reduceRight(callbackfn: (previousValue: [K, V], currentEntry: [K, V], currentIndex: number, dictionary: OrderedDict<K, V>) => [K, V], initialValue: [K, V]): [K, V];
reduceRight<U>(callbackfn: (previousValue: [K, V], currentValue: U, currentIndex: number, dictionary: OrderedDict<K, V>) => U, initialValue: U): U;
toSorted(compareFn?: (a: [K, V], b: [K, V]) => number): OrderedDict<K, V>;
toReversed(): OrderedDict<K, V>;
toSpliced(start: number, deleteCount?: number): OrderedDict<K, V>;
toSpliced(start: number, deleteCount: number, ...items: [K, V][]): OrderedDict<K, V>;
slice(start?: number, end?: number): OrderedDict<K, V>;
every(predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown, thisArg?: any): boolean;
some(predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown, thisArg?: any): boolean;
}
type SlotProps = React.ComponentPropsWithoutRef<typeof Slot>;
interface CollectionProps extends SlotProps {
scope: any;
}
interface BaseItemData {
id?: string;
}
type ItemDataWithElement<ItemData extends BaseItemData, ItemElement extends HTMLElement> = ItemData & {
element: ItemElement;
};
type ItemMap<ItemElement extends HTMLElement, ItemData extends BaseItemData> = OrderedDict<ItemElement, ItemDataWithElement<ItemData, ItemElement>>;
declare function createCollection<ItemElement extends HTMLElement, ItemData extends {} = {}>(name: string): readonly [{
readonly Provider: React.FC<{
children?: React.ReactNode;
scope: any;
state?: [ItemMap: ItemMap<ItemElement, ItemData & BaseItemData>, SetItemMap: React.Dispatch<React.SetStateAction<ItemMap<ItemElement, ItemData & BaseItemData>>>];
}>;
readonly Slot: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLElement>>;
readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & BaseItemData & {
children: React.ReactNode;
scope: any;
}> & React.RefAttributes<ItemElement>>;
}, {
createCollectionScope: _radix_ui_react_context.CreateScope;
useCollection: (scope: any) => ItemMap<ItemElement, ItemData & BaseItemData>;
useInitCollection: () => [ItemMap<ItemElement, ItemData & BaseItemData>, React.Dispatch<React.SetStateAction<ItemMap<ItemElement, ItemData & BaseItemData>>>];
}];
export { type CollectionProps$1 as CollectionProps, createCollection$1 as createCollection, type CollectionProps as unstable_CollectionProps, createCollection as unstable_createCollection };
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/scheduler.native.production.js');
} else {
module.exports = require('./cjs/scheduler.native.development.js');
}
@@ -0,0 +1,25 @@
/**
* @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 UserCog = createLucideIcon("UserCog", [
["circle", { cx: "18", cy: "15", r: "3", key: "gjjjvw" }],
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
["path", { d: "M10 15H6a4 4 0 0 0-4 4v2", key: "1nfge6" }],
["path", { d: "m21.7 16.4-.9-.3", key: "12j9ji" }],
["path", { d: "m15.2 13.9-.9-.3", key: "1fdjdi" }],
["path", { d: "m16.6 18.7.3-.9", key: "heedtr" }],
["path", { d: "m19.1 12.2.3-.9", key: "1af3ki" }],
["path", { d: "m19.6 18.7-.4-1", key: "1x9vze" }],
["path", { d: "m16.8 12.3-.4-1", key: "vqeiwj" }],
["path", { d: "m14.3 16.6 1-.4", key: "1qlj63" }],
["path", { d: "m20.7 13.8 1-.4", key: "1v5t8k" }]
]);
export { UserCog as default };
//# sourceMappingURL=user-cog.js.map
@@ -0,0 +1,42 @@
{
"name": "@humanfs/types",
"version": "0.15.0",
"description": "The TypeScript types for the hfs project.",
"type": "module",
"types": "src/hfs-types.ts",
"exports": {
".": {
"types": "./src/hfs-types.ts"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsc",
"prepare": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/humanwhocodes/humanfs.git"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"filesystem",
"fs",
"hfs",
"files"
],
"author": "Nicholas C. Zakas",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/humanwhocodes/humanfs/issues"
},
"homepage": "https://github.com/humanwhocodes/humanfs#readme",
"engines": {
"node": ">=18.18.0"
},
"devDependencies": {
"typescript": "^5.2.2"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"queue.mjs","sources":["../../../src/view/queue.ts"],"sourcesContent":["import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder).then((animation) => {\n builder.notifyReady(animation)\n animation.finished.finally(next)\n })\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ,GAA4B,EAAE;AAE1C,IAAI,OAAO,GAAiC,IAAI;AAEhD,SAAS,IAAI,GAAA;IACT,OAAO,GAAG,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CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,WAAW,EAAE;AAC5D,QAAA,IAAI,EAAE;IACV;AACJ;AAEM,SAAU,UAAU,CAAC,OAA8B,EAAA;AACrD,IAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AACtB,IAAA,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;AAClC;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"lamp.js","sources":["../../../src/icons/lamp.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Lamp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAyaDhsNCAxMEg0TDggMloiIC8+CiAgPHBhdGggZD0iTTEyIDEydjYiIC8+CiAgPHBhdGggZD0iTTggMjJ2LTJjMC0xLjEuOS0yIDItMmg0YTIgMiAwIDAgMSAyIDJ2Mkg4WiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/lamp\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 Lamp = createLucideIcon('Lamp', [\n ['path', { d: 'M8 2h8l4 10H4L8 2Z', key: '9dma5w' }],\n ['path', { d: 'M12 12v6', key: '3ahymv' }],\n ['path', { d: 'M8 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},C:{"1":"_aO","2":"_OC","196":"rB","516":"_8N LD"},D:{"1":"_oR","2":"_dL","33":"_GL _ME _jE"},E:{"1":"_PD","2":"_u","33":"_RC _tE"},F:{"1":"_FM","2":"_T","33":"_MD _hD"},G:{"1":"_kG","2":"_1","33":"_SD iD"},H:{"2":"1D"},I:{"1":"I","2":"_W","33":"_y"},J:{"2":"D","33":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_xB","33":"_3B"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"CSS Filter Effects",D:true};
@@ -0,0 +1,3 @@
import { MatchEstimated, MatchExtended } from '../../types';
declare const _default: ({ year, separator }: MatchExtended | MatchEstimated) => number;
export default _default;
@@ -0,0 +1,4 @@
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsafeArraySpread" | "anyAssignment" | "anyAssignmentThis" | "unsafeArrayPattern" | "unsafeArrayPatternFromTuple" | "unsafeAssignment" | "unsafeObjectPattern", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,48 @@
import { warning } from 'motion-utils';
import { hex } from '../../value/types/color/hex.mjs';
import { hsla } from '../../value/types/color/hsla.mjs';
import { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';
import { rgba } from '../../value/types/color/rgba.mjs';
import { mixImmediate } from './immediate.mjs';
import { mixNumber } from './number.mjs';
// Linear color space blending
// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw
// Demonstrated http://codepen.io/osublake/pen/xGVVaN
const mixLinearColor = (from, to, v) => {
const fromExpo = from * from;
const expo = v * (to * to - fromExpo) + fromExpo;
return expo < 0 ? 0 : Math.sqrt(expo);
};
const colorTypes = [hex, rgba, hsla];
const getColorType = (v) => colorTypes.find((type) => type.test(v));
function asRGBA(color) {
const type = getColorType(color);
warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable");
if (!Boolean(type))
return false;
let model = type.parse(color);
if (type === hsla) {
// TODO Remove this cast - needed since Motion's stricter typing
model = hslaToRgba(model);
}
return model;
}
const mixColor = (from, to) => {
const fromRGBA = asRGBA(from);
const toRGBA = asRGBA(to);
if (!fromRGBA || !toRGBA) {
return mixImmediate(from, to);
}
const blended = { ...fromRGBA };
return (v) => {
blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);
blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);
return rgba.transform(blended);
};
};
export { mixColor, mixLinearColor };
//# sourceMappingURL=color.mjs.map
@@ -0,0 +1,21 @@
declare const KNOWN_ASSET_TYPES: string[];
declare const KNOWN_ASSET_RE: RegExp;
declare const CSS_LANGS_RE: RegExp;
/**
* Prefix for resolved Ids that are not valid browser import specifiers
*/
declare const VALID_ID_PREFIX = "/@id/";
/**
* Plugins that use 'virtual modules' (e.g. for helper functions), prefix the
* module ID with `\0`, a convention from the rollup ecosystem.
* This prevents other plugins from trying to process the id (like node resolution),
* and core features like sourcemaps can use this info to differentiate between
* virtual modules and regular files.
* `\0` is not a permitted char in import URLs so we have to replace them during
* import analysis. The id will be decoded back before entering the plugins pipeline.
* These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual
* modules in the browser end up encoded as `/@id/__x00__{id}`
*/
declare const NULL_BYTE_PLACEHOLDER = "__x00__";
export { CSS_LANGS_RE, KNOWN_ASSET_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, VALID_ID_PREFIX };
@@ -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 Download = createLucideIcon("Download", [
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
]);
export { Download as default };
//# sourceMappingURL=download.js.map
@@ -0,0 +1 @@
{"version":3,"file":"rewrite.cjs","names":[],"sources":["../../src/rewrite.ts"],"sourcesContent":["import { joinPaths, trimPath } from './path'\nimport type { LocationRewrite } from './router'\n\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\nexport function composeRewrites(rewrites: Array<LocationRewrite>) {\n return {\n input: ({ url }) => {\n for (const rewrite of rewrites) {\n url = executeRewriteInput(rewrite, url)\n }\n return url\n },\n output: ({ url }) => {\n for (let i = rewrites.length - 1; i >= 0; i--) {\n url = executeRewriteOutput(rewrites[i], url)\n }\n return url\n },\n } satisfies LocationRewrite\n}\n\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\nexport function rewriteBasepath(opts: {\n basepath: string\n caseSensitive?: boolean\n}) {\n const trimmedBasepath = trimPath(opts.basepath)\n const normalizedBasepath = `/${trimmedBasepath}`\n const normalizedBasepathWithSlash = `${normalizedBasepath}/`\n const checkBasepath = opts.caseSensitive\n ? normalizedBasepath\n : normalizedBasepath.toLowerCase()\n const checkBasepathWithSlash = opts.caseSensitive\n ? normalizedBasepathWithSlash\n : normalizedBasepathWithSlash.toLowerCase()\n\n return {\n input: ({ url }) => {\n const pathname = opts.caseSensitive\n ? url.pathname\n : url.pathname.toLowerCase()\n\n // Handle exact basepath match (e.g., /my-app -> /)\n if (pathname === checkBasepath) {\n url.pathname = '/'\n } else if (pathname.startsWith(checkBasepathWithSlash)) {\n // Handle basepath with trailing content (e.g., /my-app/users -> /users)\n url.pathname = url.pathname.slice(normalizedBasepath.length)\n }\n return url\n },\n output: ({ url }) => {\n url.pathname = joinPaths(['/', trimmedBasepath, url.pathname])\n return url\n },\n } satisfies LocationRewrite\n}\n\n/** Execute a location input rewrite if provided. */\n/** Execute a location input rewrite if provided. */\nexport function executeRewriteInput(\n rewrite: LocationRewrite | undefined,\n url: URL,\n): URL {\n const res = rewrite?.input?.({ url })\n if (res) {\n if (typeof res === 'string') {\n return new URL(res)\n } else if (res instanceof URL) {\n return res\n }\n }\n return url\n}\n\n/** Execute a location output rewrite if provided. */\n/** Execute a location output rewrite if provided. */\nexport function executeRewriteOutput(\n rewrite: LocationRewrite | undefined,\n url: URL,\n): URL {\n const res = rewrite?.output?.({ url })\n if (res) {\n if (typeof res === 'string') {\n return new URL(res)\n } else if (res instanceof URL) {\n return res\n }\n }\n return url\n}\n"],"mappings":";;;;AAKA,SAAgB,gBAAgB,UAAkC;AAChE,QAAO;EACL,QAAQ,EAAE,UAAU;AAClB,QAAK,MAAM,WAAW,SACpB,OAAM,oBAAoB,SAAS,IAAI;AAEzC,UAAO;;EAET,SAAS,EAAE,UAAU;AACnB,QAAK,IAAI,IAAI,SAAS,SAAS,GAAG,KAAK,GAAG,IACxC,OAAM,qBAAqB,SAAS,IAAI,IAAI;AAE9C,UAAO;;EAEV;;;;AAKH,SAAgB,gBAAgB,MAG7B;CACD,MAAM,kBAAkB,aAAA,SAAS,KAAK,SAAS;CAC/C,MAAM,qBAAqB,IAAI;CAC/B,MAAM,8BAA8B,GAAG,mBAAmB;CAC1D,MAAM,gBAAgB,KAAK,gBACvB,qBACA,mBAAmB,aAAa;CACpC,MAAM,yBAAyB,KAAK,gBAChC,8BACA,4BAA4B,aAAa;AAE7C,QAAO;EACL,QAAQ,EAAE,UAAU;GAClB,MAAM,WAAW,KAAK,gBAClB,IAAI,WACJ,IAAI,SAAS,aAAa;AAG9B,OAAI,aAAa,cACf,KAAI,WAAW;YACN,SAAS,WAAW,uBAAuB,CAEpD,KAAI,WAAW,IAAI,SAAS,MAAM,mBAAmB,OAAO;AAE9D,UAAO;;EAET,SAAS,EAAE,UAAU;AACnB,OAAI,WAAW,aAAA,UAAU;IAAC;IAAK;IAAiB,IAAI;IAAS,CAAC;AAC9D,UAAO;;EAEV;;;;AAKH,SAAgB,oBACd,SACA,KACK;CACL,MAAM,MAAM,SAAS,QAAQ,EAAE,KAAK,CAAC;AACrC,KAAI;MACE,OAAO,QAAQ,SACjB,QAAO,IAAI,IAAI,IAAI;WACV,eAAe,IACxB,QAAO;;AAGX,QAAO;;;;AAKT,SAAgB,qBACd,SACA,KACK;CACL,MAAM,MAAM,SAAS,SAAS,EAAE,KAAK,CAAC;AACtC,KAAI;MACE,OAAO,QAAQ,SACjB,QAAO,IAAI,IAAI,IAAI;WACV,eAAe,IACxB,QAAO;;AAGX,QAAO"}
@@ -0,0 +1,185 @@
import { randomUUID } from 'node:crypto';
import { McpServer } from '../../server/mcp.js';
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
import * as z from 'zod/v4';
import { isInitializeRequest } from '../../types.js';
import { createMcpExpressApp } from '../../server/express.js';
// Create an MCP server with implementation details
const getServer = () => {
const server = new McpServer({
name: 'json-response-streamable-http-server',
version: '1.0.0'
}, {
capabilities: {
logging: {}
}
});
// Register a simple tool that returns a greeting
server.registerTool('greet', {
description: 'A simple greeting tool',
inputSchema: {
name: z.string().describe('Name to greet')
}
}, async ({ name }) => {
return {
content: [
{
type: 'text',
text: `Hello, ${name}!`
}
]
};
});
// Register a tool that sends multiple greetings with notifications
server.registerTool('multi-greet', {
description: 'A tool that sends different greetings with delays between them',
inputSchema: {
name: z.string().describe('Name to greet')
}
}, async ({ name }, extra) => {
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
await server.sendLoggingMessage({
level: 'debug',
data: `Starting multi-greet for ${name}`
}, extra.sessionId);
await sleep(1000); // Wait 1 second before first greeting
await server.sendLoggingMessage({
level: 'info',
data: `Sending first greeting to ${name}`
}, extra.sessionId);
await sleep(1000); // Wait another second before second greeting
await server.sendLoggingMessage({
level: 'info',
data: `Sending second greeting to ${name}`
}, extra.sessionId);
return {
content: [
{
type: 'text',
text: `Good morning, ${name}!`
}
]
};
});
return server;
};
const app = createMcpExpressApp();
// Close sessions that have been idle for IDLE_MS, and keep at most MAX_SESSIONS open
const IDLE_MS = 30 * 60000;
const MAX_SESSIONS = 1000;
const sessions = new Map();
// Count open responses so a long-running request is not treated as idle
const trackResponse = (session, res) => {
if (!res.socket || res.destroyed)
return;
session.open++;
res.on('close', () => {
session.open--;
session.lastActive = Date.now();
});
};
// Close sessions with nothing open and no activity for IDLE_MS
setInterval(() => {
const cutoff = Date.now() - IDLE_MS;
for (const { transport, open, lastActive } of sessions.values()) {
if (open === 0 && lastActive < cutoff)
transport.close().catch(console.error);
}
}, 60000).unref();
app.post('/mcp', async (req, res) => {
console.log('Received MCP request:', req.body);
try {
// Check for existing session ID
const sessionId = req.headers['mcp-session-id'];
const session = sessionId ? sessions.get(sessionId) : undefined;
let transport;
if (session) {
// Reuse existing transport
transport = session.transport;
trackResponse(session, res);
}
else if (!sessionId && isInitializeRequest(req.body)) {
// New initialization request - use JSON response mode
if (sessions.size >= MAX_SESSIONS) {
res.status(503).json({ jsonrpc: '2.0', error: { code: -32000, message: 'Too many open sessions' }, id: null });
return;
}
transport = new StreamableHTTPServerTransport({
sessionIdGenerator: () => randomUUID(),
enableJsonResponse: true, // Enable JSON response mode
onsessioninitialized: sessionId => {
// Store the transport by session ID when session is initialized
// This avoids race conditions where requests might come in before the session is stored
console.log(`Session initialized with ID: ${sessionId}`);
sessions.set(sessionId, { transport, open: 0, lastActive: Date.now() });
}
});
// Set up onclose handler to clean up transport when closed
transport.onclose = () => {
const sid = transport.sessionId;
if (sid && sessions.has(sid)) {
console.log(`Transport closed for session ${sid}, removing from sessions map`);
sessions.delete(sid);
}
};
// Connect the transport to the MCP server BEFORE handling the request
const server = getServer();
await server.connect(transport);
await transport.handleRequest(req, res, req.body);
return; // Already handled
}
else if (sessionId) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
else {
// Invalid request - no session ID and not an initialization request
res.status(400).json({
jsonrpc: '2.0',
error: {
code: -32000,
message: 'Bad Request: No valid session ID provided'
},
id: null
});
return;
}
// Handle the request with existing transport - no need to reconnect
await transport.handleRequest(req, res, req.body);
}
catch (error) {
console.error('Error handling MCP request:', error);
if (!res.headersSent) {
res.status(500).json({
jsonrpc: '2.0',
error: {
code: -32603,
message: 'Internal server error'
},
id: null
});
}
}
});
// Handle GET requests for SSE streams according to spec
app.get('/mcp', async (req, res) => {
// Since this is a very simple example, we don't support GET requests for this server
// The spec requires returning 405 Method Not Allowed in this case
res.status(405).set('Allow', 'POST').send('Method Not Allowed');
});
// Start the server
const PORT = 3000;
app.listen(PORT, error => {
if (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
console.log(`MCP Streamable HTTP Server listening on port ${PORT}`);
});
// Handle server shutdown
process.on('SIGINT', async () => {
console.log('Shutting down server...');
process.exit(0);
});
//# sourceMappingURL=jsonResponseStreamableHttp.js.map
@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["umd:@jridgewell/trace-mapping", "umd:@jridgewell/gen-mapping", "../src/remapping.ts", "../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,2CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,wBAAyB;;;ACAzB,yBAAyE;AACzE,2BAA8C;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ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IAAI,GAAG,IAAI;AAChD;",
"names": ["module", "module", "import_trace_mapping", "source", "import_gen_mapping"]
}
@@ -0,0 +1,28 @@
import { TranslationKeys, OptionsType, OptionsDictionary, OptionsL33tTable, OptionsGraph, RankedDictionaries, Matchers, Matcher, UserInputsOptions, TimeEstimationValues } from './types';
import TrieNode from './matcher/dictionary/variants/matching/unmunger/TrieNode';
export default class Options {
matchers: Matchers;
l33tTable: OptionsL33tTable;
trieNodeRoot: TrieNode;
dictionary: OptionsDictionary;
rankedDictionaries: RankedDictionaries;
rankedDictionariesMaxWordSize: Record<string, number>;
translations: TranslationKeys;
graphs: OptionsGraph;
useLevenshteinDistance: boolean;
levenshteinThreshold: number;
l33tMaxSubstitutions: number;
maxLength: number;
wordSequenceNames: string[];
timeEstimationValues: TimeEstimationValues;
constructor(options?: OptionsType, customMatchers?: Record<string, Matcher>);
isWordSequence(key: string): boolean;
private setOptions;
private setTranslations;
private checkCustomTranslations;
private setRankedDictionaries;
private getRankedDictionariesMaxWordSize;
private buildSanitizedRankedDictionary;
getUserInputsOptions(dictionary?: (string | number)[]): UserInputsOptions;
private addMatcher;
}
@@ -0,0 +1,9 @@
"use client";
import * as React$1 from "react";
//#region src/matchContext.tsx
var matchContext = React$1.createContext(void 0);
var dummyMatchContext = React$1.createContext(void 0);
//#endregion
export { dummyMatchContext, matchContext };
//# sourceMappingURL=matchContext.js.map
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Twitter = createLucideIcon("Twitter", [
[
"path",
{
d: "M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",
key: "pff0z6"
}
]
]);
export { Twitter as default };
//# sourceMappingURL=twitter.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 WifiHigh = createLucideIcon("WifiHigh", [
["path", { d: "M12 20h.01", key: "zekei9" }],
["path", { d: "M5 12.859a10 10 0 0 1 14 0", key: "1x1e6c" }],
["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }]
]);
export { WifiHigh as default };
//# sourceMappingURL=wifi-high.js.map
@@ -0,0 +1,27 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { Referencer } from './Referencer';
import { Visitor } from './Visitor';
export declare class ClassVisitor extends Visitor {
#private;
constructor(referencer: Referencer);
static visit(referencer: Referencer, node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void;
visit(node: TSESTree.Node | null | undefined): void;
protected visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void;
protected visitFunctionParameterTypeAnnotation(node: TSESTree.Parameter): void;
protected visitMethod(node: TSESTree.MethodDefinition): void;
protected visitMethodFunction(node: TSESTree.FunctionExpression): void;
protected visitPropertyBase(node: TSESTree.AccessorProperty | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition): void;
protected visitPropertyDefinition(node: TSESTree.AccessorProperty | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractPropertyDefinition): void;
protected visitType(node: TSESTree.Node | null | undefined): void;
protected AccessorProperty(node: TSESTree.AccessorProperty): void;
protected ClassBody(node: TSESTree.ClassBody): void;
protected Identifier(node: TSESTree.Identifier): void;
protected MethodDefinition(node: TSESTree.MethodDefinition): void;
protected PrivateIdentifier(): void;
protected PropertyDefinition(node: TSESTree.PropertyDefinition): void;
protected StaticBlock(node: TSESTree.StaticBlock): void;
protected TSAbstractAccessorProperty(node: TSESTree.TSAbstractAccessorProperty): void;
protected TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void;
protected TSAbstractPropertyDefinition(node: TSESTree.TSAbstractPropertyDefinition): void;
protected TSIndexSignature(node: TSESTree.TSIndexSignature): void;
}
@@ -0,0 +1,10 @@
import { GLOBAL_SEROVAL, GLOBAL_TSR } from './constants.js';
import { TsrSsrGlobal } from './types.js';
import { AnyRouter } from '../router.js';
declare global {
interface Window {
[GLOBAL_TSR]?: TsrSsrGlobal;
[GLOBAL_SEROVAL]?: any;
}
}
export declare function hydrate(router: AnyRouter): Promise<any>;
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -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 FlipVertical2 = createLucideIcon("FlipVertical2", [
["path", { d: "m17 3-5 5-5-5h10", key: "1ftt6x" }],
["path", { d: "m17 21-5-5-5 5h10", key: "1m0wmu" }],
["path", { d: "M4 12H2", key: "rhcxmi" }],
["path", { d: "M10 12H8", key: "s88cx1" }],
["path", { d: "M16 12h-2", key: "10asgb" }],
["path", { d: "M22 12h-2", key: "14jgyd" }]
]);
export { FlipVertical2 as default };
//# sourceMappingURL=flip-vertical-2.js.map
@@ -0,0 +1,18 @@
import type { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
export declare const isNodeOfType: <NodeType extends AST_NODE_TYPES>(nodeType: NodeType) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
type: NodeType;
}>;
export declare const isNodeOfTypes: <NodeTypes extends readonly AST_NODE_TYPES[]>(nodeTypes: NodeTypes) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
type: NodeTypes[number];
}>;
export declare const isNodeOfTypeWithConditions: <NodeType extends AST_NODE_TYPES, ExtractedNode extends Extract<TSESTree.Node, {
type: NodeType;
}>, Conditions extends Partial<ExtractedNode>>(nodeType: NodeType, conditions: Conditions) => ((node: TSESTree.Node | null | undefined) => node is Conditions & ExtractedNode);
export declare const isTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_TYPES, ExtractedToken extends Extract<TSESTree.Token, {
type: TokenType;
}>, Conditions extends Partial<{
type: TokenType;
} & TSESTree.Token>>(tokenType: TokenType, conditions: Conditions) => ((token: TSESTree.Token | null | undefined) => token is Conditions & ExtractedToken);
export declare const isNotTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_TYPES, ExtractedToken extends Extract<TSESTree.Token, {
type: TokenType;
}>, Conditions extends Partial<ExtractedToken>>(tokenType: TokenType, conditions: Conditions) => ((token: TSESTree.Token | null | undefined) => token is Exclude<TSESTree.Token, Conditions & ExtractedToken>);
@@ -0,0 +1 @@
{"version":3,"file":"chart-column-decreasing.js","sources":["../../../src/icons/chart-column-decreasing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartColumnDecreasing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMgMTdWOSIgLz4KICA8cGF0aCBkPSJNMTggMTd2LTMiIC8+CiAgPHBhdGggZD0iTTMgM3YxNmEyIDIgMCAwIDAgMiAyaDE2IiAvPgogIDxwYXRoIGQ9Ik04IDE3VjUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-column-decreasing\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 ChartColumnDecreasing = createLucideIcon('ChartColumnDecreasing', [\n ['path', { d: 'M13 17V9', key: '1fwyjl' }],\n ['path', { d: 'M18 17v-3', key: '1sqioe' }],\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }],\n ['path', { d: 'M8 17V5', key: '1wzmnc' }],\n]);\n\nexport default ChartColumnDecreasing;\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,CAAA,CAAA,CAAA,CAAA,CAAwB,iBAAiB,uBAAyB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtE,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,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,37 @@
import * as ts from 'typescript';
/**
* Checks if the given type is (or accepts) nullable
*/
export declare function isNullableType(type: ts.Type): boolean;
/**
* Checks if the given type is either an array type,
* or a union made up solely of array types.
*/
export declare function isTypeArrayTypeOrUnionOfArrayTypes(type: ts.Type, checker: ts.TypeChecker): boolean;
/**
* @returns true if the type is `never`
*/
export declare function isTypeNeverType(type: ts.Type): boolean;
/**
* @returns true if the type is `unknown`
*/
export declare function isTypeUnknownType(type: ts.Type): boolean;
export declare function isTypeReferenceType(type: ts.Type): type is ts.TypeReference;
/**
* @returns true if the type is `any`
*/
export declare function isTypeAnyType(type: ts.Type): boolean;
/**
* @returns true if the type is `any[]`
*/
export declare function isTypeAnyArrayType(type: ts.Type, checker: ts.TypeChecker): boolean;
/**
* @returns true if the type is `unknown[]`
*/
export declare function isTypeUnknownArrayType(type: ts.Type, checker: ts.TypeChecker): boolean;
/**
* @returns Whether a type is an instance of the parent type, including for the parent's base types.
*/
export declare function typeIsOrHasBaseType(type: ts.Type, parentType: ts.Type): boolean;
export declare function isTypeBigIntLiteralType(type: ts.Type): type is ts.BigIntLiteralType;
export declare function isTypeTemplateLiteralType(type: ts.Type): type is ts.TemplateLiteralType;
@@ -0,0 +1 @@
{"version":3,"file":"file-x-2.js","sources":["../../../src/icons/file-x-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileX2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJtOCAxMi41LTUgNSIgLz4KICA8cGF0aCBkPSJtMyAxMi41IDUgNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-x-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileX2 = createLucideIcon('FileX2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'm8 12.5-5 5', key: 'b853mi' }],\n ['path', { d: 'm3 12.5 5 5', key: '1qls4r' }],\n]);\n\nexport default FileX2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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K,UAAU,CAAA;AAC9C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ESLintScopeVariable = void 0;
const VariableBase_1 = require("./VariableBase");
/**
* ESLint defines global variables using the eslint-scope Variable class
* This is declared here for consumers to use
*/
class ESLintScopeVariable extends VariableBase_1.VariableBase {
/**
* Written to by ESLint.
* If this key exists, this variable is a global variable added by ESLint.
* If this is `true`, this variable can be assigned arbitrary values.
* If this is `false`, this variable is readonly.
*/
writeable; // note that this isn't a typo - ESlint uses this spelling here
/**
* Written to by ESLint.
* This property is undefined if there are no globals comment directives.
* The array of globals comment directives which defined this global variable in the source code file.
*/
eslintExplicitGlobal;
/**
* Written to by ESLint.
* The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives.
*/
eslintImplicitGlobalSetting;
/**
* Written to by ESLint.
* If this key exists, it is a global variable added by ESLint.
* If `true`, this global variable was defined by a globals comment directive in the source code file.
*/
eslintExplicitGlobalComments;
}
exports.ESLintScopeVariable = ESLintScopeVariable;
@@ -0,0 +1,203 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
const rules_1 = require("../rules");
const applicability_1 = require("./applicability");
const errors_1 = require("../errors");
const codegen_1 = require("../codegen");
const util_1 = require("../util");
var DataType;
(function (DataType) {
DataType[DataType["Correct"] = 0] = "Correct";
DataType[DataType["Wrong"] = 1] = "Wrong";
})(DataType || (exports.DataType = DataType = {}));
function getSchemaTypes(schema) {
const types = getJSONTypes(schema.type);
const hasNull = types.includes("null");
if (hasNull) {
if (schema.nullable === false)
throw new Error("type: null contradicts nullable: false");
}
else {
if (!types.length && schema.nullable !== undefined) {
throw new Error('"nullable" cannot be used without "type"');
}
if (schema.nullable === true)
types.push("null");
}
return types;
}
exports.getSchemaTypes = getSchemaTypes;
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
function getJSONTypes(ts) {
const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
if (types.every(rules_1.isJSONType))
return types;
throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
}
exports.getJSONTypes = getJSONTypes;
function coerceAndCheckDataType(it, types) {
const { gen, data, opts } = it;
const coerceTo = coerceToTypes(types, opts.coerceTypes);
const checkTypes = types.length > 0 &&
!(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
if (checkTypes) {
const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
gen.if(wrongType, () => {
if (coerceTo.length)
coerceData(it, types, coerceTo);
else
reportTypeError(it);
});
}
return checkTypes;
}
exports.coerceAndCheckDataType = coerceAndCheckDataType;
const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
function coerceToTypes(types, coerceTypes) {
return coerceTypes
? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
: [];
}
function coerceData(it, types, coerceTo) {
const { gen, data, opts } = it;
const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`);
const coerced = gen.let("coerced", (0, codegen_1._) `undefined`);
if (opts.coerceTypes === "array") {
gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
.assign(data, (0, codegen_1._) `${data}[0]`)
.assign(dataType, (0, codegen_1._) `typeof ${data}`)
.if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
}
gen.if((0, codegen_1._) `${coerced} !== undefined`);
for (const t of coerceTo) {
if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
coerceSpecificType(t);
}
}
gen.else();
reportTypeError(it);
gen.endIf();
gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {
gen.assign(data, coerced);
assignParentData(it, coerced);
});
function coerceSpecificType(t) {
switch (t) {
case "string":
gen
.elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`)
.assign(coerced, (0, codegen_1._) `"" + ${data}`)
.elseIf((0, codegen_1._) `${data} === null`)
.assign(coerced, (0, codegen_1._) `""`);
return;
case "number":
gen
.elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
|| (${dataType} == "string" && ${data} && ${data} == +${data})`)
.assign(coerced, (0, codegen_1._) `+${data}`);
return;
case "integer":
gen
.elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
|| (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
.assign(coerced, (0, codegen_1._) `+${data}`);
return;
case "boolean":
gen
.elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`)
.assign(coerced, false)
.elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`)
.assign(coerced, true);
return;
case "null":
gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`);
gen.assign(coerced, null);
return;
case "array":
gen
.elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number"
|| ${dataType} === "boolean" || ${data} === null`)
.assign(coerced, (0, codegen_1._) `[${data}]`);
}
}
}
function assignParentData({ gen, parentData, parentDataProperty }, expr) {
// TODO use gen.property
gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));
}
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
let cond;
switch (dataType) {
case "null":
return (0, codegen_1._) `${data} ${EQ} null`;
case "array":
cond = (0, codegen_1._) `Array.isArray(${data})`;
break;
case "object":
cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
break;
case "integer":
cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);
break;
case "number":
cond = numCond();
break;
default:
return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;
}
return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
function numCond(_cond = codegen_1.nil) {
return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);
}
}
exports.checkDataType = checkDataType;
function checkDataTypes(dataTypes, data, strictNums, correct) {
if (dataTypes.length === 1) {
return checkDataType(dataTypes[0], data, strictNums, correct);
}
let cond;
const types = (0, util_1.toHash)(dataTypes);
if (types.array && types.object) {
const notObj = (0, codegen_1._) `typeof ${data} != "object"`;
cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;
delete types.null;
delete types.array;
delete types.object;
}
else {
cond = codegen_1.nil;
}
if (types.number)
delete types.integer;
for (const t in types)
cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
return cond;
}
exports.checkDataTypes = checkDataTypes;
const typeError = {
message: ({ schema }) => `must be ${schema}`,
params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,
};
function reportTypeError(it) {
const cxt = getTypeErrorContext(it);
(0, errors_1.reportError)(cxt, typeError);
}
exports.reportTypeError = reportTypeError;
function getTypeErrorContext(it) {
const { gen, data, schema } = it;
const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
return {
gen,
keyword: "type",
data,
schema: schema.type,
schemaCode,
schemaValue: schemaCode,
parentSchema: schema,
params: {},
it,
};
}
//# sourceMappingURL=dataType.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 Tally3 = createLucideIcon("Tally3", [
["path", { d: "M4 4v16", key: "6qkkli" }],
["path", { d: "M9 4v16", key: "81ygyz" }],
["path", { d: "M14 4v16", key: "12vmem" }]
]);
export { Tally3 as default };
//# sourceMappingURL=tally-3.js.map
@@ -0,0 +1,5 @@
throw new Error(
'Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead.'
+ '\n\nIf you are using "import" in your source code, then it\'s possible it was bundled into require() automatically by your bundler. '
+ 'In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic import() which is available in all CommonJS modules.',
)
@@ -0,0 +1 @@
{"version":3,"file":"square-sigma.js","sources":["../../../src/icons/square-sigma.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareSigma\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xNiA4LjlWN0g4bDQgNS00IDVoOHYtMS45IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-sigma\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 SquareSigma = createLucideIcon('SquareSigma', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M16 8.9V7H8l4 5-4 5h8v-1.9', key: '9nih0i' }],\n]);\n\nexport default SquareSigma;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,C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ME","2":"LE"}},B:1,C:"unhandledrejection/rejectionhandled events",D:true};
@@ -0,0 +1,726 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TSAnyKeyword = TSAnyKeyword;
exports.TSArrayType = TSArrayType;
exports.TSAsExpression = TSAsExpression;
exports.TSBigIntKeyword = TSBigIntKeyword;
exports.TSBooleanKeyword = TSBooleanKeyword;
exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
exports.TSInterfaceHeritage = exports.TSClassImplements = TSClassImplements;
exports.TSConditionalType = TSConditionalType;
exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
exports.TSConstructorType = TSConstructorType;
exports.TSDeclareFunction = TSDeclareFunction;
exports.TSDeclareMethod = TSDeclareMethod;
exports.TSEnumBody = TSEnumBody;
exports.TSEnumDeclaration = TSEnumDeclaration;
exports.TSEnumMember = TSEnumMember;
exports.TSExportAssignment = TSExportAssignment;
exports.TSExternalModuleReference = TSExternalModuleReference;
exports.TSFunctionType = TSFunctionType;
exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
exports.TSImportType = TSImportType;
exports.TSIndexSignature = TSIndexSignature;
exports.TSIndexedAccessType = TSIndexedAccessType;
exports.TSInferType = TSInferType;
exports.TSInstantiationExpression = TSInstantiationExpression;
exports.TSInterfaceBody = TSInterfaceBody;
exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
exports.TSIntersectionType = TSIntersectionType;
exports.TSIntrinsicKeyword = TSIntrinsicKeyword;
exports.TSLiteralType = TSLiteralType;
exports.TSMappedType = TSMappedType;
exports.TSMethodSignature = TSMethodSignature;
exports.TSModuleBlock = TSModuleBlock;
exports.TSModuleDeclaration = TSModuleDeclaration;
exports.TSNamedTupleMember = TSNamedTupleMember;
exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
exports.TSNeverKeyword = TSNeverKeyword;
exports.TSNonNullExpression = TSNonNullExpression;
exports.TSNullKeyword = TSNullKeyword;
exports.TSNumberKeyword = TSNumberKeyword;
exports.TSObjectKeyword = TSObjectKeyword;
exports.TSOptionalType = TSOptionalType;
exports.TSParameterProperty = TSParameterProperty;
exports.TSParenthesizedType = TSParenthesizedType;
exports.TSPropertySignature = TSPropertySignature;
exports.TSQualifiedName = TSQualifiedName;
exports.TSRestType = TSRestType;
exports.TSSatisfiesExpression = TSSatisfiesExpression;
exports.TSStringKeyword = TSStringKeyword;
exports.TSSymbolKeyword = TSSymbolKeyword;
exports.TSTemplateLiteralType = TSTemplateLiteralType;
exports.TSThisType = TSThisType;
exports.TSTupleType = TSTupleType;
exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
exports.TSTypeAnnotation = TSTypeAnnotation;
exports.TSTypeAssertion = TSTypeAssertion;
exports.TSTypeLiteral = TSTypeLiteral;
exports.TSTypeOperator = TSTypeOperator;
exports.TSTypeParameter = TSTypeParameter;
exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
exports.TSTypePredicate = TSTypePredicate;
exports.TSTypeQuery = TSTypeQuery;
exports.TSTypeReference = TSTypeReference;
exports.TSUndefinedKeyword = TSUndefinedKeyword;
exports.TSUnionType = TSUnionType;
exports.TSUnknownKeyword = TSUnknownKeyword;
exports.TSVoidKeyword = TSVoidKeyword;
exports._tsPrintClassMemberModifiers = _tsPrintClassMemberModifiers;
var _methods = require("./methods.js");
var _classes = require("./classes.js");
var _templateLiterals = require("./template-literals.js");
function TSTypeAnnotation(node, parent) {
this.token((parent.type === "TSFunctionType" || parent.type === "TSConstructorType") && parent.typeAnnotation === node ? "=>" : ":");
this.space();
if (node.optional) this.tokenChar(63);
this.print(node.typeAnnotation);
}
function TSTypeParameterInstantiation(node, parent) {
this.tokenChar(60);
let printTrailingSeparator = parent.type === "ArrowFunctionExpression" && node.params.length === 1;
if (this.tokenMap && node.start != null && node.end != null) {
printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, t => this.tokenMap.matchesOriginal(t, ",")));
printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma(">"));
}
this.printList(node.params, printTrailingSeparator);
this.tokenChar(62);
}
function TSTypeParameter(node) {
if (node.const) {
this.word("const");
this.space();
}
if (node.in) {
this.word("in");
this.space();
}
if (node.out) {
this.word("out");
this.space();
}
this.word(node.name);
if (node.constraint) {
this.space();
this.word("extends");
this.space();
this.print(node.constraint);
}
if (node.default) {
this.space();
this.tokenChar(61);
this.space();
this.print(node.default);
}
}
function TSParameterProperty(node) {
if (node.accessibility) {
this.word(node.accessibility);
this.space();
}
if (node.readonly) {
this.word("readonly");
this.space();
}
_methods._param.call(this, node.parameter);
}
function TSDeclareFunction(node, parent) {
if (node.declare) {
this.word("declare");
this.space();
}
_methods._functionHead.call(this, node, parent, false);
this.semicolon();
}
function TSDeclareMethod(node) {
_classes._classMethodHead.call(this, node);
this.semicolon();
}
function TSQualifiedName(node) {
this.print(node.left);
this.tokenChar(46);
this.print(node.right);
}
function TSCallSignatureDeclaration(node) {
tsPrintSignatureDeclarationBase.call(this, node);
maybePrintTrailingCommaOrSemicolon(this, node);
}
function maybePrintTrailingCommaOrSemicolon(printer, node) {
if (!printer.tokenMap || !node.start || !node.end) {
printer.semicolon();
return;
}
if (printer.tokenMap.endMatches(node, ",")) {
printer.token(",");
} else if (printer.tokenMap.endMatches(node, ";")) {
printer.semicolon();
}
}
function TSConstructSignatureDeclaration(node) {
this.word("new");
this.space();
tsPrintSignatureDeclarationBase.call(this, node);
maybePrintTrailingCommaOrSemicolon(this, node);
}
function TSPropertySignature(node) {
const {
readonly
} = node;
if (readonly) {
this.word("readonly");
this.space();
}
tsPrintPropertyOrMethodName.call(this, node);
this.print(node.typeAnnotation);
maybePrintTrailingCommaOrSemicolon(this, node);
}
function tsPrintPropertyOrMethodName(node) {
if (node.computed) {
this.tokenChar(91);
}
this.print(node.key);
if (node.computed) {
this.tokenChar(93);
}
if (node.optional) {
this.tokenChar(63);
}
}
function TSMethodSignature(node) {
const {
kind
} = node;
if (kind === "set" || kind === "get") {
this.word(kind);
this.space();
}
tsPrintPropertyOrMethodName.call(this, node);
tsPrintSignatureDeclarationBase.call(this, node);
maybePrintTrailingCommaOrSemicolon(this, node);
}
function TSIndexSignature(node) {
const {
readonly,
static: isStatic
} = node;
if (isStatic) {
this.word("static");
this.space();
}
if (readonly) {
this.word("readonly");
this.space();
}
this.tokenChar(91);
_methods._parameters.call(this, node.parameters, 93);
this.print(node.typeAnnotation);
maybePrintTrailingCommaOrSemicolon(this, node);
}
function TSAnyKeyword() {
this.word("any");
}
function TSBigIntKeyword() {
this.word("bigint");
}
function TSUnknownKeyword() {
this.word("unknown");
}
function TSNumberKeyword() {
this.word("number");
}
function TSObjectKeyword() {
this.word("object");
}
function TSBooleanKeyword() {
this.word("boolean");
}
function TSStringKeyword() {
this.word("string");
}
function TSSymbolKeyword() {
this.word("symbol");
}
function TSVoidKeyword() {
this.word("void");
}
function TSUndefinedKeyword() {
this.word("undefined");
}
function TSNullKeyword() {
this.word("null");
}
function TSNeverKeyword() {
this.word("never");
}
function TSIntrinsicKeyword() {
this.word("intrinsic");
}
function TSThisType() {
this.word("this");
}
function TSFunctionType(node) {
tsPrintFunctionOrConstructorType.call(this, node);
}
function TSConstructorType(node) {
if (node.abstract) {
this.word("abstract");
this.space();
}
this.word("new");
this.space();
tsPrintFunctionOrConstructorType.call(this, node);
}
function tsPrintFunctionOrConstructorType(node) {
const {
typeParameters
} = node;
const parameters = node.parameters;
this.print(typeParameters);
this.tokenChar(40);
_methods._parameters.call(this, parameters, 41);
this.space();
const returnType = node.typeAnnotation;
this.print(returnType);
}
function TSTypeReference(node) {
const typeArguments = node.typeParameters;
this.print(node.typeName, !!typeArguments);
this.print(typeArguments);
}
function TSTypePredicate(node) {
if (node.asserts) {
this.word("asserts");
this.space();
}
this.print(node.parameterName);
if (node.typeAnnotation) {
this.space();
this.word("is");
this.space();
this.print(node.typeAnnotation.typeAnnotation);
}
}
function TSTypeQuery(node) {
this.word("typeof");
this.space();
this.print(node.exprName);
const typeArguments = node.typeParameters;
if (typeArguments) {
this.print(typeArguments);
}
}
function TSTypeLiteral(node) {
printBraced(this, node, () => this.printJoin(node.members, true, true, undefined, undefined, true));
}
function TSArrayType(node) {
this.print(node.elementType, true);
this.tokenChar(91);
this.tokenChar(93);
}
function TSTupleType(node) {
this.tokenChar(91);
this.printList(node.elementTypes, this.shouldPrintTrailingComma("]"));
this.tokenChar(93);
}
function TSOptionalType(node) {
this.print(node.typeAnnotation);
this.tokenChar(63);
}
function TSRestType(node) {
this.token("...");
this.print(node.typeAnnotation);
}
function TSNamedTupleMember(node) {
this.print(node.label);
if (node.optional) this.tokenChar(63);
this.tokenChar(58);
this.space();
this.print(node.elementType);
}
function TSUnionType(node) {
tsPrintUnionOrIntersectionType(this, node, "|");
}
function TSIntersectionType(node) {
tsPrintUnionOrIntersectionType(this, node, "&");
}
function tsPrintUnionOrIntersectionType(printer, node, sep) {
var _printer$tokenMap;
let hasLeadingToken = 0;
if ((_printer$tokenMap = printer.tokenMap) != null && _printer$tokenMap.startMatches(node, sep)) {
hasLeadingToken = 1;
printer.token(sep);
}
printer.printJoin(node.types, undefined, undefined, function (i) {
this.space();
this.token(sep, undefined, i + hasLeadingToken);
this.space();
});
}
function TSConditionalType(node) {
this.print(node.checkType);
this.space();
this.word("extends");
this.space();
this.print(node.extendsType);
this.space();
this.tokenChar(63);
this.space();
this.print(node.trueType);
this.space();
this.tokenChar(58);
this.space();
this.print(node.falseType);
}
function TSInferType(node) {
this.word("infer");
this.print(node.typeParameter);
}
function TSParenthesizedType(node) {
this.tokenChar(40);
this.print(node.typeAnnotation);
this.tokenChar(41);
}
function TSTypeOperator(node) {
this.word(node.operator);
this.space();
this.print(node.typeAnnotation);
}
function TSIndexedAccessType(node) {
this.print(node.objectType, true);
this.tokenChar(91);
this.print(node.indexType);
this.tokenChar(93);
}
function TSMappedType(node) {
const {
nameType,
optional,
readonly,
typeAnnotation
} = node;
this.tokenChar(123);
const oldNoLineTerminatorAfterNode = this.enterDelimited();
this.space();
if (readonly) {
tokenIfPlusMinus(this, readonly);
this.word("readonly");
this.space();
}
this.tokenChar(91);
this.word(node.typeParameter.name);
this.space();
this.word("in");
this.space();
this.print(node.typeParameter.constraint, undefined, true);
if (nameType) {
this.space();
this.word("as");
this.space();
this.print(nameType, undefined, true);
}
this.tokenChar(93);
if (optional) {
tokenIfPlusMinus(this, optional);
this.tokenChar(63);
}
if (typeAnnotation) {
this.tokenChar(58);
this.space();
this.print(typeAnnotation, undefined, true);
}
this.space();
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
this.tokenChar(125);
}
function tokenIfPlusMinus(self, tok) {
if (tok !== true) {
self.token(tok);
}
}
function TSTemplateLiteralType(node) {
_templateLiterals._printTemplate.call(this, node, node.types);
}
function TSLiteralType(node) {
this.print(node.literal);
}
function TSClassImplements(node) {
this.print(node.expression);
this.print(node.typeArguments);
}
function TSInterfaceDeclaration(node) {
const {
declare,
id,
typeParameters,
extends: extendz,
body
} = node;
if (declare) {
this.word("declare");
this.space();
}
this.word("interface");
this.space();
this.print(id);
this.print(typeParameters);
if (extendz != null && extendz.length) {
this.space();
this.word("extends");
this.space();
this.printList(extendz);
}
this.space();
this.print(body);
}
function TSInterfaceBody(node) {
printBraced(this, node, () => this.printJoin(node.body, true, true, undefined, undefined, true));
}
function TSTypeAliasDeclaration(node) {
const {
declare,
id,
typeParameters,
typeAnnotation
} = node;
if (declare) {
this.word("declare");
this.space();
}
this.word("type");
this.space();
this.print(id);
this.print(typeParameters);
this.space();
this.tokenChar(61);
this.space();
this.print(typeAnnotation);
this.semicolon();
}
function TSAsExpression(node) {
const {
expression,
typeAnnotation
} = node;
this.print(expression, true);
this.space();
this.word("as");
this.space();
this.print(typeAnnotation);
}
function TSSatisfiesExpression(node) {
const {
expression,
typeAnnotation
} = node;
this.print(expression, true);
this.space();
this.word("satisfies");
this.space();
this.print(typeAnnotation);
}
function TSTypeAssertion(node) {
const {
typeAnnotation,
expression
} = node;
this.tokenChar(60);
this.print(typeAnnotation);
this.tokenChar(62);
this.space();
this.print(expression);
}
function TSInstantiationExpression(node) {
this.print(node.expression);
this.print(node.typeParameters);
}
function TSEnumDeclaration(node) {
const {
declare,
const: isConst,
id
} = node;
if (declare) {
this.word("declare");
this.space();
}
if (isConst) {
this.word("const");
this.space();
}
this.word("enum");
this.space();
this.print(id);
this.space();
TSEnumBody.call(this, node);
}
function TSEnumBody(node) {
printBraced(this, node, () => {
var _this$shouldPrintTrai;
return this.printList(node.members, (_this$shouldPrintTrai = this.shouldPrintTrailingComma("}")) != null ? _this$shouldPrintTrai : true, true, true, undefined, true);
});
}
function TSEnumMember(node) {
const {
id,
initializer
} = node;
this.print(id);
if (initializer) {
this.space();
this.tokenChar(61);
this.space();
this.print(initializer);
}
}
function TSModuleDeclaration(node) {
const {
declare,
id,
kind
} = node;
if (declare) {
this.word("declare");
this.space();
}
if (!node.global) {
this.word(kind != null ? kind : id.type === "Identifier" ? "namespace" : "module");
this.space();
}
this.print(id);
if (!node.body) {
this.semicolon();
return;
}
let body = node.body;
while (body.type === "TSModuleDeclaration") {
this.tokenChar(46);
this.print(body.id);
body = body.body;
}
this.space();
this.print(body);
}
function TSModuleBlock(node) {
printBraced(this, node, () => this.printSequence(node.body, true, true));
}
function TSImportType(node) {
const {
qualifier,
options
} = node;
this.word("import");
this.tokenChar(40);
this.print(node.argument);
if (options) {
this.tokenChar(44);
this.print(options);
}
this.tokenChar(41);
if (qualifier) {
this.tokenChar(46);
this.print(qualifier);
}
const typeArguments = node.typeParameters;
if (typeArguments) {
this.print(typeArguments);
}
}
function TSImportEqualsDeclaration(node) {
const {
id,
moduleReference
} = node;
if (node.isExport) {
this.word("export");
this.space();
}
this.word("import");
this.space();
this.print(id);
this.space();
this.tokenChar(61);
this.space();
this.print(moduleReference);
this.semicolon();
}
function TSExternalModuleReference(node) {
this.token("require(");
this.print(node.expression);
this.tokenChar(41);
}
function TSNonNullExpression(node) {
this.print(node.expression);
this.tokenChar(33);
this.setLastChar(33);
}
function TSExportAssignment(node) {
this.word("export");
this.space();
this.tokenChar(61);
this.space();
this.print(node.expression);
this.semicolon();
}
function TSNamespaceExportDeclaration(node) {
this.word("export");
this.space();
this.word("as");
this.space();
this.word("namespace");
this.space();
this.print(node.id);
this.semicolon();
}
function tsPrintSignatureDeclarationBase(node) {
const {
typeParameters
} = node;
const parameters = node.parameters;
this.print(typeParameters);
this.tokenChar(40);
_methods._parameters.call(this, parameters, 41);
const returnType = node.typeAnnotation;
this.print(returnType);
}
function _tsPrintClassMemberModifiers(node) {
const isPrivateField = node.type === "ClassPrivateProperty";
const isPublicField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty";
printModifiersList(this, node, [isPublicField && node.declare && "declare", !isPrivateField && node.accessibility]);
if (node.static) {
this.word("static");
this.space();
}
printModifiersList(this, node, [!isPrivateField && node.abstract && "abstract", !isPrivateField && node.override && "override", (isPublicField || isPrivateField) && node.readonly && "readonly"]);
}
function printBraced(printer, node, cb) {
printer.token("{");
const oldNoLineTerminatorAfterNode = printer.enterDelimited();
cb();
printer._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
printer.rightBrace(node);
}
function printModifiersList(printer, node, modifiers) {
var _printer$tokenMap2;
const modifiersSet = new Set();
for (const modifier of modifiers) {
if (modifier) modifiersSet.add(modifier);
}
(_printer$tokenMap2 = printer.tokenMap) == null || _printer$tokenMap2.find(node, tok => {
if (modifiersSet.has(tok.value)) {
printer.token(tok.value);
printer.space();
modifiersSet.delete(tok.value);
return modifiersSet.size === 0;
}
return false;
});
for (const modifier of modifiersSet) {
printer.word(modifier);
printer.space();
}
}
//# sourceMappingURL=typescript.js.map
@@ -0,0 +1,411 @@
flf2a$ 4 4 18 16 2
4max.flf by Philip Menke (philippe@dds.nl)
April 1995
$ $#
$ $#
$ $#
$ $##
d8b$#
Y8P$#
`"'$#
(8)$##
o8o o8o$#
`"' `"'$#
$#
$##
__88_88__$#
""88"88""$#
__88_88__$#
""88"88""$##
.dPIIY8$#
`YbII "$#
o.`II8b$#
8boIIP'$##
.o. dP $#
`"'dP $#
dP.o.$#
dP `"'$##
d888 $#
dP_______$#
Yb"""88""$#
`Ybo 88 $##
.o.$#
,dP'$#
$#
$##
dP$#
dP $#
Yb $#
Yb$##
Yb $#
Yb$#
dP$#
dP $##
o $#
`8.8.8'$#
.8.8.8.$#
" $##
oo $#
___88___$#
"""88"""$#
"" $##
$#
$#
.o.$#
,dP'$##
$#
________$#
""""""""$#
$##
$#
$#
.o.$#
`"'$##
dP$#
dP $#
dP $#
dP $##
dP"Yb $#
dP Yb$#
Yb dP$#
YbodP $##
.d$#
.d88$#
88$#
88$##
oP"Yb.$#
"' dP'$#
dP' $#
.d8888$##
88888$#
.dP$#
o `Yb$#
YbodP$##
dP88 $#
dP 88 $#
d888888$#
88 $##
888888$#
88oo."$#
`8b$#
8888P'$##
dP' $#
.d8' $#
8P"""Yb$#
`YboodP$##
888888P$#
dP $#
dP $#
dP $##
.dP"o.$#
`8b.d'$#
d'`Y8b$#
`bodP'$##
dP""Yb$#
Ybood8$#
.8P'$#
.dP' $##
.o.$#
`"'$#
.o.$#
`"'$##
.o.$#
`"'$#
.o.$#
,dP'$##
.dP'$#
.dP' $#
`Yb. $#
`Yb.$##
$#
oooooo$#
______$#
""""""$##
`Yb. $#
`Yb.$#
.dP'$#
.dP' $##
oP"Yb.$#
"'.dP'$#
8P $#
(8) $##
dP""Yb $#
dP PY Yb$#
Yb boodP$#
Ybooo $##
db $#
dPYb $#
dP__Yb $#
dP""""Yb$##
88""Yb$#
88__dP$#
88""Yb$#
88oodP$##
dP""b8$#
dP `"$#
Yb $#
YboodP$##
8888b. $#
8I Yb$#
8I dY$#
8888Y" $##
888888$#
88__ $#
88"" $#
888888$##
888888$#
88__ $#
88"" $#
88 $##
dP""b8$#
dP `"$#
Yb "88$#
YboodP$##
88 88$#
88 88$#
888888$#
88 88$##
88$#
88$#
88$#
88$##
88888$#
88$#
o. 88$#
"bodP'$##
88 dP$#
88odP $#
88"Yb $#
88 Yb$##
88 $#
88 $#
88 .o$#
88ood8$##
8b d8$#
88b d88$#
88YbdP88$#
88 YY 88$##
88b 88$#
88Yb88$#
88 Y88$#
88 Y8$##
dP"Yb $#
dP Yb$#
Yb dP$#
YbodP $##
88""Yb$#
88__dP$#
88""" $#
88 $##
dP"Yb $#
dP Yb$#
Yb b dP$#
`"YoYo$##
88""Yb$#
88__dP$#
88"Yb $#
88 Yb$##
.dP"Y8$#
`Ybo."$#
o.`Y8b$#
8bodP'$##
888888$#
88 $#
88 $#
88 $##
88 88$#
88 88$#
Y8 8P$#
`YbodP'$##
Yb dP$#
Yb dP $#
YbdP $#
YP $##
Yb dP$#
Yb db dP $#
YbdPYbdP $#
YP YP $##
Yb dP$#
YbdP $#
dPYb $#
dP Yb$##
Yb dP$#
YbdP $#
8P $#
dP $##
8888P$#
dP $#
dP $#
d8888$##
88888$#
88 $#
88 $#
88888$##
Yb $#
Yb $#
Yb $#
Yb$##
88888$#
88$#
88$#
88888$##
.db. $#
.dP'`Yb.$#
$#
$##
$#
$#
$#
oooooooooo$##
.o. $#
`Yb.$#
$#
$##
db $#
dPYb $#
dP__Yb $#
dP""""Yb$##
88""Yb$#
88__dP$#
88""Yb$#
88oodP$##
dP""b8$#
dP `"$#
Yb $#
YboodP$##
8888b. $#
8I Yb$#
8I dY$#
8888Y" $##
888888$#
88__ $#
88"" $#
888888$##
888888$#
88__ $#
88"" $#
88 $##
dP""b8$#
dP `"$#
Yb "88$#
YboodP$##
88 88$#
88 88$#
888888$#
88 88$##
88$#
88$#
88$#
88$##
88888$#
88$#
o. 88$#
"bodP'$##
88 dP$#
88odP $#
88"Yb $#
88 Yb$##
88 $#
88 $#
88 .o$#
88ood8$##
8b d8$#
88b d88$#
88YbdP88$#
88 YY 88$##
88b 88$#
88Yb88$#
88 Y88$#
88 Y8$##
dP"Yb $#
dP Yb$#
Yb dP$#
YbodP $##
88""Yb$#
88__dP$#
88""" $#
88 $##
dP"Yb $#
dP Yb$#
Yb b dP$#
`"YoYo$##
88""Yb$#
88__dP$#
88"Yb $#
88 Yb$##
.dP"Y8$#
`Ybo."$#
o.`Y8b$#
8bodP'$##
888888$#
88 $#
88 $#
88 $##
88 88$#
88 88$#
Y8 8P$#
`YbodP'$##
Yb dP$#
Yb dP $#
YbdP $#
YP $##
Yb dP$#
Yb db dP $#
YbdPYbdP $#
YP YP $##
Yb dP$#
YbdP $#
dPYb $#
dP Yb$##
Yb dP$#
YbdP $#
8P $#
dP $##
8888P$#
dP $#
dP $#
d8888$##
d888$#
.dP $#
`Yb $#
Y888$##
II$#
II$#
II$#
II$##
888b $#
Yb.$#
dP'$#
888P $##
dP"Yb dP$#
dP `YbdP $#
$#
$##
db db db$#
""dPYb""$#
dP__Yb $#
dP""""Yb$##
db db $#
".oo." $#
dP Yb $#
YboodP $##
db db$#
"" ""$#
Yb dP$#
YbodP $##
db db db$#
""dPYb""$#
dP__Yb $#
dP""""Yb$##
db db $#
".oo." $#
dP Yb $#
YboodP $##
db db$#
"" ""$#
Y8 8P$#
YbodP $##
dP"o.$#
88.d'$#
88`8b$#
d8P P'$##
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @internal
*/
const secret = Symbol('secret');
/**
* @internal
*/
const mismatch = Symbol('mismatch');
/**
* A type which should match anything passed as a value but *doesn't*
* match {@linkcode Mismatch}. It helps TypeScript select the right overload
* for {@linkcode PositiveExpectTypeOf.toEqualTypeOf | .toEqualTypeOf()} and
* {@linkcode PositiveExpectTypeOf.toMatchTypeOf | .toMatchTypeOf()}.
*
* @internal
*/
const avalue = Symbol('avalue');
@@ -0,0 +1,27 @@
export type Config = $eslintcore.ConfigObject;
export type LegacyConfig = $eslintcore.LegacyConfigObject;
export type Plugin = $eslintcore.Plugin;
export type RuleConfig = $eslintcore.RuleConfig;
export type ExtendsElement = $typests.ExtendsElement;
export type ExtensionConfigObject = $typests.ExtensionConfigObject;
export type SimpleExtendsElement = $typests.SimpleExtendsElement;
export type ConfigWithExtends = $typests.ConfigWithExtends;
export type InfiniteConfigArray = $typests.InfiniteArray<Config>;
export type ConfigWithExtendsArray = $typests.ConfigWithExtendsArray;
/**
* Helper function to define a config array.
* @param {ConfigWithExtendsArray} args The arguments to the function.
* @returns {Config[]} The config array.
* @throws {TypeError} If no arguments are provided or if an argument is not an object.
*/
export function defineConfig(...args: ConfigWithExtendsArray): Config[];
/**
* Creates a global ignores config with the given patterns.
* @param {string[]} ignorePatterns The ignore patterns.
* @param {string} [name] The name of the global ignores config.
* @returns {Config} The global ignores config.
* @throws {TypeError} If ignorePatterns is not an array or if it is empty.
*/
export function globalIgnores(ignorePatterns: string[], name?: string): Config;
import type * as $eslintcore from "@eslint/core";
import type * as $typests from "./types.ts";
@@ -0,0 +1,7 @@
import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils';
import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
import type { LastChainOperand, ValidOperand } from './gatherLogicalOperands';
import type { PreferOptionalChainMessageIds, PreferOptionalChainOptions } from './PreferOptionalChainOptions';
export declare function analyzeChain(context: RuleContext<PreferOptionalChainMessageIds, [
PreferOptionalChainOptions
]>, parserServices: ParserServicesWithTypeInformation, options: PreferOptionalChainOptions, node: TSESTree.Node, operator: TSESTree.LogicalExpression['operator'], chain: ValidOperand[], lastChainOperand?: LastChainOperand): void;
@@ -0,0 +1,205 @@
"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;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useProgramFromProjectService = useProgramFromProjectService;
const debug_1 = __importDefault(require("debug"));
const minimatch_1 = require("minimatch");
const node_path_1 = __importDefault(require("node:path"));
const node_util_1 = __importDefault(require("node:util"));
const ts = __importStar(require("typescript"));
const createProjectProgram_1 = require("./create-program/createProjectProgram");
const createSourceFile_1 = require("./create-program/createSourceFile");
const shared_1 = require("./create-program/shared");
const validateDefaultProjectForFilesGlob_1 = require("./create-program/validateDefaultProjectForFilesGlob");
const RELOAD_THROTTLE_MS = 250;
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:useProgramFromProjectService');
const serviceFileExtensions = new WeakMap();
const updateExtraFileExtensions = (service, extraFileExtensions) => {
const currentServiceFileExtensions = serviceFileExtensions.get(service) ?? [];
if (!node_util_1.default.isDeepStrictEqual(currentServiceFileExtensions, extraFileExtensions)) {
log('Updating extra file extensions: before=%s: after=%s', currentServiceFileExtensions, extraFileExtensions);
service.setHostConfiguration({
extraFileExtensions: extraFileExtensions.map(extension => ({
extension,
isMixedContent: false,
scriptKind: ts.ScriptKind.Deferred,
})),
});
serviceFileExtensions.set(service, extraFileExtensions);
log('Extra file extensions updated: %o', extraFileExtensions);
}
};
function openClientFileFromProjectService(defaultProjectMatchedFiles, isDefaultProjectAllowed, filePathAbsolute, parseSettings, serviceAndSettings) {
const opened = openClientFileAndMaybeReload();
log('Result from attempting to open client file: %o', opened);
log('Default project allowed path: %s, based on config file: %s', isDefaultProjectAllowed, opened.configFileName);
if (opened.configFileName) {
if (isDefaultProjectAllowed) {
throw new Error(`${parseSettings.filePath} was included by allowDefaultProject but also was found in the project service. Consider removing it from allowDefaultProject.`);
}
}
else {
const wasNotFound = `${parseSettings.filePath} was not found by the project service`;
const fileExtension = node_path_1.default.extname(parseSettings.filePath);
const extraFileExtensions = parseSettings.extraFileExtensions;
if (!shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(fileExtension) &&
!extraFileExtensions.includes(fileExtension)) {
const nonStandardExt = `${wasNotFound} because the extension for the file (\`${fileExtension}\`) is non-standard`;
if (extraFileExtensions.length > 0) {
throw new Error(`${nonStandardExt}. It should be added to your existing \`parserOptions.extraFileExtensions\`.`);
}
else {
throw new Error(`${nonStandardExt}. You should add \`parserOptions.extraFileExtensions\` to your config.`);
}
}
if (!isDefaultProjectAllowed) {
const baseMessage = `${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`;
const allowDefaultProject = parseSettings.projectService?.allowDefaultProject;
if (!allowDefaultProject) {
throw new Error(baseMessage);
}
const relativeFilePath = node_path_1.default.relative(parseSettings.tsconfigRootDir, filePathAbsolute);
throw new Error([
baseMessage,
`allowDefaultProject is set to ${JSON.stringify(allowDefaultProject)}, which does not match '${relativeFilePath}'.`,
].join('\n'));
}
}
// No a configFileName indicates this file wasn't included in a TSConfig.
// That means it must get its type information from the default project.
if (!opened.configFileName) {
defaultProjectMatchedFiles.add(filePathAbsolute);
if (defaultProjectMatchedFiles.size >
serviceAndSettings.maximumDefaultProjectFileMatchCount) {
const filePrintLimit = 20;
const filesToPrint = [...defaultProjectMatchedFiles].slice(0, filePrintLimit);
const truncatedFileCount = defaultProjectMatchedFiles.size - filesToPrint.length;
throw new Error(`Too many files (>${serviceAndSettings.maximumDefaultProjectFileMatchCount}) have matched the default project.${validateDefaultProjectForFilesGlob_1.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}
Matching files:
${filesToPrint.map(file => `- ${file}`).join('\n')}
${truncatedFileCount ? `...and ${truncatedFileCount} more files\n` : ''}
If you absolutely need more files included, set parserOptions.projectService.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING to a larger value.
`);
}
}
return opened;
function openClientFile() {
return serviceAndSettings.service.openClientFile(filePathAbsolute, parseSettings.codeFullText,
/* scriptKind */ undefined, parseSettings.tsconfigRootDir);
}
function openClientFileAndMaybeReload() {
log('Opening project service client file at path: %s', filePathAbsolute);
let opened = openClientFile();
// If no project included the file and we're not in single-run mode,
// we might be running in an editor with outdated file info.
// We can try refreshing the project service - debounced for performance.
if (!opened.configFileErrors &&
!opened.configFileName &&
!parseSettings.singleRun &&
!isDefaultProjectAllowed &&
performance.now() - serviceAndSettings.lastReloadTimestamp >
RELOAD_THROTTLE_MS) {
log('No config file found; reloading project service and retrying.');
serviceAndSettings.service.reloadProjects();
opened = openClientFile();
serviceAndSettings.lastReloadTimestamp = performance.now();
}
return opened;
}
}
function createNoProgramWithProjectService(filePathAbsolute, parseSettings, service) {
log('No project service information available. Creating no program.');
// If the project service knows about this file, this informs if of changes.
// Doing so ensures that:
// - if the file is not part of a project, we don't waste time creating a program (fast non-type-aware linting)
// - otherwise, we refresh the file in the project service (moderately fast, since the project is already loaded)
if (service.getScriptInfo(filePathAbsolute)) {
log('Script info available. Opening client file in project service.');
service.openClientFile(filePathAbsolute, parseSettings.codeFullText,
/* scriptKind */ undefined, parseSettings.tsconfigRootDir);
}
return (0, createSourceFile_1.createNoProgram)(parseSettings);
}
function retrieveASTAndProgramFor(filePathAbsolute, parseSettings, serviceAndSettings) {
log('Retrieving script info and then program for: %s', filePathAbsolute);
const scriptInfo = serviceAndSettings.service.getScriptInfo(filePathAbsolute);
/* eslint-disable @typescript-eslint/no-non-null-assertion */
const program = serviceAndSettings.service
.getDefaultProjectForFile(scriptInfo.fileName, true)
.getLanguageService(/*ensureSynchronized*/ true)
.getProgram();
/* eslint-enable @typescript-eslint/no-non-null-assertion */
if (!program) {
log('Could not find project service program for: %s', filePathAbsolute);
return undefined;
}
log('Found project service program for: %s', filePathAbsolute);
return (0, createProjectProgram_1.createProjectProgram)(parseSettings, [program]);
}
function useProgramFromProjectService(serviceAndSettings, parseSettings, hasFullTypeInformation, defaultProjectMatchedFiles) {
// NOTE: triggers a full project reload when changes are detected
updateExtraFileExtensions(serviceAndSettings.service, parseSettings.extraFileExtensions);
// We don't canonicalize the filename because it caused a performance regression.
// See https://github.com/typescript-eslint/typescript-eslint/issues/8519
const filePathAbsolute = absolutify(parseSettings.filePath, serviceAndSettings);
log('Opening project service file for: %s at absolute path %s', parseSettings.filePath, filePathAbsolute);
const filePathRelative = node_path_1.default.relative(parseSettings.tsconfigRootDir, filePathAbsolute);
const isDefaultProjectAllowed = filePathMatchedBy(filePathRelative, serviceAndSettings.allowDefaultProject);
// Type-aware linting is disabled for this file.
// However, type-aware lint rules might still rely on its contents.
if (!hasFullTypeInformation && !isDefaultProjectAllowed) {
return createNoProgramWithProjectService(filePathAbsolute, parseSettings, serviceAndSettings.service);
}
// If type info was requested, we attempt to open it in the project service.
// By now, the file is known to be one of:
// - in the project service (valid configuration)
// - allowlisted in the default project (valid configuration)
// - neither, which openClientFileFromProjectService will throw an error for
const opened = hasFullTypeInformation &&
openClientFileFromProjectService(defaultProjectMatchedFiles, isDefaultProjectAllowed, filePathAbsolute, parseSettings, serviceAndSettings);
log('Opened project service file: %o', opened);
return retrieveASTAndProgramFor(filePathAbsolute, parseSettings, serviceAndSettings);
}
function absolutify(filePath, serviceAndSettings) {
return node_path_1.default.isAbsolute(filePath)
? filePath
: node_path_1.default.join(serviceAndSettings.service.host.getCurrentDirectory(), filePath);
}
function filePathMatchedBy(filePath, allowDefaultProject) {
return !!allowDefaultProject?.some(pattern => (0, minimatch_1.minimatch)(filePath, pattern, { dot: true }));
}
@@ -0,0 +1 @@
export declare function assert(value: unknown, message?: string): asserts value;
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/switch.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Switch\n * -----------------------------------------------------------------------------------------------*/\n\nconst SWITCH_NAME = 'Switch';\n\ntype ScopedProps<P> = P & { __scopeSwitch?: Scope };\nconst [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);\n\ntype SwitchContextValue = { checked: boolean; disabled?: boolean };\nconst [SwitchProvider, useSwitchContext] = createSwitchContext<SwitchContextValue>(SWITCH_NAME);\n\ntype SwitchElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface SwitchProps extends PrimitiveButtonProps {\n checked?: boolean;\n defaultChecked?: boolean;\n required?: boolean;\n onCheckedChange?(checked: boolean): void;\n}\n\nconst Switch = React.forwardRef<SwitchElement, SwitchProps>(\n (props: ScopedProps<SwitchProps>, forwardedRef) => {\n const {\n __scopeSwitch,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n disabled,\n value = 'on',\n onCheckedChange,\n form,\n ...switchProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? form || !!button.closest('form') : true;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: SWITCH_NAME,\n });\n\n return (\n <SwitchProvider scope={__scopeSwitch} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...switchProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n setChecked((prevChecked) => !prevChecked);\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if switch is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect switch updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <SwitchBubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n form={form}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </SwitchProvider>\n );\n }\n);\n\nSwitch.displayName = SWITCH_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SwitchThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SwitchThumb';\n\ntype SwitchThumbElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SwitchThumbProps extends PrimitiveSpanProps {}\n\nconst SwitchThumb = React.forwardRef<SwitchThumbElement, SwitchThumbProps>(\n (props: ScopedProps<SwitchThumbProps>, forwardedRef) => {\n const { __scopeSwitch, ...thumbProps } = props;\n const context = useSwitchContext(THUMB_NAME, __scopeSwitch);\n return (\n <Primitive.span\n data-state={getState(context.cheLine truncated
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAA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AAC5C,mBAAW,KAAK,OAAO,OAAO;AAC9B,cAAM,cAAc,KAAK;AAAA,MAC3B;AAAA,IACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC;AAElC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAW;AAAA,QACX,gBAAgB;AAAA,QACf,GAAG;AAAA,QACJ,UAAU;AAAA,QACV,KAAK;AAAA,QACL,OAAO;AAAA,UACL,GAAG,MAAM;AAAA,UACT,GAAG;AAAA,UACH,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAIhC,SAAS,SAAS,SAAkB;AAClC,SAAO,UAAU,YAAY;AAC/B;AAEA,IAAM,OAAO;AACb,IAAM,QAAQ;",
"names": []
}
@@ -0,0 +1 @@
{"version":3,"file":"sliders-vertical.js","sources":["../../../src/icons/sliders-vertical.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SlidersVertical\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNCIgeDI9IjQiIHkxPSIyMSIgeTI9IjE0IiAvPgogIDxsaW5lIHgxPSI0IiB4Mj0iNCIgeTE9IjEwIiB5Mj0iMyIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjIxIiB5Mj0iMTIiIC8+CiAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSI4IiB5Mj0iMyIgLz4KICA8bGluZSB4MT0iMjAiIHgyPSIyMCIgeTE9IjIxIiB5Mj0iMTYiIC8+CiAgPGxpbmUgeDE9IjIwIiB4Mj0iMjAiIHkxPSIxMiIgeTI9IjMiIC8+CiAgPGxpbmUgeDE9IjIiIHgyPSI2IiB5MT0iMTQiIHkyPSIxNCIgLz4KICA8bGluZSB4MT0iMTAiIHgyPSIxNCIgeTE9IjgiIHkyPSI4IiAvPgogIDxsaW5lIHgxPSIxOCIgeDI9IjIyIiB5MT0iMTYiIHkyPSIxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/sliders-vertical\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 SlidersVertical = createLucideIcon('SlidersVertical', [\n ['line', { x1: '4', x2: '4', y1: '21', y2: '14', key: '1p332r' }],\n ['line', { x1: '4', x2: '4', y1: '10', y2: '3', key: 'gb41h5' }],\n ['line', { x1: '12', x2: '12', y1: '21', y2: '12', key: 'hf2csr' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '3', key: '1kfi7u' }],\n ['line', { x1: '20', x2: '20', y1: '21', y2: '16', key: '1lhrwl' }],\n ['line', { x1: '20', x2: '20', y1: '12', y2: '3', key: '16vvfq' }],\n ['line', { x1: '2', x2: '6', y1: '14', y2: '14', key: '1uebub' }],\n ['line', { x1: '10', x2: '14', y1: '8', y2: '8', key: '1yglbp' }],\n ['line', { x1: '18', x2: '22', y1: '16', y2: '16', key: '1jxqpz' }],\n]);\n\nexport default SlidersVertical;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,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,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const isObject = require("./isObject.js");
function isPromiseLike(value) {
return isObject.isObject(value) && typeof value.then === "function";
}
exports.isPromiseLike = isPromiseLike;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../src/array.ts","../../src/clamp.ts","../../src/format-error-message.ts","../../src/errors.ts","../../src/global-config.ts","../../src/is-numerical-string.ts","../../src/is-object.ts","../../src/is-zero-value-string.ts","../../src/memo.ts","../../src/noop.ts","../../src/pipe.ts","../../src/progress.ts","../../src/subscription-manager.ts","../../src/time-conversion.ts","../../src/velocity-per-second.ts","../../src/warn-once.ts","../../src/wrap.ts","../../src/easing/cubic-bezier.ts","../../src/easing/modifiers/mirror.ts","../../src/easing/modifiers/reverse.ts","../../src/easing/back.ts","../../src/easing/anticipate.ts","../../src/easing/circ.ts","../../src/easing/ease.ts","../../src/easing/steps.ts","../../src/easing/utils/is-easing-array.ts","../../src/easing/utils/get-easing-for-segment.ts","../../src/easing/utils/is-bezier-definition.ts","../../src/easing/utils/map.ts"],"sourcesContent":["export function addUniqueItem<T>(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem<T>(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem<T>([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n","export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n","export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n","import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n","export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: <T>(a: T, b: T) => (p: number) => T\n} = {}\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n","export function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null\n}\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n","/*#__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","/*#__NO_SIDE_EFFECTS__*/\nexport const noop = <T>(any: T): T => any\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a: Function, b: Function) => (v: any) => b(a(v))\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce(combineFunctions)\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const toFromDifference = to - from\n\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference\n}\n","import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager<Handler extends GenericHandler> {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueIteLine truncated
@@ -0,0 +1,35 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
// You can regenerate it using `pnpm run generate-configs`
module.exports = {
extends: ['./configs/eslintrc/base', './configs/eslintrc/eslint-recommended'],
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/class-literal-property-style': 'error',
'@typescript-eslint/consistent-generic-constructors': 'error',
'@typescript-eslint/consistent-indexed-object-style': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'dot-notation': 'off',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
'@typescript-eslint/prefer-find': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
},
};
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":["dictionary","diceware","passwords","adjacencyGraphs","tempAdjacencyGraphs"],"mappings":";;;;AAAA;AAKA,MAAMA,UAAU,GAAG;AACjB,EAAA,iBAAiB,EAAEC,QAAQ;AAC3B,EAAA,kBAAkB,EAAEC;;AAGtB;AACA,MAAMC,eAAe,GAAGC;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"slash.js","sources":["../../../src/icons/slash.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Slash\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMiAyIDIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/slash\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 Slash = createLucideIcon('Slash', [['path', { d: 'M22 2 2 22', key: 'y4kqgn' }]]);\n\nexport default Slash;\n"],"names":[],"mappings":";;;;;;;;;AAaA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,OAAS,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,EAAE,CAAA,CAAA,CAAG,YAAc,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,15 @@
[
"decodeURI",
"decodeURIComponent",
"encodeURI",
"encodeURIComponent",
"escape",
"eval",
"globalThis",
"isFinite",
"isNaN",
"parseFloat",
"parseInt",
"undefined",
"unescape"
]
@@ -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 Binary = createLucideIcon("Binary", [
["rect", { x: "14", y: "14", width: "4", height: "6", rx: "2", key: "p02svl" }],
["rect", { x: "6", y: "4", width: "4", height: "6", rx: "2", key: "xm4xkj" }],
["path", { d: "M6 20h4", key: "1i6q5t" }],
["path", { d: "M14 10h4", key: "ru81e7" }],
["path", { d: "M6 14h2v6", key: "16z9wg" }],
["path", { d: "M14 4h2v6", key: "1idq9u" }]
]);
export { Binary as default };
//# sourceMappingURL=binary.js.map