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,2 @@
# Set default behavior to automatically convert line endings
* text=auto eol=lf
@@ -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 HeadphoneOff = createLucideIcon("HeadphoneOff", [
["path", { d: "M21 14h-1.343", key: "1jdnxi" }],
["path", { d: "M9.128 3.47A9 9 0 0 1 21 12v3.343", key: "6kipu2" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M20.414 20.414A2 2 0 0 1 19 21h-1a2 2 0 0 1-2-2v-3", key: "9x50f4" }],
[
"path",
{
d: "M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 2.636-6.364",
key: "1bkxnm"
}
]
]);
export { HeadphoneOff as default };
//# sourceMappingURL=headphone-off.js.map
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stat = exports.readFile = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
const readFile = exports.readFile = _gensync()({
sync: _fs().readFileSync,
errback: _fs().readFile
});
const stat = exports.stat = _gensync()({
sync: _fs().statSync,
errback: _fs().stat
});
0 && 0;
//# sourceMappingURL=fs.js.map
@@ -0,0 +1 @@
module.exports={C:{"52":0.028,"68":0.007,"105":0.105,"115":0.637,"120":0.49,"121":1.008,"123":0.028,"124":0.014,"125":0.056,"127":0.007,"130":0.007,"131":0.007,"134":0.007,"135":0.007,"136":0.021,"140":0.112,"142":0.007,"145":0.007,"146":0.007,"147":0.014,"148":0.007,"150":0.014,"151":0.028,"152":0.091,"153":0.07,"154":0.245,"155":0.896,"156":1.064,"157":0.049,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 128 129 132 133 137 138 139 141 143 144 149 158 159 160 3.5 3.6"},D:{"49":0.007,"53":0.014,"55":0.007,"64":0.007,"69":0.007,"79":0.007,"87":0.007,"88":0.028,"92":0.007,"98":0.007,"100":0.014,"101":0.007,"103":0.476,"104":0.434,"105":0.427,"106":0.518,"107":0.434,"108":0.441,"109":4.648,"110":0.434,"111":0.455,"112":0.441,"113":0.007,"114":0.014,"115":0.007,"116":0.889,"117":0.427,"118":0.903,"119":1.015,"120":1.442,"121":0.014,"122":0.063,"123":0.035,"124":0.455,"125":0.021,"126":0.049,"127":0.007,"128":0.021,"129":0.007,"130":0.014,"131":0.959,"132":0.014,"133":0.987,"134":0.147,"135":0.028,"136":0.084,"137":0.035,"138":0.077,"139":0.042,"140":0.07,"141":0.042,"142":0.217,"143":0.063,"144":0.357,"145":0.168,"146":0.245,"147":0.056,"148":0.105,"149":0.329,"150":0.399,"151":1.701,"152":9.072,"153":9.408,"154":2.366,"155":0.021,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 54 56 57 58 59 60 61 62 63 65 66 67 68 70 71 72 73 74 75 76 77 78 80 81 83 84 85 86 89 90 91 93 94 95 96 97 99 102 156 157"},F:{"36":0.028,"42":0.007,"54":0.007,"55":0.007,"56":0.007,"72":0.007,"73":0.021,"77":0.028,"79":0.077,"82":0.007,"85":0.035,"86":0.021,"87":0.007,"90":0.007,"95":1.015,"99":0.007,"100":0.021,"101":0.042,"102":0.007,"105":0.007,"106":0.014,"107":0.007,"114":0.007,"115":0.007,"117":0.007,"120":0.007,"122":0.014,"124":0.007,"131":0.014,"132":0.007,"133":0.035,"134":0.308,"135":4.711,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 43 44 45 46 47 48 49 50 51 52 53 57 58 60 62 63 64 65 66 67 68 69 70 71 74 75 76 78 80 81 83 84 88 89 91 92 93 94 96 97 98 103 104 108 109 110 111 112 113 116 118 119 121 123 125 126 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.007,"109":0.014,"119":0.483,"120":0.469,"122":0.014,"123":0.007,"124":0.007,"131":0.014,"132":0.007,"138":0.007,"140":0.007,"141":0.007,"142":0.007,"143":0.028,"144":0.07,"145":0.007,"146":0.007,"147":0.014,"148":0.007,"149":0.014,"150":0.028,"151":0.091,"152":1.484,"153":2.065,"154":0.63,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 125 126 127 128 129 130 133 134 135 136 137 139"},E:{"13":0.028,"27":0.084,_:"4 5 6 7 8 9 10 11 12 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.3 16.4 16.5 17.0 18.0 18.1 18.2 27.1 TP","13.1":0.014,"15.6":0.021,"16.1":0.007,"16.6":0.035,"17.1":0.035,"17.2":0.035,"17.3":0.007,"17.4":0.021,"17.5":0.007,"17.6":0.021,"18.3":0.007,"18.4":0.007,"18.5-18.7":0.007,"26.0":0.007,"26.1":0.014,"26.2":0.042,"26.3":0.105,"26.4":0.021,"26.5":0.098,"26.6":0.413,"27.2":0.007},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00059,"5.0-5.1":0.00059,"6.0-6.1":0,"7.0-7.1":0.00118,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.0059,"11.0-11.2":0.00059,"11.3-11.4":0.00118,"12.0-12.1":0,"12.2-12.5":0.01534,"13.0-13.1":0,"13.2":0.00295,"13.3":0,"13.4-13.7":0.00059,"14.0-14.4":0.00236,"14.5-14.8":0.00354,"15.0-15.1":0.00354,"15.2-15.3":0.00236,"15.4":0.00295,"15.5":0.00354,"15.6-15.8":0.07671,"16.0":0.0059,"16.1":0.01062,"16.2":0.0059,"16.3":0.01298,"16.4":0.00295,"16.5":0.00472,"16.6-16.7":0.10681,"17.0":0.00413,"17.1":0.0059,"17.2":0.0059,"17.3":0.00885,"17.4":0.01239,"17.5":0.02419,"17.6-17.7":0.06255,"18.0":0.01298,"18.1":0.02596,"18.2":0.03541,"18.3":0.06137,"18.4":0.03836,"18.5-18.7":0.7925,"26.0":0.03836,"26.1":0.03895,"26.2":0.1015,"26.3":0.10976,"26.4":0.08025,"26.5":0.53758,"26.6":3.31695,"27.0":0.25433,"27.1":0,"27.2":0.00649},P:{"4":0.019,"27":0.0095,"28":0.019,"29":0.076,"30":0.6745,_:"20 21 22 23 24 25 26 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.01799,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":1.011,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.042,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":19.525},R:{_:"0"},M:{"0":0.117},Q:{"14.9":0.012},O:{"0":0.201},H:{all:0}};
@@ -0,0 +1,113 @@
'use strict';
var helper = require('../../utils/helper.cjs');
var types = require('../../types.cjs');
/*
* ------------------------------------------------------------------------------
* spatial match (qwerty/dvorak/keypad and so on) -----------------------------------------
* ------------------------------------------------------------------------------
*/
class MatchSpatial extends types.MatcherBaseClass {
constructor() {
super(...arguments);
this.SHIFTED_RX = /[~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]/;
}
match({
password
}) {
const matches = [];
Object.keys(this.options.graphs).forEach(graphName => {
const graph = this.options.graphs[graphName];
helper.extend(matches, this.helper(password, graph, graphName));
});
return helper.sorted(matches);
}
checkIfShifted(graphName, password, index) {
if (!graphName.includes('keypad') &&
// initial character is shifted
this.SHIFTED_RX.test(password.charAt(index))) {
return 1;
}
return 0;
}
// eslint-disable-next-line complexity, max-statements
helper(password, graph, graphName) {
let shiftedCount;
const matches = [];
let i = 0;
const passwordLength = password.length;
while (i < passwordLength - 1) {
let j = i + 1;
let lastDirection = null;
let turns = 0;
shiftedCount = this.checkIfShifted(graphName, password, i);
while (true) {
const prevChar = password.charAt(j - 1);
const adjacents = graph[prevChar] || [];
let found = false;
let curDirection = -1;
// consider growing pattern by one character if j hasn't gone over the edge.
if (j < passwordLength) {
const curChar = password.charAt(j);
const adjacentsLength = adjacents.length;
for (let k = 0; k < adjacentsLength; k += 1) {
const adjacent = adjacents[k];
curDirection += 1;
// eslint-disable-next-line max-depth
if (adjacent) {
const adjacentIndex = adjacent.indexOf(curChar);
// eslint-disable-next-line max-depth
if (adjacentIndex !== -1) {
found = true;
// eslint-disable-next-line max-depth
if (adjacentIndex === 1) {
// # index 1 in the adjacency means the key is shifted,
// # 0 means unshifted: A vs a, % vs 5, etc.
// # for example, 'q' is adjacent to the entry '2@'.
// # @ is shifted w/ index 1, 2 is unshifted.
shiftedCount += 1;
}
const foundDirection = curDirection;
// eslint-disable-next-line max-depth
if (lastDirection !== foundDirection) {
// # adding a turn is correct even in the initial
// case when last_direction is null:
// # every spatial pattern starts with a turn.
turns += 1;
lastDirection = foundDirection;
}
break;
}
}
}
}
// if the current pattern continued, extend j and try to grow again
if (found) {
j += 1;
// otherwise push the pattern discovered so far, if any...
} else {
// don't consider length 1 or 2 chains.
if (j - i > 2) {
matches.push({
pattern: 'spatial',
i,
j: j - 1,
token: password.slice(i, j),
graph: graphName,
turns,
shiftedCount
});
}
// ...and then start a new search for the rest of the password.
i = j;
break;
}
}
}
return matches;
}
}
module.exports = MatchSpatial;
//# sourceMappingURL=matching.cjs.map
@@ -0,0 +1,152 @@
"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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "символа", verb: "да съдържа" },
file: { unit: "байта", verb: "да съдържа" },
array: { unit: "елемента", verb: "да съдържа" },
set: { unit: "елемента", verb: "да съдържа" },
map: { unit: "елемента", verb: "да съдържа" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "вход",
email: "имейл адрес",
url: "URL",
emoji: "емоджи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO време",
date: "ISO дата",
time: "ISO време",
duration: "ISO продължителност",
ipv4: "IPv4 адрес",
ipv6: "IPv6 адрес",
mac: "MAC адрес",
cidrv4: "IPv4 диапазон",
cidrv6: "IPv6 диапазон",
base64: "base64-кодиран низ",
base64url: "base64url-кодиран низ",
json_string: "JSON низ",
e164: "E.164 номер",
credit_card: "номер на кредитна карта",
currency_code: "код на валута",
iban: "IBAN",
jwt: "JWT",
template_literal: "вход",
};
const TypeDictionary = {
nan: "NaN",
number: "число",
array: "масив",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Невалиден вход: очакван instanceof ${issue.expected}, получен ${received}`;
}
return `Невалиден вход: очакван ${expected}, получен ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Невалиден вход: очакван ${util.stringifyPrimitive(issue.values[0])}`;
return `Невалидна опция: очаквано едно от ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Твърде голямо: очаква се ${issue.origin ?? "стойност"} да съдържа ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елемента"}`;
return `Твърде голямо: очаква се ${issue.origin ?? "стойност"} да бъде ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Твърде малко: очаква се ${issue.origin} да съдържа ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Твърде малко: очаква се ${issue.origin} да бъде ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Невалиден низ: трябва да започва с "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Невалиден низ: трябва да завършва с "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Невалиден низ: трябва да включва "${_issue.includes}"`;
if (_issue.format === "regex")
return `Невалиден низ: трябва да съвпада с ${_issue.pattern}`;
let invalid_adj = "Невалиден";
if (_issue.format === "emoji")
invalid_adj = "Невалидно";
if (_issue.format === "datetime")
invalid_adj = "Невалидно";
if (_issue.format === "date")
invalid_adj = "Невалидна";
if (_issue.format === "time")
invalid_adj = "Невалидно";
if (_issue.format === "duration")
invalid_adj = "Невалидна";
return `${invalid_adj} ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Невалидно число: трябва да бъде кратно на ${issue.divisor}`;
case "unrecognized_keys":
return `Неразпознат${issue.keys.length > 1 ? "и" : ""} ключ${issue.keys.length > 1 ? "ове" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Невалиден ключ в ${issue.origin}`;
case "invalid_union":
return "Невалиден вход";
case "invalid_element":
return `Невалидна стойност в ${issue.origin}`;
default:
return `Невалиден вход`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,80 @@
'use strict';
module.exports = function generate__limitProperties(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $errorKeyword;
var $data = 'data' + ($dataLvl || '');
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
if (!($isData || typeof $schema == 'number')) {
throw new Error($keyword + ' must be number');
}
var $op = $keyword == 'maxProperties' ? '>' : '<';
out += 'if ( ';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
}
out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';
var $errorKeyword = $keyword;
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should NOT have ';
if ($keyword == 'maxProperties') {
out += 'more';
} else {
out += 'fewer';
}
out += ' than ';
if ($isData) {
out += '\' + ' + ($schemaValue) + ' + \'';
} else {
out += '' + ($schema);
}
out += ' properties\' ';
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + ($schema);
}
out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += '} ';
if ($breakOnError) {
out += ' else { ';
}
return out;
}
@@ -0,0 +1,22 @@
/**
* Checks if `url` is an absolute URL.
*
* 校验是否是绝对URL
*
* @example
* ```js
* import { isAbsoluteURL } from 'is-what-type';
*
* isAbsoluteURL('https://example.com'); // true
* isAbsoluteURL('/foo/bar'); // false
* isAbsoluteURL('ftp://example.com'); // true
* isAbsoluteURL('mailto:foo@bar.com'); // true
* isAbsoluteURL('file:///usr/bin/myfile'); // true
* isAbsoluteURL('//example.com'); // true
* isAbsoluteURL('example.com'); // false
* ```
*
* @param value - The value to check.
* @returns `true` if the value is an absolute URL, `false` otherwise.
*/
export declare function isAbsoluteURL(value: any): boolean;
@@ -0,0 +1,35 @@
'use strict';
var callBind = require('call-bind-apply-helpers');
var gOPD = require('gopd');
var $TypeError = require('es-errors/type');
/** @type {{ __proto__?: object | null }} */
var obj = {};
try {
obj.__proto__ = null; // eslint-disable-line no-proto
} catch (e) {
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
throw e;
}
}
var hasProtoMutator = !('toString' in obj);
// eslint-disable-next-line no-extra-parens
var desc = gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
/** @type {import('./set')} */
module.exports = hasProtoMutator && (
// eslint-disable-next-line no-extra-parens
(!!desc && typeof desc.set === 'function' && /** @type {import('./set')} */ (callBind([desc.set])))
|| /** @type {import('./set')} */ function setDunder(object, proto) {
// this is node v0.10 or older, which doesn't have Object.setPrototypeOf and has undeniable __proto__
if (object == null) { // eslint-disable-line eqeqeq
throw new $TypeError('set Object.prototype.__proto__ called on null or undefined');
}
// eslint-disable-next-line no-proto, no-param-reassign, no-extra-parens
/** @type {{ __proto__?: object | null }} */ (object).__proto__ = proto;
return proto;
}
);
@@ -0,0 +1 @@
"use strict";var f=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Z=(e,r)=>{for(var a in r)f(e,a,{get:r[a],enumerable:!0})},$=(e,r,a,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of W(r))!X.call(e,t)&&t!==a&&f(e,t,{get:()=>r[t],enumerable:!(s=Q(r,t))||s.enumerable});return e};var x=e=>$(f({},"__esModule",{value:!0}),e);var ve={};Z(ve,{AbortSignalPlugin:()=>z,BlobPlugin:()=>P,CustomEventPlugin:()=>h,DOMExceptionPlugin:()=>D,EventPlugin:()=>A,FilePlugin:()=>d,FormDataPlugin:()=>I,HeadersPlugin:()=>i,ImageDataPlugin:()=>U,ReadableStreamPlugin:()=>p,RequestPlugin:()=>H,ResponsePlugin:()=>j,URLPlugin:()=>G,URLSearchParamsPlugin:()=>K});module.exports=x(ve);var y=require("seroval"),m=e=>{let r=new AbortController,a=r.abort.bind(r);return e.then(a,a),r};function ee(e){e(this.reason)}function re(e){this.addEventListener("abort",ee.bind(this,e),{once:!0})}function w(e){return new Promise(re.bind(e))}var u={},ae=(0,y.createPlugin)({tag:"seroval-plugins/web/AbortControllerFactoryPlugin",test(e){return e===u},parse:{sync(){return u},async async(){return await Promise.resolve(u)},stream(){return u}},serialize(){return m.toString()},deserialize(){return m}}),te=(0,y.createPlugin)({tag:"seroval-plugins/web/AbortSignal",extends:[ae],test(e){return typeof AbortSignal=="undefined"?!1:e instanceof AbortSignal},parse:{sync(e,r){return e.aborted?{reason:r.parse(e.reason)}:{}},async async(e,r){if(e.aborted)return{reason:await r.parse(e.reason)};let a=await w(e);return{reason:await r.parse(a)}},stream(e,r){if(e.aborted)return{reason:r.parse(e.reason)};let a=w(e);return{factory:r.parse(u),controller:r.parse(a)}}},serialize(e,r){return e.reason?"AbortSignal.abort("+r.serialize(e.reason)+")":e.controller&&e.factory?"("+r.serialize(e.factory)+")("+r.serialize(e.controller)+").signal":"(new AbortController).signal"},deserialize(e,r){return e.reason?AbortSignal.abort(r.deserialize(e.reason)):e.controller?m(r.deserialize(e.controller)).signal:new AbortController().signal}}),z=te;var R=require("seroval"),se=(0,R.createPlugin)({tag:"seroval-plugins/web/Blob",test(e){return typeof Blob=="undefined"?!1:e instanceof Blob},parse:{async async(e,r){return{type:await r.parse(e.type),buffer:await r.parse(await e.arrayBuffer())}}},serialize(e,r){return"new Blob(["+r.serialize(e.buffer)+"],{type:"+r.serialize(e.type)+"})"},deserialize(e,r){return new Blob([r.deserialize(e.buffer)],{type:r.deserialize(e.type)})}}),P=se;var N=require("seroval");function g(e){return{detail:e.detail,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}}var oe=(0,N.createPlugin)({tag:"seroval-plugins/web/CustomEvent",test(e){return typeof CustomEvent=="undefined"?!1:e instanceof CustomEvent},parse:{sync(e,r){return{type:r.parse(e.type),options:r.parse(g(e))}},async async(e,r){return{type:await r.parse(e.type),options:await r.parse(g(e))}},stream(e,r){return{type:r.parse(e.type),options:r.parse(g(e))}}},serialize(e,r){return"new CustomEvent("+r.serialize(e.type)+","+r.serialize(e.options)+")"},deserialize(e,r){return new CustomEvent(r.deserialize(e.type),r.deserialize(e.options))}}),h=oe;var E=require("seroval"),ne=(0,E.createPlugin)({tag:"seroval-plugins/web/DOMException",test(e){return typeof DOMException=="undefined"?!1:e instanceof DOMException},parse:{sync(e,r){return{name:r.parse(e.name),message:r.parse(e.message)}},async async(e,r){return{name:await r.parse(e.name),message:await r.parse(e.message)}},stream(e,r){return{name:r.parse(e.name),message:r.parse(e.message)}}},serialize(e,r){return"new DOMException("+r.serialize(e.message)+","+r.serialize(e.name)+")"},deserialize(e,r){return new DOMException(r.deserialize(e.message),r.deserialize(e.name))}}),D=ne;var F=require("seroval");function c(e){return{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}}var ie=(0,F.createPlugin)({tag:"seroval-plugins/web/Event",test(e){return typeof Event=="undefined"?!1:e instanceof Event},parse:{sync(e,r){return{type:r.parse(e.type),options:r.parse(c(e))}},async async(e,r){return{type:await r.parse(e.type),options:await r.parse(c(e))}},stream(e,r){return{type:r.parse(e.type),options:r.parse(c(e))}}},serialize(e,r){return"new Event("+r.serialize(e.type)+","+r.serialize(e.options)+")"},deserialize(e,r){return new Event(r.deserialize(e.type),r.deserialize(e.options))}}),A=ie;var O=require("seroval"),le=(0,O.createPlugin)({tag:"seroval-plugins/web/File",test(e){return typeof File=="undefined"?!1:e instanceof File},parse:{async async(e,r){return{name:await r.parse(e.name),options:await r.parse({type:e.type,lastModified:e.lastModified}),buffer:await r.parse(await e.arrayBuffer())}}},serialize(e,r){return"new File(["+r.serialize(e.buffer)+"],"+r.serialize(e.name)+","+r.serialize(e.options)+")"},deserialize(e,r){return new File([r.deserialize(e.buffer)],r.deserialize(e.name),r.deserialize(e.options))}}),d=le;var S=require("seroval");function b(e){let r=[];return e.foLine truncated
@@ -0,0 +1,411 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/index.ts
var stateIndexKey = "__TSR_index";
var popStateEvent = "popstate";
var beforeUnloadEvent = "beforeunload";
function createHistory(opts) {
let location = opts.getLocation();
const subscribers = /* @__PURE__ */ new Set();
const notify = (action) => {
location = opts.getLocation();
subscribers.forEach((subscriber) => subscriber({
location,
action
}));
};
const handleIndexChange = (action) => {
if (opts.notifyOnIndexChange ?? true) notify(action);
else location = opts.getLocation();
};
const tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => {
if (navigateOpts?.ignoreBlocker ?? false) {
task();
return;
}
const blockers = opts.getBlockers?.() ?? [];
const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE";
if (typeof document !== "undefined" && blockers.length && isPushOrReplace) for (const blocker of blockers) {
const nextLocation = parseHref(actionInfo.path, actionInfo.state);
if (await blocker.blockerFn({
currentLocation: location,
nextLocation,
action: actionInfo.type
})) {
opts.onBlocked?.();
return;
}
}
task();
};
return {
get location() {
return location;
},
get length() {
return opts.getLength();
},
subscribers,
subscribe: (cb) => {
subscribers.add(cb);
return () => {
subscribers.delete(cb);
};
},
push: (path, state, navigateOpts) => {
const currentIndex = location.state[stateIndexKey];
state = assignKeyAndIndex(currentIndex + 1, state);
tryNavigation({
task: () => {
opts.pushState(path, state);
notify({ type: "PUSH" });
},
navigateOpts,
type: "PUSH",
path,
state
});
},
replace: (path, state, navigateOpts) => {
const currentIndex = location.state[stateIndexKey];
state = assignKeyAndIndex(currentIndex, state);
tryNavigation({
task: () => {
opts.replaceState(path, state);
notify({ type: "REPLACE" });
},
navigateOpts,
type: "REPLACE",
path,
state
});
},
go: (index, navigateOpts) => {
tryNavigation({
task: () => {
opts.go(index);
handleIndexChange({
type: "GO",
index
});
},
navigateOpts,
type: "GO"
});
},
back: (navigateOpts) => {
tryNavigation({
task: () => {
opts.back(navigateOpts?.ignoreBlocker ?? false);
handleIndexChange({ type: "BACK" });
},
navigateOpts,
type: "BACK"
});
},
forward: (navigateOpts) => {
tryNavigation({
task: () => {
opts.forward(navigateOpts?.ignoreBlocker ?? false);
handleIndexChange({ type: "FORWARD" });
},
navigateOpts,
type: "FORWARD"
});
},
canGoBack: () => location.state[stateIndexKey] !== 0,
createHref: (str) => opts.createHref(str),
block: (blocker) => {
if (!opts.setBlockers) return () => {};
const blockers = opts.getBlockers?.() ?? [];
opts.setBlockers([...blockers, blocker]);
return () => {
const blockers = opts.getBlockers?.() ?? [];
opts.setBlockers?.(blockers.filter((b) => b !== blocker));
};
},
flush: () => opts.flush?.(),
destroy: () => opts.destroy?.(),
notify
};
}
function assignKeyAndIndex(index, state) {
if (!state) state = {};
const key = createRandomKey();
return {
...state,
key,
__TSR_key: key,
[stateIndexKey]: index
};
}
/**
* Creates a history object that can be used to interact with the browser's
* navigation. This is a lightweight API wrapping the browser's native methods.
* It is designed to work with TanStack Router, but could be used as a standalone API as well.
* IMPORTANT: This API implements history throttling via a microtask to prevent
* excessive calls to the history API. In some browsers, calling history.pushState or
* history.replaceState in quick succession can cause the browser to ignore subsequent
* calls. This API smooths out those differences and ensures that your application
* state will *eventually* match the browser state. In most cases, this is not a problem,
* but if you need to ensure that the browser state is up to date, you can use the
* `history.flush` method to immediately flush all pending state changes to the browser URL.
* @param opts
* @param opts.getHref A function that returns the current href (path + search + hash)
* @param opts.createHref A function that takes a path and returns a href (path + search + hash)
* @returns A history instance
*/
function createBrowserHistory(opts) {
const win = opts?.window ?? (typeof document !== "undefined" ? window : void 0);
const originalPushState = win.history.pushState;
const originalReplaceState = win.history.replaceState;
let blockers = [];
const _getBlockers = () => blockers;
const _setBlockers = (newBlockers) => blockers = newBlockers;
const createHref = opts?.createHref ?? ((path) => path);
const parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));
if (!win.history.state?.__TSR_key && !win.history.state?.key) {
const addedKey = createRandomKey();
win.history.replaceState({
[stateIndexKey]: 0,
key: addedKey,
__TSR_key: addedKey
}, "");
}
let currentLocation = parseLocation();
let rollbackLocation;
let nextPopIsGo = false;
let ignoreNextPop = false;
let skipBlockerNextPop = false;
let ignoreNextBeforeUnload = false;
const getLocation = () => currentLocation;
let next;
let scheduled;
const flush = () => {
if (!next) return;
history._ignoreSubscribers = true;
(next.isPush ? win.history.pushState : win.history.replaceState)(next.state, "", next.href);
history._ignoreSubscribers = false;
next = void 0;
scheduled = void 0;
rollbackLocation = void 0;
};
const queueHistoryAction = (type, destHref, state) => {
const href = createHref(destHref);
if (!scheduled) rollbackLocation = currentLocation;
currentLocation = parseHref(destHref, state);
next = {
href,
state,
isPush: next?.isPush || type === "push"
};
if (!scheduled) scheduled = Promise.resolve().then(() => flush());
};
const onPushPop = (type) => {
currentLocation = parseLocation();
history.notify({ type });
};
const onPushPopEvent = async () => {
if (ignoreNextPop) {
ignoreNextPop = false;
return;
}
const nextLocation = parseLocation();
const delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];
const isForward = delta === 1;
const isBack = delta === -1;
const isGo = !isForward && !isBack || nextPopIsGo;
nextPopIsGo = false;
const action = isGo ? "GO" : isBack ? "BACK" : "FORWARD";
const notify = isGo ? {
type: "GO",
index: delta
} : { type: isBack ? "BACK" : "FORWARD" };
if (skipBlockerNextPop) skipBlockerNextPop = false;
else {
const blockers = _getBlockers();
if (typeof document !== "undefined" && blockers.length) {
for (const blocker of blockers) if (await blocker.blockerFn({
currentLocation,
nextLocation,
action
})) {
ignoreNextPop = true;
win.history.go(1);
history.notify(notify);
return;
}
}
}
currentLocation = parseLocation();
history.notify(notify);
};
const onBeforeUnload = (e) => {
if (ignoreNextBeforeUnload) {
ignoreNextBeforeUnload = false;
return;
}
let shouldBlock = false;
const blockers = _getBlockers();
if (typeof document !== "undefined" && blockers.length) for (const blocker of blockers) {
const shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;
if (shouldHaveBeforeUnload === true) {
shouldBlock = true;
break;
}
if (typeof shouldHaveBeforeUnload === "function" && shouldHaveBeforeUnload() === true) {
shouldBlock = true;
break;
}
}
if (shouldBlock) {
e.preventDefault();
return e.returnValue = "";
}
};
const history = createHistory({
getLocation,
getLength: () => win.history.length,
pushState: (href, state) => queueHistoryAction("push", href, state),
replaceState: (href, state) => queueHistoryAction("replace", href, state),
back: (ignoreBlocker) => {
if (ignoreBlocker) skipBlockerNextPop = true;
ignoreNextBeforeUnload = true;
return win.history.back();
},
forward: (ignoreBlocker) => {
if (ignoreBlocker) skipBlockerNextPop = true;
ignoreNextBeforeUnload = true;
win.history.forward();
},
go: (n) => {
nextPopIsGo = true;
win.history.go(n);
},
createHref: (href) => createHref(href),
flush,
destroy: () => {
win.history.pushState = originalPushState;
win.history.replaceState = originalReplaceState;
win.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
win.removeEventListener(popStateEvent, onPushPopEvent);
},
onBlocked: () => {
if (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;
},
getBlockers: _getBlockers,
setBlockers: _setBlockers,
notifyOnIndexChange: false
});
win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
win.addEventListener(popStateEvent, onPushPopEvent);
win.history.pushState = function(...args) {
const res = originalPushState.apply(win.history, args);
if (!history._ignoreSubscribers) onPushPop("PUSH");
return res;
};
win.history.replaceState = function(...args) {
const res = originalReplaceState.apply(win.history, args);
if (!history._ignoreSubscribers) onPushPop("REPLACE");
return res;
};
return history;
}
/**
* Create a hash-based history implementation.
* Useful for static hosts or environments without server URL rewriting.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types
*/
function createHashHistory(opts) {
const win = opts?.window ?? (typeof document !== "undefined" ? window : void 0);
return createBrowserHistory({
window: win,
parseLocation: () => {
const hashSplit = win.location.hash.split("#").slice(1);
const pathPart = hashSplit[0] ?? "/";
const searchPart = win.location.search;
const hashEntries = hashSplit.slice(1);
return parseHref(`${pathPart}${searchPart}${hashEntries.length === 0 ? "" : `#${hashEntries.join("#")}`}`, win.history.state);
},
createHref: (href) => `${win.location.pathname}${win.location.search}#${href}`
});
}
/**
* Create an in-memory history implementation.
* Ideal for server rendering, tests, and non-DOM environments.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types
*/
function createMemoryHistory(opts = { initialEntries: ["/"] }) {
const entries = opts.initialEntries;
let index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;
const states = entries.map((_entry, index) => assignKeyAndIndex(index, void 0));
const getLocation = () => parseHref(entries[index], states[index]);
let blockers = [];
const _getBlockers = () => blockers;
const _setBlockers = (newBlockers) => blockers = newBlockers;
return createHistory({
getLocation,
getLength: () => entries.length,
pushState: (path, state) => {
if (index < entries.length - 1) {
entries.splice(index + 1);
states.splice(index + 1);
}
states.push(state);
entries.push(path);
index = Math.max(entries.length - 1, 0);
},
replaceState: (path, state) => {
states[index] = state;
entries[index] = path;
},
back: () => {
index = Math.max(index - 1, 0);
},
forward: () => {
index = Math.min(index + 1, entries.length - 1);
},
go: (n) => {
index = Math.min(Math.max(index + n, 0), entries.length - 1);
},
createHref: (path) => path,
getBlockers: _getBlockers,
setBlockers: _setBlockers
});
}
/**
* Sanitize a path to prevent open redirect vulnerabilities.
* Removes control characters and collapses leading double slashes.
*/
function sanitizePath(path) {
let sanitized = path.replace(/[\x00-\x1f\x7f]/g, "");
if (sanitized.startsWith("//")) sanitized = "/" + sanitized.replace(/^\/+/, "");
return sanitized;
}
function parseHref(href, state) {
const sanitizedHref = sanitizePath(href);
const hashIndex = sanitizedHref.indexOf("#");
const searchIndex = sanitizedHref.indexOf("?");
const addedKey = createRandomKey();
return {
href: sanitizedHref,
pathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),
hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : "",
search: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
state: state || {
[stateIndexKey]: 0,
key: addedKey,
__TSR_key: addedKey
}
};
}
function createRandomKey() {
return (Math.random() + 1).toString(36).substring(7);
}
//#endregion
exports.createBrowserHistory = createBrowserHistory;
exports.createHashHistory = createHashHistory;
exports.createHistory = createHistory;
exports.createMemoryHistory = createMemoryHistory;
exports.parseHref = parseHref;
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1,8 @@
"use strict";
/**
* This is a fork of https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13f63c2eb8d7479caf01ab8d72f9e3683368a8f5/types/json-schema/index.d.ts
* We intentionally fork this because:
* - ESLint ***ONLY*** supports JSONSchema v4
* - We want to provide stricter types
*/
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
{"version":3,"file":"snail.js","sources":["../../../src/icons/snail.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Snail\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxM2E2IDYgMCAxIDAgMTIgMCA0IDQgMCAxIDAtOCAwIDIgMiAwIDAgMCA0IDAiIC8+CiAgPGNpcmNsZSBjeD0iMTAiIGN5PSIxMyIgcj0iOCIgLz4KICA8cGF0aCBkPSJNMiAyMWgxMmM0LjQgMCA4LTMuNiA4LThWN2EyIDIgMCAxIDAtNCAwdjYiIC8+CiAgPHBhdGggZD0iTTE4IDMgMTkuMSA1LjIiIC8+CiAgPHBhdGggZD0iTTIyIDMgMjAuOSA1LjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/snail\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 Snail = createLucideIcon('Snail', [\n ['path', { d: 'M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0', key: 'hneq2s' }],\n ['circle', { cx: '10', cy: '13', r: '8', key: '194lz3' }],\n ['path', { d: 'M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6', key: 'ixqyt7' }],\n ['path', { d: 'M18 3 19.1 5.2', key: '9tjm43' }],\n ['path', { d: 'M22 3 20.9 5.2', key: 'j3odrs' }],\n]);\n\nexport default Snail;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,63 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface ArrayBuffer {
/**
* If this ArrayBuffer is resizable, returns the maximum byte length given during construction; returns the byte length if not.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/maxByteLength)
*/
get maxByteLength(): number;
/**
* Returns true if this ArrayBuffer can be resized.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resizable)
*/
get resizable(): boolean;
/**
* Resizes the ArrayBuffer to the specified size (in bytes).
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resize)
*/
resize(newByteLength?: number): void;
/**
* Returns a boolean indicating whether or not this buffer has been detached (transferred).
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/detached)
*/
get detached(): boolean;
/**
* Creates a new ArrayBuffer with the same byte content as this buffer, then detaches this buffer.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer)
*/
transfer(newByteLength?: number): ArrayBuffer;
/**
* Creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transferToFixedLength)
*/
transferToFixedLength(newByteLength?: number): ArrayBuffer;
}
interface ArrayBufferConstructor {
new (byteLength: number, options?: { maxByteLength?: number; }): ArrayBuffer;
}
@@ -0,0 +1,317 @@
/**
* @fileoverview Rule to enforce the use of `u` or `v` flag on regular expressions.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const {
CALL,
CONSTRUCT,
ReferenceTracker,
getStringIfConstant,
} = require("@eslint-community/eslint-utils");
const astUtils = require("./utils/ast-utils.js");
const { isValidWithUnicodeFlag } = require("./utils/regular-expressions");
/**
* Checks whether the flag configuration should be treated as a missing flag.
* @param {"u"|"v"|undefined} requireFlag A particular flag to require
* @param {string} flags The regex flags
* @returns {boolean} Whether the flag configuration results in a missing flag.
*/
function checkFlags(requireFlag, flags) {
let missingFlag;
if (requireFlag === "v") {
missingFlag = !flags.includes("v");
} else if (requireFlag === "u") {
missingFlag = !flags.includes("u");
} else {
missingFlag = !flags.includes("u") && !flags.includes("v");
}
return missingFlag;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [{}],
docs: {
description:
"Enforce the use of `u` or `v` flag on regular expressions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/require-unicode-regexp",
},
hasSuggestions: true,
messages: {
addUFlag: "Add the 'u' flag.",
addVFlag: "Add the 'v' flag.",
requireUFlag: "Use the 'u' flag.",
requireVFlag: "Use the 'v' flag.",
},
schema: [
{
type: "object",
properties: {
requireFlag: {
enum: ["u", "v"],
},
},
additionalProperties: false,
},
],
},
create(context) {
const sourceCode = context.sourceCode;
const [{ requireFlag }] = context.options;
return {
"Literal[regex]"(node) {
const flags = node.regex.flags || "";
const missingFlag = checkFlags(requireFlag, flags);
if (missingFlag) {
context.report({
messageId:
requireFlag === "v"
? "requireVFlag"
: "requireUFlag",
node,
suggest: isValidWithUnicodeFlag(
context.languageOptions.ecmaVersion,
node.regex.pattern,
requireFlag,
)
? [
{
fix(fixer) {
const replaceFlag =
requireFlag ?? "u";
const regex =
sourceCode.getText(node);
const slashPos =
regex.lastIndexOf("/");
if (requireFlag) {
const flag =
requireFlag === "u"
? "v"
: "u";
if (
regex.includes(
flag,
slashPos,
)
) {
return fixer.replaceText(
node,
regex.slice(
0,
slashPos,
) +
regex
.slice(slashPos)
.replace(
flag,
requireFlag,
),
);
}
}
return fixer.insertTextAfter(
node,
replaceFlag,
);
},
messageId:
requireFlag === "v"
? "addVFlag"
: "addUFlag",
},
]
: null,
});
}
},
Program(node) {
const scope = sourceCode.getScope(node);
const tracker = new ReferenceTracker(scope);
const trackMap = {
RegExp: { [CALL]: true, [CONSTRUCT]: true },
};
for (const { node: refNode } of tracker.iterateGlobalReferences(
trackMap,
)) {
const [patternNode, flagsNode] = refNode.arguments;
if (patternNode && patternNode.type === "SpreadElement") {
continue;
}
const pattern = getStringIfConstant(patternNode, scope);
const flags = getStringIfConstant(flagsNode, scope);
let missingFlag = !flagsNode;
if (typeof flags === "string") {
missingFlag = checkFlags(requireFlag, flags);
}
if (missingFlag) {
context.report({
messageId:
requireFlag === "v"
? "requireVFlag"
: "requireUFlag",
node: refNode,
suggest:
typeof pattern === "string" &&
isValidWithUnicodeFlag(
context.languageOptions.ecmaVersion,
pattern,
requireFlag,
)
? [
{
fix(fixer) {
const replaceFlag =
requireFlag ?? "u";
if (flagsNode) {
if (
(flagsNode.type ===
"Literal" &&
typeof flagsNode.value ===
"string") ||
flagsNode.type ===
"TemplateLiteral"
) {
const flagsNodeText =
sourceCode.getText(
flagsNode,
);
const flag =
requireFlag ===
"u"
? "v"
: "u";
if (
flags.includes(
flag,
)
) {
// Avoid replacing "u" in escapes like `\uXXXX`
if (
flagsNode.type ===
"Literal" &&
flagsNode.raw.includes(
"\\",
)
) {
return null;
}
// Avoid replacing "u" in expressions like "`${regularFlags}g`"
if (
flagsNode.type ===
"TemplateLiteral" &&
(flagsNode
.expressions
.length ||
flagsNode.quasis.some(
({
value: {
raw,
},
}) =>
raw.includes(
"\\",
),
))
) {
return null;
}
return fixer.replaceText(
flagsNode,
flagsNodeText.replace(
flag,
replaceFlag,
),
);
}
return fixer.replaceText(
flagsNode,
[
flagsNodeText.slice(
0,
flagsNodeText.length -
1,
),
flagsNodeText.slice(
flagsNodeText.length -
1,
),
].join(
replaceFlag,
),
);
}
// We intentionally don't suggest concatenating + "u" to non-literals
return null;
}
const penultimateToken =
sourceCode.getLastToken(
refNode,
{ skip: 1 },
); // skip closing parenthesis
return fixer.insertTextAfter(
penultimateToken,
astUtils.isCommaToken(
penultimateToken,
)
? ` "${replaceFlag}",`
: `, "${replaceFlag}"`,
);
},
messageId:
requireFlag === "v"
? "addVFlag"
: "addUFlag",
},
]
: null,
});
}
}
},
};
},
};
@@ -0,0 +1,47 @@
import type { AnySchemaObject, SchemaObject, JTDParser } from "./types";
import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema";
import AjvCore, { CurrentOptions } from "./core";
type JTDOptions = CurrentOptions & {
strict?: never;
allowMatchingProperties?: never;
allowUnionTypes?: never;
validateFormats?: never;
$data?: never;
verbose?: boolean;
$comment?: never;
formats?: never;
loadSchema?: never;
useDefaults?: never;
coerceTypes?: never;
next?: never;
unevaluated?: never;
dynamicRef?: never;
meta?: boolean;
defaultMeta?: never;
inlineRefs?: boolean;
loopRequired?: never;
multipleOfPrecision?: never;
};
export declare class Ajv extends AjvCore {
constructor(opts?: JTDOptions);
_addVocabularies(): void;
_addDefaultMetaSchema(): void;
defaultMeta(): string | AnySchemaObject | undefined;
compileSerializer<T = unknown>(schema: SchemaObject): (data: T) => string;
compileSerializer<T = unknown>(schema: JTDSchemaType<T>): (data: T) => string;
compileParser<T = unknown>(schema: SchemaObject): JTDParser<T>;
compileParser<T = unknown>(schema: JTDSchemaType<T>): JTDParser<T>;
private _compileSerializer;
private _compileParser;
}
export default Ajv;
export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types";
export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export { KeywordCxt } from "./compile/validate";
export { JTDErrorObject } from "./vocabularies/jtd";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
export { JTDSchemaType, SomeJTDSchemaType, JTDDataType };
export { JTDOptions };
export { default as ValidationError } from "./runtime/validation_error";
export { default as MissingRefError } from "./compile/ref_error";
@@ -0,0 +1,142 @@
import { BaseRootRoute, BaseRoute, BaseRouteApi, AnyContext, AnyRoute, AnyRouter, ConstrainLiteral, ErrorComponentProps, NotFoundError, NotFoundRouteProps, Register, RegisteredRouter, ResolveFullPath, ResolveId, ResolveParams, RootRoute as RootRouteCore, RootRouteId, RootRouteOptions, RouteConstraints, Route as RouteCore, RouteIds, RouteMask, RouteOptions, RouteTypesById, RouterCore, ToMaskOptions, UseNavigateResult } from '@tanstack/router-core';
import { default as React } from 'react';
import { UseLoaderDataRoute } from './useLoaderData.js';
import { UseMatchRoute } from './useMatch.js';
import { UseLoaderDepsRoute } from './useLoaderDeps.js';
import { UseParamsRoute } from './useParams.js';
import { UseSearchRoute } from './useSearch.js';
import { UseRouteContextRoute } from './useRouteContext.js';
import { LinkComponentRoute } from './link.js';
declare module '@tanstack/router-core' {
interface UpdatableRouteOptionsExtensions {
component?: RouteComponent;
errorComponent?: false | null | undefined | ErrorRouteComponent;
notFoundComponent?: NotFoundRouteComponent;
pendingComponent?: RouteComponent;
}
interface RootRouteOptionsExtensions {
shellComponent?: ({ children, }: {
children: React.ReactNode;
}) => React.ReactNode;
}
interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
useMatch: UseMatchRoute<TId>;
useRouteContext: UseRouteContextRoute<TId>;
useSearch: UseSearchRoute<TId>;
useParams: UseParamsRoute<TId>;
useLoaderDeps: UseLoaderDepsRoute<TId>;
useLoaderData: UseLoaderDataRoute<TId>;
useNavigate: () => UseNavigateResult<TFullPath>;
Link: LinkComponentRoute<TFullPath>;
}
}
/**
* Returns a route-specific API that exposes type-safe hooks pre-bound
* to a single route ID. Useful for consuming a route's APIs from files
* where the route object isn't directly imported (e.g. code-split files).
*
* @param id Route ID string literal for the target route.
* @returns A `RouteApi` instance bound to the given route ID.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/getRouteApiFunction
*/
export declare function getRouteApi<const TId, TRouter extends AnyRouter = RegisteredRouter>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>): RouteApi<TId, TRouter>;
export declare class RouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> extends BaseRouteApi<TId, TRouter> {
/**
* @deprecated Use the `getRouteApi` function instead.
*/
constructor({ id }: {
id: TId;
});
useMatch: UseMatchRoute<TId>;
useRouteContext: UseRouteContextRoute<TId>;
useSearch: UseSearchRoute<TId>;
useParams: UseParamsRoute<TId>;
useLoaderDeps: UseLoaderDepsRoute<TId>;
useLoaderData: UseLoaderDataRoute<TId>;
useNavigate: () => UseNavigateResult<RouteTypesById<TRouter, TId>["fullPath"]>;
notFound: (opts?: NotFoundError) => NotFoundError;
Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>;
}
export declare class Route<in out TRegister = unknown, in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, in out TPath extends RouteConstraints['TPath'] = '/', in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends RouteConstraints['TCustomId'] = string, in out TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchValidator = undefined, in out TParams = ResolveParams<TPath>, in out TRouterContext = AnyContext, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown, in out TSSR = unknown, in out TServerMiddlewares = unknown, in out THandlers = undefined> extends BaseRoute<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers> implements RouteCore<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers> {
/**
* @deprecated Use the `createRoute` function instead.
*/
constructor(options?: RouteOptions<TRegister, TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares, THandlers>);
useMatch: UseMatchRoute<TId>;
useRouteContext: UseRouteContextRoute<TId>;
useSearch: UseSearchRoute<TId>;
useParams: UseParamsRoute<TId>;
useLoaderDeps: UseLoaderDepsRoute<TId>;
useLoaderData: UseLoaderDataRoute<TId>;
useNavigate: () => UseNavigateResult<TFullPath>;
Link: LinkComponentRoute<TFullPath>;
}
/**
* Creates a non-root Route instance for code-based routing.
*
* Use this to define a route that will be composed into a route tree
* (typically via a parent route's `addChildren`). If you're using file-based
* routing, prefer `createFileRoute`.
*
* @param options Route options (path, component, loader, context, etc.).
* @returns A Route instance to be attached to the route tree.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction
*/
export declare function createRoute<TRegister = unknown, TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, const TServerMiddlewares = unknown>(options: RouteOptions<TRegister, TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, AnyContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares>): Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, AnyContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TSSR, TServerMiddlewares>;
export type AnyRootRoute = RootRoute<any, any, any, any, any, any, any, any, any, any, any>;
/**
* Creates a root route factory that requires a router context type.
*
* Use when your root route expects `context` to be provided to `createRouter`.
* The returned function behaves like `createRootRoute` but enforces a context type.
*
* @returns A factory function to configure and return a root route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction
*/
export declare function createRootRouteWithContext<TRouterContext extends {}>(): <TRegister = Register, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TSSR = unknown, TServerMiddlewares = unknown>(options?: RootRouteOptions<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, TServerMiddlewares>) => RootRoute<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown, TSSR, TServerMiddlewares, undefined>;
/**
* @deprecated Use the `createRootRouteWithContext` function instead.
*/
export declare const rootRouteWithContext: typeof createRootRouteWithContext;
export declare class RootRoute<in out TRegister = unknown, in out TSearchValidator = undefined, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown, in out TSSR = unknown, in out TServerMiddlewares = unknown, in out THandlers = undefined> extends BaseRootRoute<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers> implements RootRouteCore<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers> {
/**
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
*/
constructor(options?: RootRouteOptions<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, TServerMiddlewares, THandlers>);
useMatch: UseMatchRoute<RootRouteId>;
useRouteContext: UseRouteContextRoute<RootRouteId>;
useSearch: UseSearchRoute<RootRouteId>;
useParams: UseParamsRoute<RootRouteId>;
useLoaderDeps: UseLoaderDepsRoute<RootRouteId>;
useLoaderData: UseLoaderDataRoute<RootRouteId>;
useNavigate: () => UseNavigateResult<"/">;
Link: LinkComponentRoute<'/'>;
}
/**
* Creates a root Route instance used to build your route tree.
*
* Typically paired with `createRouter({ routeTree })`. If you need to require
* a typed router context, use `createRootRouteWithContext` instead.
*
* @param options Root route options (component, error, pending, etc.).
* @returns A root route instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction
*/
export declare function createRootRoute<TRegister = Register, TSearchValidator = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TSSR = unknown, const TServerMiddlewares = unknown, THandlers = undefined>(options?: RootRouteOptions<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, TServerMiddlewares, THandlers>): RootRoute<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown, TSSR, TServerMiddlewares, THandlers>;
export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends string, TTo extends string>(opts: {
routeTree: TRouteTree;
} & ToMaskOptions<RouterCore<TRouteTree, 'never', boolean>, TFrom, TTo>): RouteMask<TRouteTree>;
export interface DefaultRouteTypes<TProps> {
component: ((props: TProps) => any) | React.LazyExoticComponent<(props: TProps) => any>;
}
export interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {
}
export type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {
preload?: () => Promise<void>;
};
export type RouteComponent = AsyncRouteComponent<{}>;
export type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>;
export type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component'];
export declare class NotFoundRoute<TRegister, TParentRoute extends AnyRootRoute, TRouterContext = AnyContext, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, TServerMiddlewares = unknown> extends Route<TRegister, TParentRoute, '/404', '/404', '404', '404', TSearchValidator, {}, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TSSR, TServerMiddlewares> {
constructor(options: Omit<RouteOptions<TRegister, TParentRoute, string, string, string, string, TSearchValidator, {}, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares>, 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'path' | 'id' | 'params'>);
}
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseEffectsDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const any_js_1 = require("./any.js");
function parseEffectsDef(_def, refs) {
return refs.effectStrategy === "input"
? (0, parseDef_js_1.parseDef)(_def.schema._def, refs)
: (0, any_js_1.parseAnyDef)(refs);
}
exports.parseEffectsDef = parseEffectsDef;
@@ -0,0 +1,121 @@
import { HTTPException } from "../../http-exception.js";
import { getCookie, getSignedCookie } from "../../helper/cookie/index.js";
import { Jwt } from "../../utils/jwt/index.js";
//#region src/middleware/jwk/jwk.ts
/**
* JWK Auth Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/jwk}
*
* @param {object} options - The options for the JWK middleware.
* @param {HonoJsonWebKey[] | ((ctx: Context) => Promise<HonoJsonWebKey[]> | HonoJsonWebKey[])} [options.keys] - The public keys used for JWK verification, or a function that returns them.
* @param {string | ((ctx: Context) => Promise<string> | string)} [options.jwks_uri] - If set to a URI string or a function that returns a URI string, attempt to fetch JWKs from it. The response must be a JSON object containing a `keys` array, which will be merged with the `keys` option.
* @param {boolean} [options.allow_anon] - If set to `true`, the middleware allows requests without a token to proceed without authentication.
* @param {string} [options.cookie] - If set, the middleware attempts to retrieve the token from a cookie with these options (optionally signed) only if no token is found in the header.
* @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'.
* @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL.
* @param {AsymmetricAlgorithm[]} options.alg - An array of allowed asymmetric algorithms for JWT verification. Only tokens signed with these algorithms will be accepted.
* @param {RequestInit} [init] - Optional init options for the `fetch` request when retrieving JWKS from a URI.
* @param {VerifyOptions} [options.verification] - Additional options for JWK payload verification.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use("/auth/*", jwk({
* jwks_uri: (c) => `https://${c.env.authServer}/.well-known/jwks.json`,
* headerName: 'x-custom-auth-header', // Optional, default is 'Authorization'
* }))
*
* app.get('/auth/page', (c) => {
* return c.text('You are authorized')
* })
* ```
*/
const jwk = (options, init) => {
const verifyOpts = options.verification || {};
if (!options || !(options.keys || options.jwks_uri)) throw new Error("JWK auth middleware requires options for either \"keys\" or \"jwks_uri\" or both");
if (!crypto.subtle || !crypto.subtle.importKey) throw new Error("`crypto.subtle.importKey` is undefined. JWK auth middleware requires it.");
return async function jwk(ctx, next) {
const headerName = options.headerName || "Authorization";
const credentials = ctx.req.raw.headers.get(headerName);
let token;
if (credentials) {
const parts = credentials.split(/\s+/);
if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") {
const errDescription = "invalid credentials structure";
throw new HTTPException(401, {
message: errDescription,
res: unauthorizedResponse({
ctx,
error: "invalid_request",
errDescription,
realm: options.realm
})
});
} else token = parts[1];
} else if (options.cookie) {
if (typeof options.cookie == "string") token = getCookie(ctx, options.cookie);
else if (options.cookie.secret) {
if (options.cookie.prefixOptions) token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key, options.cookie.prefixOptions);
else token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key);
} else if (options.cookie.prefixOptions) token = getCookie(ctx, options.cookie.key, options.cookie.prefixOptions);
else token = getCookie(ctx, options.cookie.key);
}
if (!token) {
if (options.allow_anon) return next();
const errDescription = "no authorization included in request";
throw new HTTPException(401, {
message: errDescription,
res: unauthorizedResponse({
ctx,
error: "invalid_request",
errDescription,
realm: options.realm
})
});
}
let payload;
let cause;
try {
const keys = typeof options.keys === "function" ? await options.keys(ctx) : options.keys;
const jwks_uri = typeof options.jwks_uri === "function" ? await options.jwks_uri(ctx) : options.jwks_uri;
payload = await Jwt.verifyWithJwks(token, {
keys,
jwks_uri,
verification: verifyOpts,
allowedAlgorithms: options.alg
}, init);
} catch (e) {
cause = e;
}
if (!payload) {
if (cause instanceof Error && cause.constructor === Error) throw cause;
throw new HTTPException(401, {
message: "Unauthorized",
res: unauthorizedResponse({
ctx,
error: "invalid_token",
statusText: "Unauthorized",
errDescription: "token verification failure",
realm: options.realm
}),
cause
});
}
ctx.set("jwtPayload", payload);
await next();
};
};
function unauthorizedResponse(opts) {
const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "\\\"");
const errDescription = opts.errDescription.replace(/"/g, "\\\"");
return new Response("Unauthorized", {
status: 401,
statusText: opts.statusText,
headers: { "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` }
});
}
//#endregion
export { jwk };
@@ -0,0 +1 @@
{"version":3,"file":"list-minus.js","sources":["../../../src/icons/list-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ListMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTJIMyIgLz4KICA8cGF0aCBkPSJNMTYgNkgzIiAvPgogIDxwYXRoIGQ9Ik0xNiAxOEgzIiAvPgogIDxwYXRoIGQ9Ik0yMSAxMmgtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/list-minus\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 ListMinus = createLucideIcon('ListMinus', [\n ['path', { d: 'M11 12H3', key: '51ecnj' }],\n ['path', { d: 'M16 6H3', key: '1wxfjs' }],\n ['path', { d: 'M16 18H3', key: '12xzn7' }],\n ['path', { d: 'M21 12h-6', key: 'bt1uis' }],\n]);\n\nexport default ListMinus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,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;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,6 @@
import { Delay } from "../delay.base";
export declare class SkipFirstDelay extends Delay {
apply(): Promise<unknown>;
private readonly isFirstAttempt;
protected readonly numOfDelayedAtt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AC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,KAAK,CAAC,EAAE;QACN;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,KAAK,CAAC,EAAE;QACN;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,QAAQ,CAAC,EAAE;YACT;;eAEG;YACH,KAAK,CAAC,EAAE;gBACN;;mBAEG;gBACH,IAAI,CAAC,EAAE,MAAM,CAAC;aACf,CAAC;SACH,CAAC;KACH,CAAC;IACF;;OAEG;IACH,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACnB;;;;;;;;;;;OAWG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;Line truncated
@@ -0,0 +1,279 @@
# RedirectHandler
<!--introduced_in=v4.0.0-->
<!--type=module-->
<!-- source_link=lib/handler/redirect-handler.js -->
> Stability: 2 - Stable
A dispatch handler that follows HTTP redirects on behalf of another handler. It
wraps a downstream `handler` and a `dispatch` function: when a redirectable
response is received it transparently re-dispatches the request to the new
location, forwarding the lifecycle callbacks to the wrapped `handler` only once a
final (non-redirect) response is reached.
Redirects are followed for the `300`, `301`, `302`, `303`, `307`, and `308`
status codes, up to `maxRedirections` hops. Following the relevant HTTP
specifications, the method is downgraded to `GET` for `301`/`302` `POST`
responses and for `303` responses with any method other than `HEAD`, request
bodies that have already been consumed are not replayed, and headers that refer
to the original URL (such as `host`) are stripped on each hop, with additional
credential headers removed on cross-origin redirects.
```mjs
import { RedirectHandler } from 'undici'
```
```cjs
const { RedirectHandler } = require('undici')
```
Most users do not construct `RedirectHandler` directly. The `maxRedirections`
option on [`Dispatcher`][] methods and the higher-level clients use it
internally.
## Class: `RedirectHandler`
<!-- YAML
added: v4.0.0
-->
* Extends: {DispatchHandler}
Implements the [`DispatchHandler`][] interface, delegating every callback to the
wrapped `handler` while intercepting redirect responses.
### `new RedirectHandler(dispatch, maxRedirections, opts, handler)`
<!-- YAML
added: v4.0.0
-->
* `dispatch` {Function} The dispatch function used to issue the original request
and every subsequent redirect. Called as `dispatch(options, handler)`.
* `maxRedirections` {number|null} The maximum number of redirects to follow. Must
be a non-negative integer or `null`. When `null` or `0`, no redirects are
followed and redirect responses are passed through to the wrapped `handler`.
* `opts` {DispatchOptions} The dispatch options for the request. In addition to
the standard dispatch options, the following redirect-specific fields are
recognized:
* `throwOnMaxRedirect` {boolean} When `true`, an error is thrown when a
redirect would be followed but `maxRedirections` has been reached, instead of
returning that redirect response. A non-redirect response after exactly
`maxRedirections` redirects is returned normally. **Default:** `false`.
* `stripHeadersOnRedirect` {string[]} Header names to remove from the request on
every redirect hop. **Default:** `null`.
* `stripHeadersOnCrossOriginRedirect` {string[]} Additional header names to
remove from the request when a redirect points to a different origin.
**Default:** `null`.
* `handler` {DispatchHandler} The downstream handler that receives the lifecycle
callbacks for the final response.
Throws an [`InvalidArgumentError`][] when `maxRedirections` is not a non-negative
integer, when `throwOnMaxRedirect` is not a boolean, or when either
`stripHeadersOnRedirect` or `stripHeadersOnCrossOriginRedirect` is not an array of
header-name strings.
```mjs
import { Client, RedirectHandler } from 'undici'
const client = new Client('http://example.com')
const dispatch = client.dispatch.bind(client)
const handler = new RedirectHandler(dispatch, 5, {
method: 'GET',
path: '/',
origin: 'http://example.com',
}, {
onRequestStart () {},
onResponseStart (controller, statusCode, headers) {
console.log(statusCode)
},
onResponseData (controller, chunk) {},
onResponseEnd () {},
})
dispatch({ method: 'GET', path: '/', origin: 'http://example.com' }, handler)
```
### Static method: `RedirectHandler.buildDispatch(dispatcher, maxRedirections)`
<!-- YAML
added: v7.0.0
-->
* `dispatcher` {Dispatcher} The dispatcher whose `dispatch` method is wrapped.
* `maxRedirections` {number|null} The maximum number of redirects to follow. Must
be a non-negative integer or `null`.
* Returns: {Function} A `dispatch(options, handler)` function that wraps each call
in a `RedirectHandler` before delegating to `dispatcher`.
Builds a redirect-aware dispatch function from an existing dispatcher. The
returned function has the same shape as `dispatcher.dispatch` but follows
redirects automatically. Throws an [`InvalidArgumentError`][] when
`maxRedirections` is not a non-negative integer.
```mjs
import { Client, RedirectHandler } from 'undici'
const client = new Client('http://example.com')
const dispatch = RedirectHandler.buildDispatch(client, 5)
dispatch({ method: 'GET', path: '/', origin: 'http://example.com' }, {
onRequestStart () {},
onResponseStart (controller, statusCode) {
console.log(statusCode)
},
onResponseData () {},
onResponseEnd () {},
})
```
### `redirectHandler.onRequestStart(controller, context)`
<!-- YAML
added: v7.0.0
-->
* `controller` {DispatchController} The controller for the in-flight request.
* `context` {Object} The dispatch context.
Forwards the request-start event to the wrapped `handler`, augmenting `context`
with the current redirect `history`.
### `redirectHandler.onRequestUpgrade(controller, statusCode, headers, socket)`
<!-- YAML
added: v7.0.0
-->
* `controller` {DispatchController} The controller for the in-flight request.
* `statusCode` {number} The HTTP status code of the upgrade response.
* `headers` {Object} The response headers.
* `socket` {Duplex} The upgraded socket.
Forwards a connection upgrade to the wrapped `handler`.
### `redirectHandler.onResponseStart(controller, statusCode, headers, statusMessage)`
<!-- YAML
added: v7.0.0
-->
* `controller` {DispatchController} The controller for the in-flight request.
* `statusCode` {number} The HTTP status code of the response.
* `headers` {Object} The response headers.
* `statusMessage` {string} The HTTP status message.
Inspects the response headers to decide whether to follow a redirect. When the
status code is redirectable, the response has a `Location` header, the
`maxRedirections` limit has not been reached, and the request body has not been
consumed, the `location` property is set, the method and headers are adjusted
for the next hop, and the response is not forwarded. Otherwise the event is
forwarded to the wrapped `handler`.
Throws when `throwOnMaxRedirect` is `true` and a redirect that would otherwise be
followed arrives after `maxRedirections` redirects have already been followed,
and throws an [`InvalidArgumentError`][] if a
redirect loop is detected (for example when a [`Client`][] or [`Pool`][] is used
for a cross-origin redirect; use an [`Agent`][] instead).
### `redirectHandler.onResponseData(controller, chunk)`
<!-- YAML
added: v7.0.0
-->
* `controller` {DispatchController} The controller for the in-flight request.
* `chunk` {Buffer} A chunk of the response body.
Forwards body data to the wrapped `handler`. While a redirect is pending
(`location` is set), the `3xx` response body is ignored.
### `redirectHandler.onResponseEnd(controller, trailers)`
<!-- YAML
added: v7.0.0
-->
* `controller` {DispatchController} The controller for the in-flight request.
* `trailers` {Object} The response trailers.
Completes the response. When a redirect is pending, the request is re-dispatched
to the new `location`; otherwise the end event is forwarded to the wrapped
`handler`.
### `redirectHandler.onResponseError(controller, error)`
<!-- YAML
added: v7.0.0
-->
* `controller` {DispatchController} The controller for the in-flight request.
* `error` {Error} The error that occurred.
Forwards the error to the wrapped `handler`.
### `redirectHandler.location`
<!-- YAML
added: v4.0.0
-->
* Type: {string|null}
The `Location` header value of the redirect currently being followed, or `null`
when no redirect is pending and the response is being passed through to the
wrapped `handler`.
### `redirectHandler.opts`
<!-- YAML
added: v7.12.0
-->
* Type: {DispatchOptions}
A copy of the dispatch options for the next request. It excludes the redirect
control fields (`maxRedirections`, `stripHeadersOnRedirect`, and
`stripHeadersOnCrossOriginRedirect`) and is mutated on each hop to reflect the
updated method, path, origin, and headers.
### `redirectHandler.maxRedirections`
<!-- YAML
added: v4.0.0
-->
* Type: {number|null}
The maximum number of redirects this handler will follow.
### `redirectHandler.handler`
<!-- YAML
added: v4.0.0
-->
* Type: {DispatchHandler}
The wrapped downstream handler that receives the lifecycle callbacks for the final
response.
### `redirectHandler.history`
<!-- YAML
added: v4.0.0
-->
* Type: {URL[]}
The ordered list of URLs visited while following redirects. It is used to enforce
`maxRedirections` and to detect redirect loops.
[`Agent`]: Agent.md#class-agent
[`Client`]: Client.md#class-client
[`Dispatcher`]: Dispatcher.md#class-dispatcher
[`DispatchHandler`]: Dispatcher.md#parameter-dispatchhandler
[`InvalidArgumentError`]: Errors.md#class-invalidargumenterror
[`Pool`]: Pool.md#class-pool
@@ -0,0 +1,5 @@
import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function dynamicRef(cxt: KeywordCxt, ref: string): void;
export default def;
@@ -0,0 +1 @@
{"version":3,"file":"CatchBoundary.js","names":[],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport type { ErrorRouteComponent } from './route'\nimport type { ErrorInfo } from 'react'\n\nexport function CatchBoundary(props: {\n getResetKey: () => number | string\n children: React.ReactNode\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n}) {\n const errorComponent = props.errorComponent ?? ErrorComponent\n\n return (\n <CatchBoundaryImpl\n getResetKey={props.getResetKey}\n onCatch={props.onCatch}\n children={({ error, reset }) => {\n if (error) {\n return React.createElement(errorComponent, {\n error,\n reset,\n })\n }\n\n return props.children\n }}\n />\n )\n}\n\nclass CatchBoundaryImpl extends React.Component<{\n getResetKey: () => number | string\n children: (props: {\n error: Error | null\n reset: () => void\n }) => React.ReactNode\n onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n}> {\n state = { error: null } as { error: Error | null; resetKey?: string | number }\n\n static getDerivedStateFromProps(\n props: { getResetKey: () => string | number },\n state: { resetKey?: string | number; error: Error | null },\n ) {\n const resetKey = props.getResetKey()\n\n if (state.error && state.resetKey !== resetKey) {\n return { resetKey, error: null }\n }\n\n return { resetKey }\n }\n static getDerivedStateFromError(error: Error) {\n return { error }\n }\n reset() {\n this.setState({ error: null })\n }\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n if (this.props.onCatch) {\n this.props.onCatch(error, errorInfo)\n }\n }\n render() {\n return this.props.children({\n error: this.state.error,\n reset: () => {\n this.reset()\n },\n })\n }\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = React.useState(process.env.NODE_ENV !== 'production')\n\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '.5rem' }}>\n <strong style={{ fontSize: '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n fontSize: '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show ? (\n <div>\n <pre\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;AAMA,SAAgB,cAAc,OAK3B;CACD,MAAM,iBAAiB,MAAM,kBAAkB;AAE/C,QACE,oBAAC,mBAAD;EACE,aAAa,MAAM;EACnB,SAAS,MAAM;EACf,WAAW,EAAE,OAAO,YAAY;AAC9B,OAAI,MACF,QAAO,QAAM,cAAc,gBAAgB;IACzC;IACA;IACD,CAAC;AAGJ,UAAO,MAAM;;EAEf,CAAA;;AAIN,IAAM,oBAAN,cAAgC,QAAM,UAOnC;;;eACO,EAAE,OAAO,MAAM;;CAEvB,OAAO,yBACL,OACA,OACA;EACA,MAAM,WAAW,MAAM,aAAa;AAEpC,MAAI,MAAM,SAAS,MAAM,aAAa,SACpC,QAAO;GAAE;GAAU,OAAO;GAAM;AAGlC,SAAO,EAAE,UAAU;;CAErB,OAAO,yBAAyB,OAAc;AAC5C,SAAO,EAAE,OAAO;;CAElB,QAAQ;AACN,OAAK,SAAS,EAAE,OAAO,MAAM,CAAC;;CAEhC,kBAAkB,OAAc,WAAsB;AACpD,MAAI,KAAK,MAAM,QACb,MAAK,MAAM,QAAQ,OAAO,UAAU;;CAGxC,SAAS;AACP,SAAO,KAAK,MAAM,SAAS;GACzB,OAAO,KAAK,MAAM;GAClB,aAAa;AACX,SAAK,OAAO;;GAEf,CAAC;;;AAIN,SAAgB,eAAe,EAAE,SAAyB;CACxD,MAAM,CAAC,MAAM,WAAW,QAAM,SAAA,QAAA,IAAA,aAAkC,aAAa;AAE7E,QACE,qBAAC,OAAD;EAAK,OAAO;GAAE,SAAS;GAAS,UAAU;GAAQ;YAAlD;GACE,qBAAC,OAAD;IAAK,OAAO;KAAE,SAAS;KAAQ,YAAY;KAAU,KAAK;KAAS;cAAnE,CACE,oBAAC,UAAD;KAAQ,OAAO,EAAE,UAAU,QAAQ;eAAE;KAA8B,CAAA,EACnE,oBAAC,UAAD;KACE,OAAO;MACL,YAAY;MACZ,UAAU;MACV,QAAQ;MACR,SAAS;MACT,YAAY;MACZ,cAAc;MACf;KACD,eAAe,SAAS,MAAM,CAAC,EAAE;eAEhC,OAAO,eAAe;KAChB,CAAA,CACL;;GACN,oBAAC,OAAD,EAAK,OAAO,EAAE,QAAQ,UAAU,EAAI,CAAA;GACnC,OACC,oBAAC,OAAD,EAAA,UACE,oBAAC,OAAD;IACE,OAAO;KACL,UAAU;KACV,QAAQ;KACR,cAAc;KACd,SAAS;KACT,OAAO;KACP,UAAU;KACX;cAEA,MAAM,UAAU,oBAAC,QAAD,EAAA,UAAO,MAAM,SAAe,CAAA,GAAG;IAC5C,CAAA,EACF,CAAA,GACJ;GACA"}
@@ -0,0 +1 @@
{"version":3,"file":"salad.js","sources":["../../../src/icons/salad.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Salad\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyAyMWgxMCIgLz4KICA8cGF0aCBkPSJNMTIgMjFhOSA5IDAgMCAwIDktOUgzYTkgOSAwIDAgMCA5IDlaIiAvPgogIDxwYXRoIGQ9Ik0xMS4zOCAxMmEyLjQgMi40IDAgMCAxLS40LTQuNzcgMi40IDIuNCAwIDAgMSAzLjItMi43NyAyLjQgMi40IDAgMCAxIDMuNDctLjYzIDIuNCAyLjQgMCAwIDEgMy4zNyAzLjM3IDIuNCAyLjQgMCAwIDEtMS4xIDMuNyAyLjUxIDIuNTEgMCAwIDEgLjAzIDEuMSIgLz4KICA8cGF0aCBkPSJtMTMgMTIgNC00IiAvPgogIDxwYXRoIGQ9Ik0xMC45IDcuMjVBMy45OSAzLjk5IDAgMCAwIDQgMTBjMCAuNzMuMiAxLjQxLjU0IDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/salad\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 Salad = createLucideIcon('Salad', [\n ['path', { d: 'M7 21h10', key: '1b0cd5' }],\n ['path', { d: 'M12 21a9 9 0 0 0 9-9H3a9 9 0 0 0 9 9Z', key: '4rw317' }],\n [\n 'path',\n {\n d: 'M11.38 12a2.4 2.4 0 0 1-.4-4.77 2.4 2.4 0 0 1 3.2-2.77 2.4 2.4 0 0 1 3.47-.63 2.4 2.4 0 0 1 3.37 3.37 2.4 2.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,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACpF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlignHorizontalDistributeStart = createLucideIcon("AlignHorizontalDistributeStart", [
["rect", { width: "6", height: "14", x: "4", y: "5", rx: "2", key: "1wwnby" }],
["rect", { width: "6", height: "10", x: "14", y: "7", rx: "2", key: "1fe6j6" }],
["path", { d: "M4 2v20", key: "gtpd5x" }],
["path", { d: "M14 2v20", key: "tg6bpw" }]
]);
export { AlignHorizontalDistributeStart as default };
//# sourceMappingURL=align-horizontal-distribute-start.js.map
@@ -0,0 +1 @@
{"version":3,"file":"normalize-unicode.js","sourceRoot":"","sources":["../../src/normalize-unicode.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,+CAA+C;AAC/C,6CAA6C;AAC7C,4CAA4C;AAC5C,MAAM,cAAc,GAA2B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAElE,4DAA4D;AAC5D,MAAM,GAAG,GAAG,KAAK,CAAA;AACjB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;AACxB,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAU,EAAE;IACpD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAClB,4CAA4C;QAC5C,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC;aAClB,SAAS,CAAC,KAAK,CAAC;aAChB,iBAAiB,CAAC,IAAI,CAAC;aACvB,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAEZ,MAAM,GAAG,GAAG,cAAc,CAAC,CAAC,CAAW,CAAA;IAEvC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,GAAG,CAAA;IACxB,yCAAyC;IACzC,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACf,OAAO,cAAc,CAAC,CAAC,CAAC,CAAA;YACxB,IAAI,EAAE,CAAC,IAAI,CAAC;gBAAE,MAAK;QACrB,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAzBY,QAAA,gBAAgB,oBAyB5B","sourcesContent":["// warning: extremely hot code path.\n// This has been meticulously optimized for use\n// within npm install on large package trees.\n// Do not edit without careful benchmarking.\nconst normalizeCache: Record<string, string> = Object.create(null)\n\n// Limit the size of this. Very low-sophistication LRU cache\nconst MAX = 10000\nconst cache = new Set<string>()\nexport const normalizeUnicode = (s: string): string => {\n if (!cache.has(s)) {\n // shake out identical accents and ligatures\n normalizeCache[s] = s\n .normalize('NFD')\n .toLocaleLowerCase('en')\n .toLocaleUpperCase('en')\n } else {\n cache.delete(s)\n }\n cache.add(s)\n\n const ret = normalizeCache[s] as string\n\n let i = cache.size - MAX\n // only prune when we're 10% over the max\n if (i > MAX / 10) {\n for (const s of cache) {\n cache.delete(s)\n delete normalizeCache[s]\n if (--i <= 0) break\n }\n }\n\n return ret\n}\n"]}
@@ -0,0 +1,11 @@
import { AsyncRouteComponent } from './route.cjs';
/**
* Wrap a dynamic import to create a route component that supports
* `.preload()` and friendly reload-on-module-missing behavior.
*
* @param importer Function returning a module promise
* @param exportName Named export to use (default: `default`)
* @returns A lazy route component compatible with TanStack Router
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction
*/
export declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never;
@@ -0,0 +1,207 @@
var fs = require('fs')
var path = require('path')
var os = require('os')
// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'
var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line
var vars = (process.config && process.config.variables) || {}
var prebuildsOnly = !!process.env.PREBUILDS_ONLY
var abi = process.versions.modules // TODO: support old node where this is undef
var runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node')
var arch = process.env.npm_config_arch || os.arch()
var platform = process.env.npm_config_platform || os.platform()
var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc')
var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''
var uv = (process.versions.uv || '').split('.')[0]
module.exports = load
function load (dir) {
return runtimeRequire(load.resolve(dir))
}
load.resolve = load.path = function (dir) {
dir = path.resolve(dir || '.')
try {
var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_')
if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']
} catch (err) {}
if (!prebuildsOnly) {
var release = getFirst(path.join(dir, 'build/Release'), matchBuild)
if (release) return release
var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild)
if (debug) return debug
}
var prebuild = resolve(dir)
if (prebuild) return prebuild
var nearby = resolve(path.dirname(process.execPath))
if (nearby) return nearby
var target = [
'platform=' + platform,
'arch=' + arch,
'runtime=' + runtime,
'abi=' + abi,
'uv=' + uv,
armv ? 'armv=' + armv : '',
'libc=' + libc,
'node=' + process.versions.node,
process.versions.electron ? 'electron=' + process.versions.electron : '',
typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line
].filter(Boolean).join(' ')
throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n')
function resolve (dir) {
// Find matching "prebuilds/<platform>-<arch>" directory
var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)
var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]
if (!tuple) return
// Find most specific flavor first
var prebuilds = path.join(dir, 'prebuilds', tuple.name)
var parsed = readdirSync(prebuilds).map(parseTags)
var candidates = parsed.filter(matchTags(runtime, abi))
var winner = candidates.sort(compareTags(runtime))[0]
if (winner) return path.join(prebuilds, winner.file)
}
}
function readdirSync (dir) {
try {
return fs.readdirSync(dir)
} catch (err) {
return []
}
}
function getFirst (dir, filter) {
var files = readdirSync(dir).filter(filter)
return files[0] && path.join(dir, files[0])
}
function matchBuild (name) {
return /\.node$/.test(name)
}
function parseTuple (name) {
// Example: darwin-x64+arm64
var arr = name.split('-')
if (arr.length !== 2) return
var platform = arr[0]
var architectures = arr[1].split('+')
if (!platform) return
if (!architectures.length) return
if (!architectures.every(Boolean)) return
return { name, platform, architectures }
}
function matchTuple (platform, arch) {
return function (tuple) {
if (tuple == null) return false
if (tuple.platform !== platform) return false
return tuple.architectures.includes(arch)
}
}
function compareTuples (a, b) {
// Prefer single-arch prebuilds over multi-arch
return a.architectures.length - b.architectures.length
}
function parseTags (file) {
var arr = file.split('.')
var extension = arr.pop()
var tags = { file: file, specificity: 0 }
if (extension !== 'node') return
for (var i = 0; i < arr.length; i++) {
var tag = arr[i]
if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {
tags.runtime = tag
} else if (tag === 'napi') {
tags.napi = true
} else if (tag.slice(0, 3) === 'abi') {
tags.abi = tag.slice(3)
} else if (tag.slice(0, 2) === 'uv') {
tags.uv = tag.slice(2)
} else if (tag.slice(0, 4) === 'armv') {
tags.armv = tag.slice(4)
} else if (tag === 'glibc' || tag === 'musl') {
tags.libc = tag
} else {
continue
}
tags.specificity++
}
return tags
}
function matchTags (runtime, abi) {
return function (tags) {
if (tags == null) return false
if (tags.runtime && tags.runtime !== runtime && !runtimeAgnostic(tags)) return false
if (tags.abi && tags.abi !== abi && !tags.napi) return false
if (tags.uv && tags.uv !== uv) return false
if (tags.armv && tags.armv !== armv) return false
if (tags.libc && tags.libc !== libc) return false
return true
}
}
function runtimeAgnostic (tags) {
return tags.runtime === 'node' && tags.napi
}
function compareTags (runtime) {
// Precedence: non-agnostic runtime, abi over napi, then by specificity.
return function (a, b) {
if (a.runtime !== b.runtime) {
return a.runtime === runtime ? -1 : 1
} else if (a.abi !== b.abi) {
return a.abi ? -1 : 1
} else if (a.specificity !== b.specificity) {
return a.specificity > b.specificity ? -1 : 1
} else {
return 0
}
}
}
function isNwjs () {
return !!(process.versions && process.versions.nw)
}
function isElectron () {
if (process.versions && process.versions.electron) return true
if (process.env.ELECTRON_RUN_AS_NODE) return true
return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'
}
function isAlpine (platform) {
return platform === 'linux' && fs.existsSync('/etc/alpine-release')
}
// Exposed for unit tests
// TODO: move to lib
load.parseTags = parseTags
load.matchTags = matchTags
load.compareTags = compareTags
load.parseTuple = parseTuple
load.matchTuple = matchTuple
load.compareTuples = compareTuples
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClassFieldInitializerScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class ClassFieldInitializerScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.classFieldInitializer, upperScope, block, false);
}
}
exports.ClassFieldInitializerScope = ClassFieldInitializerScope;
@@ -0,0 +1 @@
{"version":3,"file":"handlerCallback.js","names":[],"sources":["../../../src/ssr/handlerCallback.ts"],"sourcesContent":["import type { AnyRouter } from '../router'\n\nexport interface HandlerCallback<TRouter extends AnyRouter> {\n (ctx: {\n request: Request\n router: TRouter\n responseHeaders: Headers\n }): Response | Promise<Response>\n}\n\nexport function defineHandlerCallback<TRouter extends AnyRouter>(\n handler: HandlerCallback<TRouter>,\n): HandlerCallback<TRouter> {\n return handler\n}\n"],"mappings":";AAUA,SAAgB,sBACd,SAC0B;AAC1B,QAAO"}
@@ -0,0 +1 @@
module.exports={C:{"115":0.0103,"120":0.7878,"121":1.5447,"123":0.00515,"124":0.01545,"125":0.00515,"136":0.00515,"137":0.00515,"138":0.0103,"140":0.0103,"146":0.00515,"150":0.02575,"151":0.00515,"152":0.00515,"153":0.0103,"154":0.06179,"155":0.27805,"156":0.27805,"157":0.0103,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 128 129 130 131 132 133 134 135 139 141 142 143 144 145 147 148 149 158 159 160 3.5 3.6"},D:{"62":0.00515,"65":0.00515,"66":0.00515,"69":0.00515,"70":0.00515,"75":0.00515,"76":0.00515,"79":0.03089,"87":0.02575,"88":0.00515,"91":0.01545,"92":0.03089,"93":0.02575,"97":0.01545,"98":0.0103,"101":0.0103,"102":0.00515,"103":0.36043,"104":0.30894,"105":0.30894,"106":0.29864,"107":0.31924,"108":0.31409,"109":0.72601,"110":0.30379,"111":0.39132,"112":0.30894,"114":0.01545,"116":0.61273,"117":0.31409,"118":1.24606,"119":1.51381,"120":1.85364,"121":0.0103,"122":0.0103,"123":0.01545,"124":0.31409,"125":0.00515,"126":0.0206,"127":0.00515,"128":0.03604,"129":0.03089,"130":0.0103,"131":0.61273,"132":0.01545,"133":0.80324,"134":0.2523,"135":0.24715,"136":0.2523,"137":0.2729,"138":0.31409,"139":0.25745,"140":0.29864,"141":0.37588,"142":0.92682,"143":0.0206,"144":0.47371,"145":0.12358,"146":0.20081,"147":0.02575,"148":0.16477,"149":0.30894,"150":0.33469,"151":8.84598,"152":4.97908,"153":5.34466,"154":1.09159,"155":0.0103,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 63 64 67 68 71 72 73 74 77 78 80 81 83 84 85 86 89 90 94 95 96 99 100 113 115 156 157"},F:{"53":0.00515,"54":0.00515,"55":0.00515,"56":0.00515,"90":0.00515,"95":0.00515,"101":0.00515,"102":0.00515,"105":0.0103,"106":0.0103,"107":0.0103,"114":0.00515,"116":0.00515,"120":0.00515,"133":0.00515,"134":0.13902,"135":0.7775,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 96 97 98 99 100 103 104 108 109 110 111 112 113 115 117 118 119 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00515,"92":0.01545,"109":0.0103,"119":0.75175,"120":0.78265,"122":0.00515,"123":0.00515,"138":0.00515,"139":0.00515,"140":0.00515,"141":0.00515,"142":0.00515,"143":0.00515,"144":0.00515,"145":0.00515,"146":0.0206,"147":0.01545,"148":0.0206,"149":0.0206,"150":0.14932,"151":0.19051,"152":1.70947,"153":2.28616,"154":0.62303,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 124 125 126 127 128 129 130 131 132 133 134 135 136 137"},E:{"27":0.10813,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.3 16.4 17.0 17.3 17.4 18.0 18.2 18.3 18.5-18.7 27.1 TP","13.1":0.00515,"15.6":0.0103,"16.2":0.00515,"16.5":0.00515,"16.6":0.0103,"17.1":0.0103,"17.2":0.00515,"17.5":0.00515,"17.6":0.05664,"18.1":0.00515,"18.4":0.00515,"26.0":0.00515,"26.1":0.00515,"26.2":0.01545,"26.3":0.03089,"26.4":0.0103,"26.5":0.12358,"26.6":0.4943,"27.2":0.0103},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00104,"5.0-5.1":0.00104,"6.0-6.1":0,"7.0-7.1":0.00208,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01038,"11.0-11.2":0.00104,"11.3-11.4":0.00208,"12.0-12.1":0,"12.2-12.5":0.02698,"13.0-13.1":0,"13.2":0.00519,"13.3":0,"13.4-13.7":0.00104,"14.0-14.4":0.00415,"14.5-14.8":0.00623,"15.0-15.1":0.00623,"15.2-15.3":0.00415,"15.4":0.00519,"15.5":0.00623,"15.6-15.8":0.13489,"16.0":0.01038,"16.1":0.01868,"16.2":0.01038,"16.3":0.02283,"16.4":0.00519,"16.5":0.0083,"16.6-16.7":0.18781,"17.0":0.00726,"17.1":0.01038,"17.2":0.01038,"17.3":0.01556,"17.4":0.02179,"17.5":0.04254,"17.6-17.7":0.10999,"18.0":0.02283,"18.1":0.04566,"18.2":0.06226,"18.3":0.10791,"18.4":0.06745,"18.5-18.7":1.39354,"26.0":0.06745,"26.1":0.06848,"26.2":0.17847,"26.3":0.193,"26.4":0.14112,"26.5":0.94528,"26.6":5.83251,"27.0":0.44722,"27.1":0,"27.2":0.01141},P:{"4":0.01869,"21":0.00934,"22":0.00934,"23":0.00934,"24":0.01869,"25":0.00934,"26":0.03738,"27":0.05607,"28":0.13083,"29":0.16821,"30":1.78485,_:"20 6.2-6.4 10.1 12.0 13.0 14.0 15.0 17.0 18.0 19.0","5.0-5.4":0.01869,"7.2-7.4":0.03738,"8.2":0.02803,"9.2":0.03738,"11.1-11.2":0.01869,"16.0":0.01869},I:{"0":0.02424,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.20859,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":36.80922},R:{_:"0"},M:{"0":0.11157},Q:{_:"Line truncated
@@ -0,0 +1,194 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/utils/accept.ts
const isWhitespace = (char) => char === 32 || char === 9 || char === 10 || char === 13;
const consumeWhitespace = (acceptHeader, startIndex) => {
while (startIndex < acceptHeader.length) {
if (!isWhitespace(acceptHeader.charCodeAt(startIndex))) break;
startIndex++;
}
return startIndex;
};
const ignoreTrailingWhitespace = (acceptHeader, startIndex) => {
while (startIndex > 0) {
if (!isWhitespace(acceptHeader.charCodeAt(startIndex - 1))) break;
startIndex--;
}
return startIndex;
};
const skipInvalidParam = (acceptHeader, startIndex) => {
while (startIndex < acceptHeader.length) {
const char = acceptHeader.charCodeAt(startIndex);
if (char === 59) return [startIndex + 1, true];
if (char === 44) return [startIndex + 1, false];
startIndex++;
}
return [startIndex, false];
};
const skipInvalidAcceptValue = (acceptHeader, startIndex) => {
let i = startIndex;
let inQuotes = false;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (inQuotes && char === 92) i++;
else if (char === 34) inQuotes = !inQuotes;
else if (!inQuotes && char === 44) return i + 1;
i++;
}
return i;
};
const getNextParam = (acceptHeader, startIndex) => {
startIndex = consumeWhitespace(acceptHeader, startIndex);
let i = startIndex;
let key;
let value;
let hasNext = false;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (char === 61) {
key = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i));
i++;
break;
}
if (char === 59) return [
i + 1,
void 0,
void 0,
true
];
if (char === 44) return [
i + 1,
void 0,
void 0,
false
];
i++;
}
if (key === void 0) return [
i,
void 0,
void 0,
false
];
i = consumeWhitespace(acceptHeader, i);
if (acceptHeader.charCodeAt(i) === 61) {
const skipResult = skipInvalidParam(acceptHeader, i + 1);
return [
skipResult[0],
key,
void 0,
skipResult[1]
];
}
let inQuotes = false;
const paramStartIndex = i;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (inQuotes && char === 92) i++;
else if (char === 34) {
if (inQuotes) {
let nextIndex = consumeWhitespace(acceptHeader, i + 1);
const nextChar = acceptHeader.charCodeAt(nextIndex);
if (nextIndex < acceptHeader.length && !(nextChar === 59 || nextChar === 44)) {
const skipResult = skipInvalidParam(acceptHeader, nextIndex);
return [
skipResult[0],
key,
void 0,
skipResult[1]
];
}
value = acceptHeader.slice(paramStartIndex + 1, i);
if (value.includes("\\")) value = value.replace(/\\(.)/g, "$1");
if (nextChar === 44) return [
nextIndex + 1,
key,
value,
false
];
if (nextChar === 59) {
hasNext = true;
nextIndex++;
}
i = nextIndex;
break;
}
inQuotes = true;
} else if (!inQuotes && (char === 59 || char === 44)) {
value = acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i));
if (char === 59) hasNext = true;
i++;
break;
}
i++;
}
return [
i,
key,
value ?? acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i)),
hasNext
];
};
const getNextAcceptValue = (acceptHeader, startIndex) => {
const accept = {
type: "",
params: Object.create(null),
q: 1
};
startIndex = consumeWhitespace(acceptHeader, startIndex);
let i = startIndex;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (char === 59 || char === 44) {
accept.type = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i));
i++;
if (char === 44) return [i, accept.type ? accept : void 0];
if (!accept.type) return [skipInvalidAcceptValue(acceptHeader, i), void 0];
break;
}
i++;
}
if (!accept.type) {
accept.type = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, acceptHeader.length));
return [acceptHeader.length, accept.type ? accept : void 0];
}
let param;
let value;
let hasNext;
while (i < acceptHeader.length) {
[i, param, value, hasNext] = getNextParam(acceptHeader, i);
if (param && value) accept.params[param] = value;
if (!hasNext) break;
}
return [i, accept];
};
const parseAccept = (acceptHeader) => {
if (!acceptHeader) return [];
const values = [];
let i = 0;
let accept;
let requiresSort = false;
let lastAccept;
while (i < acceptHeader.length) {
[i, accept] = getNextAcceptValue(acceptHeader, i);
if (accept) {
accept.q = parseQuality(accept.params.q ?? accept.params.Q);
values.push(accept);
if (lastAccept && lastAccept.q < accept.q) requiresSort = true;
lastAccept = accept;
}
}
if (requiresSort) values.sort((a, b) => b.q - a.q);
return values;
};
const parseQuality = (qVal) => {
if (qVal === void 0) return 1;
if (qVal === "") return 1;
if (qVal === "NaN") return 0;
const num = Number(qVal);
if (Number.isNaN(num)) return 1;
if (num < 0) return 0;
if (num > 1) return 1;
return num;
};
//#endregion
exports.parseAccept = parseAccept;
@@ -0,0 +1,20 @@
# MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"file":"decode-data-html.js","sourceRoot":"","sources":["../../../src/generated/decode-data-html.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAEjC,QAAA,cAAc,GAAgC,IAAI,WAAW;AACtE,kBAAkB;AAClB,eAAe,CAAC,268CAA268C;KACt78C,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC"}
@@ -0,0 +1,180 @@
import { expect, test } from "vitest";
import { z } from "../../../../index.js";
import es from "../../../locales/es.js";
test("Spanish locale - type name translations in too_small errors", () => {
z.config(es());
// Test string type translation
const stringSchema = z.string().min(5);
const stringResult = stringSchema.safeParse("abc");
expect(stringResult.success).toBe(false);
if (!stringResult.success) {
expect(stringResult.error.issues[0].message).toBe(
"Demasiado pequeño: se esperaba que texto tuviera >=5 caracteres"
);
}
// Test number type translation
const numberSchema = z.number().min(10);
const numberResult = numberSchema.safeParse(5);
expect(numberResult.success).toBe(false);
if (!numberResult.success) {
expect(numberResult.error.issues[0].message).toBe("Demasiado pequeño: se esperaba que número fuera >=10");
}
// Test array type translation
const arraySchema = z.array(z.string()).min(3);
const arrayResult = arraySchema.safeParse(["a", "b"]);
expect(arrayResult.success).toBe(false);
if (!arrayResult.success) {
expect(arrayResult.error.issues[0].message).toBe(
"Demasiado pequeño: se esperaba que arreglo tuviera >=3 elementos"
);
}
// Test set type translation
const setSchema = z.set(z.string()).min(2);
const setResult = setSchema.safeParse(new Set(["a"]));
expect(setResult.success).toBe(false);
if (!setResult.success) {
expect(setResult.error.issues[0].message).toBe("Demasiado pequeño: se esperaba que conjunto tuviera >=2 elementos");
}
});
test("Spanish locale - type name translations in too_big errors", () => {
z.config(es());
// Test string type translation
const stringSchema = z.string().max(3);
const stringResult = stringSchema.safeParse("abcde");
expect(stringResult.success).toBe(false);
if (!stringResult.success) {
expect(stringResult.error.issues[0].message).toBe("Demasiado grande: se esperaba que texto tuviera <=3 caracteres");
}
// Test number type translation
const numberSchema = z.number().max(10);
const numberResult = numberSchema.safeParse(15);
expect(numberResult.success).toBe(false);
if (!numberResult.success) {
expect(numberResult.error.issues[0].message).toBe("Demasiado grande: se esperaba que número fuera <=10");
}
// Test array type translation
const arraySchema = z.array(z.string()).max(2);
const arrayResult = arraySchema.safeParse(["a", "b", "c"]);
expect(arrayResult.success).toBe(false);
if (!arrayResult.success) {
expect(arrayResult.error.issues[0].message).toBe("Demasiado grande: se esperaba que arreglo tuviera <=2 elementos");
}
});
test("Spanish locale - type name translations in invalid_type errors", () => {
z.config(es());
// Test string expected, number received
const stringSchema = z.string();
const stringResult = stringSchema.safeParse(123);
expect(stringResult.success).toBe(false);
if (!stringResult.success) {
expect(stringResult.error.issues[0].message).toBe("Entrada inválida: se esperaba texto, recibido número");
}
// Test number expected, string received
const numberSchema = z.number();
const numberResult = numberSchema.safeParse("abc");
expect(numberResult.success).toBe(false);
if (!numberResult.success) {
expect(numberResult.error.issues[0].message).toBe("Entrada inválida: se esperaba número, recibido texto");
}
// Test boolean expected, null received
const booleanSchema = z.boolean();
const booleanResult = booleanSchema.safeParse(null);
expect(booleanResult.success).toBe(false);
if (!booleanResult.success) {
expect(booleanResult.error.issues[0].message).toBe("Entrada inválida: se esperaba booleano, recibido nulo");
}
// Test array expected, object received
const arraySchema = z.array(z.string());
const arrayResult = arraySchema.safeParse({});
expect(arrayResult.success).toBe(false);
if (!arrayResult.success) {
expect(arrayResult.error.issues[0].message).toBe("Entrada inválida: se esperaba arreglo, recibido objeto");
}
});
test("Spanish locale - fallback for unknown type names", () => {
z.config(es());
// Test with a type that's not in the TypeNames dictionary. This will test the fallback behavior
const dateSchema = z.date().min(new Date("2025-01-01"));
const dateResult = dateSchema.safeParse(new Date("2024-01-01"));
expect(dateResult.success).toBe(false);
if (!dateResult.success) {
// Should use "fecha" since we included it in TypeNames
expect(dateResult.error.issues[0].message).toContain("fecha");
}
});
test("Spanish locale - other error cases", () => {
z.config(es());
// Test invalid_element with tuple
const tupleSchema = z.tuple([z.string(), z.number()]);
const tupleResult = tupleSchema.safeParse(["abc", "not a number"]);
expect(tupleResult.success).toBe(false);
if (!tupleResult.success) {
expect(tupleResult.error.issues[0].message).toContain("Entrada inválida");
}
// Test invalid_value with enum
const enumSchema = z.enum(["a", "b"]);
const enumResult = enumSchema.safeParse("c");
expect(enumResult.success).toBe(false);
if (!enumResult.success) {
expect(enumResult.error.issues[0].message).toBe('Opción inválida: se esperaba una de "a"|"b"');
}
// Test not_multiple_of
const multipleSchema = z.number().multipleOf(3);
const multipleResult = multipleSchema.safeParse(10);
expect(multipleResult.success).toBe(false);
if (!multipleResult.success) {
expect(multipleResult.error.issues[0].message).toBe("Número inválido: debe ser múltiplo de 3");
}
// Test unrecognized_keys
const strictSchema = z.object({ a: z.string() }).strict();
const strictResult = strictSchema.safeParse({ a: "test", b: "extra" });
expect(strictResult.success).toBe(false);
if (!strictResult.success) {
expect(strictResult.error.issues[0].message).toBe('Llave desconocida: "b"');
}
// Test invalid_union
const unionSchema = z.union([z.string(), z.number()]);
const unionResult = unionSchema.safeParse(true);
expect(unionResult.success).toBe(false);
if (!unionResult.success) {
expect(unionResult.error.issues[0].message).toBe("Entrada inválida");
}
// Test invalid_format with regex
const regexSchema = z.string().regex(/^[a-z]+$/);
const regexResult = regexSchema.safeParse("ABC123");
expect(regexResult.success).toBe(false);
if (!regexResult.success) {
expect(regexResult.error.issues[0].message).toBe("Cadena inválida: debe coincidir con el patrón /^[a-z]+$/");
}
// Test invalid_format with startsWith
const startsWithSchema = z.string().startsWith("hello");
const startsWithResult = startsWithSchema.safeParse("world");
expect(startsWithResult.success).toBe(false);
if (!startsWithResult.success) {
expect(startsWithResult.error.issues[0].message).toBe('Cadena inválida: debe comenzar con "hello"');
}
});
@@ -0,0 +1,43 @@
'use strict'
const fs = require('graceful-fs').promises
const path = require('path')
const log = require('./log')
const semver = require('semver')
async function remove (gyp, argv) {
const devDir = gyp.devDir
log.verbose('remove', 'using node-gyp dir:', devDir)
// get the user-specified version to remove
let version = argv[0] || gyp.opts.target
log.verbose('remove', 'removing target version:', version)
if (!version) {
throw new Error('You must specify a version number to remove. Ex: "' + process.version + '"')
}
const versionSemver = semver.parse(version)
if (versionSemver) {
// flatten the version Array into a String
version = versionSemver.version
}
const versionPath = path.resolve(gyp.devDir, version)
log.verbose('remove', 'removing development files for version:', version)
// first check if its even installed
try {
await fs.stat(versionPath)
} catch (err) {
if (err.code === 'ENOENT') {
return 'version was already uninstalled: ' + version
}
throw err
}
await fs.rm(versionPath, { recursive: true, force: true, maxRetries: 3 })
}
module.exports = remove
module.exports.usage = 'Removes the node development files for the specified version'
@@ -0,0 +1,85 @@
export declare namespace util {
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
export type isAny<T> = 0 extends 1 & T ? true : false;
export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
export function assertIs<T>(_arg: T): void;
export function assertNever(_x: never): never;
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
export type InexactPartial<T> = {
[k in keyof T]?: T[k] | undefined;
};
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
export const getValidEnumValues: (obj: any) => any[];
export const objectValues: (obj: any) => any[];
export const objectKeys: ObjectConstructor["keys"];
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
export type identity<T> = objectUtil.identity<T>;
export type flatten<T> = objectUtil.flatten<T>;
export type noUndefined<T> = T extends undefined ? never : T;
export const isInteger: NumberConstructor["isInteger"];
export function joinValues<T extends any[]>(array: T, separator?: string): string;
export const jsonStringifyReplacer: (_: string, value: any) => any;
export {};
}
export declare namespace objectUtil {
export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
[k in Exclude<keyof U, keyof V>]: U[k];
} & V;
type optionalKeys<T extends object> = {
[k in keyof T]: undefined extends T[k] ? k : never;
}[keyof T];
type requiredKeys<T extends object> = {
[k in keyof T]: undefined extends T[k] ? never : k;
}[keyof T];
export type addQuestionMarks<T extends object, _O = any> = {
[K in requiredKeys<T>]: T[K];
} & {
[K in optionalKeys<T>]?: T[K];
} & {
[k in keyof T]?: unknown;
};
export type identity<T> = T;
export type flatten<T> = identity<{
[k in keyof T]: T[k];
}>;
export type noNeverKeys<T> = {
[k in keyof T]: [T[k]] extends [never] ? never : k;
}[keyof T];
export type noNever<T> = identity<{
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
}>;
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
[K in keyof A as K extends keyof B ? never : K]: A[K];
} & {
[K in keyof B]: B[K];
};
export {};
}
export declare const ZodParsedType: {
string: "string";
nan: "nan";
number: "number";
integer: "integer";
float: "float";
boolean: "boolean";
date: "date";
bigint: "bigint";
symbol: "symbol";
function: "function";
undefined: "undefined";
null: "null";
array: "array";
object: "object";
unknown: "unknown";
promise: "promise";
void: "void";
never: "never";
map: "map";
set: "set";
};
export type ZodParsedType = keyof typeof ZodParsedType;
export declare const getParsedType: (data: any) => ZodParsedType;
@@ -0,0 +1,8 @@
import { Env, MiddlewareHandler } from "../../types.js";
import { ServeStaticOptions } from "../../middleware/serve-static/index.js";
//#region src/adapter/deno/serve-static.d.ts
/**
* @deprecated `hono/deno` will be removed in v5. Install `@hono/deno` and import from there instead.
*/
export declare const serveStatic: <E extends Env = Env>(options?: ServeStaticOptions<E>) => MiddlewareHandler;
//#endregion
@@ -0,0 +1,78 @@
{
"name": "@radix-ui/react-id",
"version": "1.1.1",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"publishConfig": {
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
},
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"version": "yarn version"
},
"devDependencies": {
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"dependencies": {
"@radix-ui/react-use-layout-effect": "1.1.1"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"types": "./dist/index.d.ts"
}
@@ -0,0 +1 @@
{"version":3,"file":"2019.js","sourceRoot":"","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AC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AA/BD,0BA+BC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"}
@@ -0,0 +1,11 @@
'use strict';
var $TypeError = require('es-errors/type');
/** @type {import('./RequireObjectCoercible')} */
module.exports = function RequireObjectCoercible(value) {
if (value == null) {
throw new $TypeError((arguments.length > 0 && arguments[1]) || ('Cannot call method on ' + value));
}
return value;
};
@@ -0,0 +1 @@
{"version":3,"file":"routerStores.js","names":[],"sources":["../../src/routerStores.ts"],"sourcesContent":["import { batch, createAtom } from '@tanstack/react-store'\nimport {\n createNonReactiveMutableStore,\n createNonReactiveReadonlyStore,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport type { Readable } from '@tanstack/react-store'\nimport type { GetStoreConfig } from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterReadableStore<TValue> extends Readable<TValue> {}\n}\nexport const getStoreFactory: GetStoreConfig = (opts) => {\n if (isServer ?? opts.isServer) {\n return {\n createMutableStore: createNonReactiveMutableStore,\n createReadonlyStore: createNonReactiveReadonlyStore,\n batch: (fn) => fn(),\n }\n }\n return {\n createMutableStore: createAtom,\n createReadonlyStore: createAtom,\n batch: batch,\n }\n}\n"],"mappings":";;;;AAYA,IAAa,mBAAmC,SAAS;AACvD,KAAI,YAAY,KAAK,SACnB,QAAO;EACL,oBAAoB;EACpB,qBAAqB;EACrB,QAAQ,OAAO,IAAI;EACpB;AAEH,QAAO;EACL,oBAAoB;EACpB,qBAAqB;EACd;EACR"}
@@ -0,0 +1 @@
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAyBlD;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IAIzB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;IAE5B;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;IAE9B;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;IAE5B;;;;O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/icons/pencil-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PencilOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTAgMTAtNi4xNTcgNi4xNjJhMiAyIDAgMCAwLS41LjgzM2wtMS4zMjIgNC4zNmEuNS41IDAgMCAwIC42MjIuNjI0bDQuMzU4LTEuMzIzYTIgMiAwIDAgMCAuODMtLjVMMTQgMTMuOTgyIiAvPgogIDxwYXRoIGQ9Im0xMi44MjkgNy4xNzIgNC4zNTktNC4zNDZhMSAxIDAgMSAxIDMuOTg2IDMuOTg2bC00LjM1MyA0LjM1MyIgLz4KICA8cGF0aCBkPSJtMTUgNSA0IDQiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/pencil-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 PencilOff = createLucideIcon('PencilOff', [\n [\n 'path',\n {\n d: 'm10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982',\n key: 'bjo8r8',\n },\n ],\n ['path', { d: 'm12.829 7.172 4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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7F,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,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,7 @@
//#region src/root.ts
/** Stable identifier used for the root route in a route tree. */
const rootRouteId = "__root__";
//#endregion
exports.rootRouteId = rootRouteId;
//# sourceMappingURL=root.cjs.map
@@ -0,0 +1,9 @@
import type {Vocabulary} from "../../types"
import dynamicAnchor from "./dynamicAnchor"
import dynamicRef from "./dynamicRef"
import recursiveAnchor from "./recursiveAnchor"
import recursiveRef from "./recursiveRef"
const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef]
export default dynamic
@@ -0,0 +1 @@
{"version":3,"file":"message-square-plus.js","sources":["../../../src/icons/message-square-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquarePlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTVhMiAyIDAgMCAxLTIgMkg3bC00IDRWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ6IiAvPgogIDxwYXRoIGQ9Ik0xMiA3djYiIC8+CiAgPHBhdGggZD0iTTkgMTBoNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/message-square-plus\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 MessageSquarePlus = createLucideIcon('MessageSquarePlus', [\n ['path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', key: '1lielz' }],\n ['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A,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,29 @@
/**
* @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 MicVocal = createLucideIcon("MicVocal", [
[
"path",
{
d: "m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",
key: "80a601"
}
],
[
"path",
{
d: "M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",
key: "j0ngtp"
}
],
["circle", { cx: "16", cy: "7", r: "5", key: "d08jfb" }]
]);
export { MicVocal as default };
//# sourceMappingURL=mic-vocal.js.map
@@ -0,0 +1,12 @@
'use strict'
const { stringify } = require('jsonfile/utils')
const { outputFileSync } = require('../output-file')
function outputJsonSync (file, data, options) {
const str = stringify(data, options)
outputFileSync(file, str, options)
}
module.exports = outputJsonSync
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SearchCode = createLucideIcon("SearchCode", [
["path", { d: "m13 13.5 2-2.5-2-2.5", key: "1rvxrh" }],
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }],
["path", { d: "M9 8.5 7 11l2 2.5", key: "6ffwbx" }],
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
]);
export { SearchCode as default };
//# sourceMappingURL=search-code.js.map
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-jsx-runtime.react-server.production.js');
} else {
module.exports = require('./cjs/react-jsx-runtime.react-server.development.js');
}
@@ -0,0 +1,258 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.xhtmlEntities = void 0;
exports.xhtmlEntities = {
Aacute: '\u00C1',
aacute: '\u00E1',
Acirc: '\u00C2',
acirc: '\u00E2',
acute: '\u00B4',
AElig: '\u00C6',
aelig: '\u00E6',
Agrave: '\u00C0',
agrave: '\u00E0',
alefsym: '\u2135',
Alpha: '\u0391',
alpha: '\u03B1',
amp: '&',
and: '\u2227',
ang: '\u2220',
apos: '\u0027',
Aring: '\u00C5',
aring: '\u00E5',
asymp: '\u2248',
Atilde: '\u00C3',
atilde: '\u00E3',
Auml: '\u00C4',
auml: '\u00E4',
bdquo: '\u201E',
Beta: '\u0392',
beta: '\u03B2',
brvbar: '\u00A6',
bull: '\u2022',
cap: '\u2229',
Ccedil: '\u00C7',
ccedil: '\u00E7',
cedil: '\u00B8',
cent: '\u00A2',
Chi: '\u03A7',
chi: '\u03C7',
circ: '\u02C6',
clubs: '\u2663',
cong: '\u2245',
copy: '\u00A9',
crarr: '\u21B5',
cup: '\u222A',
curren: '\u00A4',
dagger: '\u2020',
Dagger: '\u2021',
darr: '\u2193',
dArr: '\u21D3',
deg: '\u00B0',
Delta: '\u0394',
delta: '\u03B4',
diams: '\u2666',
divide: '\u00F7',
Eacute: '\u00C9',
eacute: '\u00E9',
Ecirc: '\u00CA',
ecirc: '\u00EA',
Egrave: '\u00C8',
egrave: '\u00E8',
empty: '\u2205',
emsp: '\u2003',
ensp: '\u2002',
Epsilon: '\u0395',
epsilon: '\u03B5',
equiv: '\u2261',
Eta: '\u0397',
eta: '\u03B7',
ETH: '\u00D0',
eth: '\u00F0',
Euml: '\u00CB',
euml: '\u00EB',
euro: '\u20AC',
exist: '\u2203',
fnof: '\u0192',
forall: '\u2200',
frac12: '\u00BD',
frac14: '\u00BC',
frac34: '\u00BE',
frasl: '\u2044',
Gamma: '\u0393',
gamma: '\u03B3',
ge: '\u2265',
gt: '>',
harr: '\u2194',
hArr: '\u21D4',
hearts: '\u2665',
hellip: '\u2026',
Iacute: '\u00CD',
iacute: '\u00ED',
Icirc: '\u00CE',
icirc: '\u00EE',
iexcl: '\u00A1',
Igrave: '\u00CC',
igrave: '\u00EC',
image: '\u2111',
infin: '\u221E',
int: '\u222B',
Iota: '\u0399',
iota: '\u03B9',
iquest: '\u00BF',
isin: '\u2208',
Iuml: '\u00CF',
iuml: '\u00EF',
Kappa: '\u039A',
kappa: '\u03BA',
Lambda: '\u039B',
lambda: '\u03BB',
lang: '\u2329',
laquo: '\u00AB',
larr: '\u2190',
lArr: '\u21D0',
lceil: '\u2308',
ldquo: '\u201C',
le: '\u2264',
lfloor: '\u230A',
lowast: '\u2217',
loz: '\u25CA',
lrm: '\u200E',
lsaquo: '\u2039',
lsquo: '\u2018',
lt: '<',
macr: '\u00AF',
mdash: '\u2014',
micro: '\u00B5',
middot: '\u00B7',
minus: '\u2212',
Mu: '\u039C',
mu: '\u03BC',
nabla: '\u2207',
nbsp: '\u00A0',
ndash: '\u2013',
ne: '\u2260',
ni: '\u220B',
not: '\u00AC',
notin: '\u2209',
nsub: '\u2284',
Ntilde: '\u00D1',
ntilde: '\u00F1',
Nu: '\u039D',
nu: '\u03BD',
Oacute: '\u00D3',
oacute: '\u00F3',
Ocirc: '\u00D4',
ocirc: '\u00F4',
OElig: '\u0152',
oelig: '\u0153',
Ograve: '\u00D2',
ograve: '\u00F2',
oline: '\u203E',
Omega: '\u03A9',
omega: '\u03C9',
Omicron: '\u039F',
omicron: '\u03BF',
oplus: '\u2295',
or: '\u2228',
ordf: '\u00AA',
ordm: '\u00BA',
Oslash: '\u00D8',
oslash: '\u00F8',
Otilde: '\u00D5',
otilde: '\u00F5',
otimes: '\u2297',
Ouml: '\u00D6',
ouml: '\u00F6',
para: '\u00B6',
part: '\u2202',
permil: '\u2030',
perp: '\u22A5',
Phi: '\u03A6',
phi: '\u03C6',
Pi: '\u03A0',
pi: '\u03C0',
piv: '\u03D6',
plusmn: '\u00B1',
pound: '\u00A3',
prime: '\u2032',
Prime: '\u2033',
prod: '\u220F',
prop: '\u221D',
Psi: '\u03A8',
psi: '\u03C8',
quot: '\u0022',
radic: '\u221A',
rang: '\u232A',
raquo: '\u00BB',
rarr: '\u2192',
rArr: '\u21D2',
rceil: '\u2309',
rdquo: '\u201D',
real: '\u211C',
reg: '\u00AE',
rfloor: '\u230B',
Rho: '\u03A1',
rho: '\u03C1',
rlm: '\u200F',
rsaquo: '\u203A',
rsquo: '\u2019',
sbquo: '\u201A',
Scaron: '\u0160',
scaron: '\u0161',
sdot: '\u22C5',
sect: '\u00A7',
shy: '\u00AD',
Sigma: '\u03A3',
sigma: '\u03C3',
sigmaf: '\u03C2',
sim: '\u223C',
spades: '\u2660',
sub: '\u2282',
sube: '\u2286',
sum: '\u2211',
sup: '\u2283',
sup1: '\u00B9',
sup2: '\u00B2',
sup3: '\u00B3',
supe: '\u2287',
szlig: '\u00DF',
Tau: '\u03A4',
tau: '\u03C4',
there4: '\u2234',
Theta: '\u0398',
theta: '\u03B8',
thetasym: '\u03D1',
thinsp: '\u2009',
THORN: '\u00DE',
thorn: '\u00FE',
tilde: '\u02DC',
times: '\u00D7',
trade: '\u2122',
Uacute: '\u00DA',
uacute: '\u00FA',
uarr: '\u2191',
uArr: '\u21D1',
Ucirc: '\u00DB',
ucirc: '\u00FB',
Ugrave: '\u00D9',
ugrave: '\u00F9',
uml: '\u00A8',
upsih: '\u03D2',
Upsilon: '\u03A5',
upsilon: '\u03C5',
Uuml: '\u00DC',
uuml: '\u00FC',
weierp: '\u2118',
Xi: '\u039E',
xi: '\u03BE',
Yacute: '\u00DD',
yacute: '\u00FD',
yen: '\u00A5',
yuml: '\u00FF',
Yuml: '\u0178',
Zeta: '\u0396',
zeta: '\u03B6',
zwj: '\u200D',
zwnj: '\u200C',
};
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './user-round-cog.js';
//# sourceMappingURL=user-cog-2.js.map
@@ -0,0 +1 @@
{"version":3,"file":"use-transform.mjs","sources":["../../../src/value/use-transform.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer<I, O> = (input: I) => O\ntype MultiTransformer<I, O> = (input: I[]) => O\ntype Transformer<I, O> =\n | SingleTransformer<I, O>\n /**\n * Ideally, this would be typed <I, O> in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer<AnyResolvedKeyframe, O>\n\ninterface OutputMap<O> {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * <motion.div style={{ opacity, scale, x }} />\n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform<T extends Record<string, any[]>>(\n inputValue: MotionValue<number>,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions<T[keyof T][number]>\n): { [K in keyof T]: MotionValue<T[K][number]> }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * <motion.div\n * animate={{ x: 200 }}\n * style={{ opacity, x }}\n * />\n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform<I, O>(\n value: MotionValue<number>,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions<O>\n): MotionValue<O>\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return <motion.div style={{ x, y }} />\n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform<I, O>(\n input: MotionValuLine truncated
@@ -0,0 +1,9 @@
/**
* Type-checked examples for {@link PostMessageTransport `PostMessageTransport`}.
*
* These examples are included in the API documentation via `@includeCode` tags.
* Each function's region markers define the code snippet that appears in the docs.
*
* @module
*/
export {};
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classStaticPrivateFieldSpecSet;
var _classApplyDescriptorSet = require("classApplyDescriptorSet");
var _assertClassBrand = require("assertClassBrand");
var _classCheckPrivateStaticFieldDescriptor = require("classCheckPrivateStaticFieldDescriptor");
function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
_assertClassBrand(classConstructor, receiver);
_classCheckPrivateStaticFieldDescriptor(descriptor, "set");
_classApplyDescriptorSet(receiver, descriptor, value);
return value;
}
//# sourceMappingURL=classStaticPrivateFieldSpecSet.js.map
@@ -0,0 +1,456 @@
/**
* OTP secret key.
*/
declare class Secret {
/**
* Converts a Latin-1 string to a Secret object.
* @param {string} str Latin-1 string.
* @returns {Secret} Secret object.
*/
static fromLatin1(str: string): Secret;
/**
* Converts an UTF-8 string to a Secret object.
* @param {string} str UTF-8 string.
* @returns {Secret} Secret object.
*/
static fromUTF8(str: string): Secret;
/**
* Converts a base32 string to a Secret object.
* @param {string} str Base32 string.
* @returns {Secret} Secret object.
*/
static fromBase32(str: string): Secret;
/**
* Converts a hexadecimal string to a Secret object.
* @param {string} str Hexadecimal string.
* @returns {Secret} Secret object.
*/
static fromHex(str: string): Secret;
/**
* Creates a secret key object.
* @param {Object} [config] Configuration options.
* @param {ArrayBufferLike} [config.buffer] Secret key buffer.
* @param {number} [config.size=20] Number of random bytes to generate, ignored if 'buffer' is provided.
*/
constructor({ buffer, size }?: {
buffer?: ArrayBufferLike | undefined;
size?: number | undefined;
});
/**
* Secret key.
* @type {Uint8Array}
* @readonly
*/
readonly bytes: Uint8Array;
/**
* Secret key buffer.
* @deprecated For backward compatibility, the "bytes" property should be used instead.
* @type {ArrayBufferLike}
*/
get buffer(): ArrayBufferLike;
/**
* Latin-1 string representation of secret key.
* @type {string}
*/
get latin1(): string;
/**
* UTF-8 string representation of secret key.
* @type {string}
*/
get utf8(): string;
/**
* Base32 string representation of secret key.
* @type {string}
*/
get base32(): string;
/**
* Hexadecimal string representation of secret key.
* @type {string}
*/
get hex(): string;
}
/**
* HOTP: An HMAC-based One-time Password Algorithm.
* @see [RFC 4226](https://datatracker.ietf.org/doc/html/rfc4226)
*/
declare class HOTP {
/**
* Default configuration.
* @type {{
* issuer: string,
* label: string,
* issuerInLabel: boolean,
* algorithm: string,
* digits: number,
* counter: number
* window: number
* }}
*/
static get defaults(): {
issuer: string;
label: string;
issuerInLabel: boolean;
algorithm: string;
digits: number;
counter: number;
window: number;
};
/**
* Generates an HOTP token.
* @param {Object} config Configuration options.
* @param {Secret} config.secret Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.counter=0] Counter value.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
* @returns {string} Token.
*/
static generate({ secret, algorithm, digits, counter, hmac, }: {
secret: Secret;
algorithm?: string | undefined;
digits?: number | undefined;
counter?: number | undefined;
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
}): string;
/**
* Validates an HOTP token.
* @param {Object} config Configuration options.
* @param {string} config.token Token value.
* @param {Secret} config.secret Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.counter=0] Counter value.
* @param {number} [config.window=1] Window of counter values to test.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
* @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.
*/
static validate({ token, secret, algorithm, digits, counter, window, hmac, }: {
token: string;
secret: Secret;
algorithm?: string | undefined;
digits?: number | undefined;
counter?: number | undefined;
window?: number | undefined;
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
}): number | null;
/**
* Creates an HOTP object.
* @param {Object} [config] Configuration options.
* @param {string} [config.issuer=''] Account provider.
* @param {string} [config.label='OTPAuth'] Account label.
* @param {boolean} [config.issuerInLabel=true] Include issuer prefix in label.
* @param {Secret|string} [config.secret=Secret] Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.counter=0] Initial counter value.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
*/
constructor({ issuer, label, issuerInLabel, secret, algorithm, digits, counter, hmac, }?: {
issuer?: string | undefined;
label?: string | undefined;
issuerInLabel?: boolean | undefined;
secret?: string | Secret | undefined;
algorithm?: string | undefined;
digits?: number | undefined;
counter?: number | undefined;
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
});
/**
* Account provider.
* @type {string}
*/
issuer: string;
/**
* Account label.
* @type {string}
*/
label: string;
/**
* Include issuer prefix in label.
* @type {boolean}
*/
issuerInLabel: boolean;
/**
* Secret key.
* @type {Secret}
*/
secret: Secret;
/**
* HMAC hashing algorithm.
* @type {string}
*/
algorithm: string;
/**
* Token length.
* @type {number}
*/
digits: number;
/**
* Initial counter value.
* @type {number}
*/
counter: number;
/**
* Custom HMAC function.
* @type {((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array)|undefined}
*/
hmac: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
/**
* Generates an HOTP token.
* @param {Object} [config] Configuration options.
* @param {number} [config.counter=this.counter++] Counter value.
* @returns {string} Token.
*/
generate({ counter }?: {
counter?: number | undefined;
}): string;
/**
* Validates an HOTP token.
* @param {Object} config Configuration options.
* @param {string} config.token Token value.
* @param {number} [config.counter=this.counter] Counter value.
* @param {number} [config.window=1] Window of counter values to test.
* @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.
*/
validate({ token, counter, window }: {
token: string;
counter?: number | undefined;
window?: number | undefined;
}): number | null;
/**
* Returns a Google Authenticator key URI.
* @returns {string} URI.
*/
toString(): string;
}
/**
* TOTP: Time-Based One-Time Password Algorithm.
* @see [RFC 6238](https://datatracker.ietf.org/doc/html/rfc6238)
*/
declare class TOTP {
/**
* Default configuration.
* @type {{
* issuer: string,
* label: string,
* issuerInLabel: boolean,
* algorithm: string,
* digits: number,
* period: number
* window: number
* }}
*/
static get defaults(): {
issuer: string;
label: string;
issuerInLabel: boolean;
algorithm: string;
digits: number;
period: number;
window: number;
};
/**
* Calculates the counter. i.e. the number of periods since timestamp 0.
* @param {Object} [config] Configuration options.
* @param {number} [config.period=30] Token time-step duration.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @returns {number} Counter.
*/
static counter({ period, timestamp }?: {
period?: number | undefined;
timestamp?: number | undefined;
}): number;
/**
* Calculates the remaining time in milliseconds until the next token is generated.
* @param {Object} [config] Configuration options.
* @param {number} [config.period=30] Token time-step duration.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @returns {number} counter.
*/
static remaining({ period, timestamp }?: {
period?: number | undefined;
timestamp?: number | undefined;
}): number;
/**
* Generates a TOTP token.
* @param {Object} config Configuration options.
* @param {Secret} config.secret Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.period=30] Token time-step duration.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
* @returns {string} Token.
*/
static generate({ secret, algorithm, digits, period, timestamp, hmac }: {
secret: Secret;
algorithm?: string | undefined;
digits?: number | undefined;
period?: number | undefined;
timestamp?: number | undefined;
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
}): string;
/**
* Validates a TOTP token.
* @param {Object} config Configuration options.
* @param {string} config.token Token value.
* @param {Secret} config.secret Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.period=30] Token time-step duration.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @param {number} [config.window=1] Window of counter values to test.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
* @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.
*/
static validate({ token, secret, algorithm, digits, period, timestamp, window, hmac, }: {
token: string;
secret: Secret;
algorithm?: string | undefined;
digits?: number | undefined;
period?: number | undefined;
timestamp?: number | undefined;
window?: number | undefined;
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
}): number | null;
/**
* Creates a TOTP object.
* @param {Object} [config] Configuration options.
* @param {string} [config.issuer=''] Account provider.
* @param {string} [config.label='OTPAuth'] Account label.
* @param {boolean} [config.issuerInLabel=true] Include issuer prefix in label.
* @param {Secret|string} [config.secret=Secret] Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.period=30] Token time-step duration.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
*/
constructor({ issuer, label, issuerInLabel, secret, algorithm, digits, period, hmac, }?: {
issuer?: string | undefined;
label?: string | undefined;
issuerInLabel?: boolean | undefined;
secret?: string | Secret | undefined;
algorithm?: string | undefined;
digits?: number | undefined;
period?: number | undefined;
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
});
/**
* Account provider.
* @type {string}
*/
issuer: string;
/**
* Account label.
* @type {string}
*/
label: string;
/**
* Include issuer prefix in label.
* @type {boolean}
*/
issuerInLabel: boolean;
/**
* Secret key.
* @type {Secret}
*/
secret: Secret;
/**
* HMAC hashing algorithm.
* @type {string}
*/
algorithm: string;
/**
* Token length.
* @type {number}
*/
digits: number;
/**
* Token time-step duration.
* @type {number}
*/
period: number;
/**
* Custom HMAC function.
* @type {((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array)|undefined}
*/
hmac: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
/**
* Calculates the counter. i.e. the number of periods since timestamp 0.
* @param {Object} [config] Configuration options.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @returns {number} Counter.
*/
counter({ timestamp }?: {
timestamp?: number | undefined;
}): number;
/**
* Calculates the remaining time in milliseconds until the next token is generated.
* @param {Object} [config] Configuration options.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @returns {number} counter.
*/
remaining({ timestamp }?: {
timestamp?: number | undefined;
}): number;
/**
* Generates a TOTP token.
* @param {Object} [config] Configuration options.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @returns {string} Token.
*/
generate({ timestamp }?: {
timestamp?: number | undefined;
}): string;
/**
* Validates a TOTP token.
* @param {Object} config Configuration options.
* @param {string} config.token Token value.
* @param {number} [config.timestamp=Date.now] Timestamp value in milliseconds.
* @param {number} [config.window=1] Window of counter values to test.
* @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.
*/
validate({ token, timestamp, window }: {
token: string;
timestamp?: number | undefined;
window?: number | undefined;
}): number | null;
/**
* Returns a Google Authenticator key URI.
* @returns {string} URI.
*/
toString(): string;
}
/**
* HOTP/TOTP object/string conversion.
* @see [Key URI Format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format)
*/
declare class URI {
/**
* Parses a Google Authenticator key URI and returns an HOTP/TOTP object.
* @param {string} uri Google Authenticator Key URI.
* @param {Object} [config] Configuration options.
* @param {(algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array} [config.hmac] Custom HMAC function.
* @returns {HOTP|TOTP} HOTP/TOTP object.
*/
static parse(uri: string, { hmac }?: {
hmac?: ((algorithm: string, key: Uint8Array, message: Uint8Array) => Uint8Array) | undefined;
}): HOTP | TOTP;
/**
* Converts an HOTP/TOTP object to a Google Authenticator key URI.
* @param {HOTP|TOTP} otp HOTP/TOTP object.
* @returns {string} Google Authenticator Key URI.
*/
static stringify(otp: HOTP | TOTP): string;
}
/**
* Library version.
* @type {string}
*/
declare const version: string;
export { HOTP, Secret, TOTP, URI, version };
@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isObjectNotArray = isObjectNotArray;
exports.deepMerge = deepMerge;
/**
* Check if the variable contains an object strictly rejecting arrays
* @returns `true` if obj is an object
*/
function isObjectNotArray(obj) {
return typeof obj === 'object' && obj != null && !Array.isArray(obj);
}
/**
* Pure function - doesn't mutate either parameter!
* Merges two objects together deeply, overwriting the properties in first with the properties in second
* @param first The first object
* @param second The second object
* @returns a new object
*/
function deepMerge(first = {}, second = {}) {
// get the unique set of keys across both objects
const keys = new Set([...Object.keys(first), ...Object.keys(second)]);
return Object.fromEntries([...keys].map(key => {
const firstHasKey = key in first;
const secondHasKey = key in second;
const firstValue = first[key];
const secondValue = second[key];
let value;
if (firstHasKey && secondHasKey) {
if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) {
// object type
value = deepMerge(firstValue, secondValue);
}
else {
// value type
value = secondValue;
}
}
else if (firstHasKey) {
value = firstValue;
}
else {
value = secondValue;
}
return [key, value];
}));
}
@@ -0,0 +1,36 @@
var versions = require('./versions');
var fullVersions = require('./full-versions');
var chromiumVersions = require('./chromium-versions');
var fullChromiumVersions = require('./full-chromium-versions');
var electronToChromium = function (query) {
var number = getQueryString(query);
return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined;
};
var chromiumToElectron = function (query) {
var number = getQueryString(query);
return number.split('.').length > 2 ? fullChromiumVersions[number] : chromiumVersions[number] || undefined;
};
var electronToBrowserList = function (query) {
var number = getQueryString(query);
return versions[number] ? "Chrome >= " + versions[number] : undefined;
};
var getQueryString = function (query) {
var number = query;
if (query === 1) { number = "1.0" }
if (typeof query === 'number') { number += ''; }
return number;
};
module.exports = {
versions: versions,
fullVersions: fullVersions,
chromiumVersions: chromiumVersions,
fullChromiumVersions: fullChromiumVersions,
electronToChromium: electronToChromium,
electronToBrowserList: electronToBrowserList,
chromiumToElectron: chromiumToElectron
};
@@ -0,0 +1,144 @@
import { expect, expectTypeOf, test } from "vitest";
import { z } from "zod/v4";
test.each([false, true])("undefined prefault preserves object keys (jitless: %s)", async (jitless) => {
const previous = z.config().jitless;
z.config({ jitless });
try {
let calls = 0;
const field = z.union([z.string(), z.undefined()]).prefault(() => {
calls++;
return undefined;
});
const schema = z.object({ a: field });
expectTypeOf<z.output<typeof field>>().toEqualTypeOf<string | undefined>();
expectTypeOf<z.input<typeof schema>>().toEqualTypeOf<{ a?: string | undefined }>();
expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<{ a: string | undefined }>();
expect(schema.parse({})).toStrictEqual({ a: undefined });
expect(calls).toBe(1);
expect(schema.parse({ a: undefined })).toStrictEqual({ a: undefined });
expect(calls).toBe(2);
expect(await schema.parseAsync({})).toStrictEqual({ a: undefined });
expect(calls).toBe(3);
expect(schema.parse({ a: "value" })).toStrictEqual({ a: "value" });
expect(schema.safeParse({ a: 123 }).success).toBe(false);
expect(calls).toBe(3);
const literal = z.prefault(z.string().optional(), undefined);
expect(z.core.compileFn(z.object({ a: literal }))({})).toStrictEqual({ a: undefined });
for (const wrapped of [literal, literal.readonly(), literal.nullable(), z.lazy(() => literal)]) {
expect(z.object({ a: wrapped }).parse({})).toStrictEqual({ a: undefined });
}
expect(z.object({ a: literal.optional() }).parse({})).toStrictEqual({});
expect(z.object({ a: literal.optional() }).parse({ a: undefined })).toStrictEqual({ a: undefined });
expect(z.tuple([literal]).parse([])).toStrictEqual([undefined]);
} finally {
z.config({ jitless: previous });
}
});
test("prefault preserves transformed undefined output", async () => {
const field = z
.string()
.transform(() => undefined)
.prefault("fallback");
expectTypeOf<z.output<typeof field>>().toEqualTypeOf<undefined>();
expect(field.parse(undefined)).toBeUndefined();
const schema = z.object({ a: field, optional: z.string().optional() });
expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<{ a: undefined; optional?: string | undefined }>();
expect(schema.parse({})).toStrictEqual({ a: undefined });
expect(z.core.compileFn(schema)({})).toStrictEqual({ a: undefined });
expect(z.compile(schema).parse({})).toStrictEqual({ a: undefined });
expect(
await z
.object({
a: z
.string()
.transform(async () => undefined)
.prefault("fallback"),
})
.parseAsync({})
).toStrictEqual({ a: undefined });
expect(
z
.object({
a: z
.string()
.prefault("fallback")
.transform(() => undefined),
})
.parse({})
).toStrictEqual({ a: undefined });
});
test("basic prefault", () => {
const a = z.prefault(z.string().trim(), " default ");
expect(a).toBeInstanceOf(z.ZodPrefault);
expect(a.parse(" asdf ")).toEqual("asdf");
expect(a.parse(undefined)).toEqual("default");
type inp = z.input<typeof a>;
expectTypeOf<inp>().toEqualTypeOf<string | undefined>();
type out = z.output<typeof a>;
expectTypeOf<out>().toEqualTypeOf<string>();
});
test("prefault inside object", () => {
// test optinality
const a = z.object({
name: z.string().optional(),
age: z.number().default(1234),
email: z.string().prefault("1234"),
});
type inp = z.input<typeof a>;
expectTypeOf<inp>().toEqualTypeOf<{
name?: string | undefined;
age?: number | undefined;
email?: string | undefined;
}>();
type out = z.output<typeof a>;
expectTypeOf<out>().toEqualTypeOf<{
name?: string | undefined;
age: number;
email: string;
}>();
});
test("object schema with prefault should return shallow clone", () => {
const schema = z
.object({
a: z.string(),
})
.prefault({ a: "x" });
const result1 = schema.parse(undefined);
const result2 = schema.parse(undefined);
expect(result1).not.toBe(result2);
expect(result1).toEqual(result2);
});
test("direction-aware prefault", () => {
const schema = z.string().prefault("hello");
// Forward direction (regular parse): prefault should be applied
expect(schema.parse(undefined)).toBe("hello");
// Reverse direction (encode): prefault should NOT be applied, undefined should fail validation
expect(z.safeEncode(schema, undefined as any)).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received undefined"
}
]],
"success": false,
}
`);
// But valid values should still work in reverse
expect(z.encode(schema, "world")).toBe("world");
});
@@ -0,0 +1,6 @@
module.exports = function import_(filepath) {
return import(filepath);
};
0 && 0;
//# sourceMappingURL=import.cjs.map