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,21 @@
The MIT License (MIT)
Copyright (c) 2012-2018 various contributors (see AUTHORS)
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 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"2":"_S"},D:{"2":"_Q"},E:{"1":"_bE","2":"_KI"},F:{"2":"_c"},G:{"1":"_TD","2":"_rJ"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"ui-serif, ui-sans-serif, ui-monospace and ui-rounded values for font-family",D:true};
@@ -0,0 +1,72 @@
{
"name": "fastest-levenshtein",
"version": "1.0.16",
"description": "Fastest Levenshtein distance implementation in JS.",
"main": "mod.js",
"types": "mod.d.ts",
"module": "./esm/mod.js",
"repository": {
"type": "git",
"url": "git+https://github.com/ka-weihe/fastest-levenshtein.git"
},
"keywords": [
"levenshtein",
"distance",
"fast",
"fastest",
"edit",
"string",
"similarity",
"algorithm",
"match",
"comparison",
"fuzzy",
"search",
"string",
"matching",
"similar",
"node",
"difference"
],
"author": "Kasper U. Weihe",
"license": "MIT",
"bugs": {
"url": "https://github.com/ka-weihe/fastest-levenshtein/issues"
},
"homepage": "https://github.com/ka-weihe/fastest-levenshtein#README",
"scripts": {
"build": "tsc mod.ts --declaration",
"build:esm": "tsc --declaration -p tsconfig.esm.json",
"prepare": "npm run build && npm run build:esm",
"bench": "npm run build && tsc bench.ts && node bench.js",
"test": "npm run build && tsc test.ts && jest test.js",
"test:coverage": "npm run build && jest --coverage",
"test:coveralls": "npm run build && jest --coverage --coverageReporters=text-lcov | coveralls"
},
"devDependencies": {
"@types/benchmark": "^1.0.33",
"@types/jest": "^26.0.15",
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"benchmark": "^2.1.4",
"coveralls": "^3.1.0",
"eslint": "^7.13.0",
"eslint-config-node": "^4.1.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"fast-levenshtein": "^2.0.6",
"jest": "^26.6.3",
"js-levenshtein": "^1.1.6",
"leven": "^3.1.0",
"levenshtein-edit-distance": "^2.0.5",
"natural": "^2.1.5",
"prettier": "^2.1.2",
"talisman": "^1.1.3",
"typescript": "^4.0.5"
},
"engines": {
"node": ">= 4.9.1"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"signal-low.js","sources":["../../../src/icons/signal-low.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SignalLow\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMGguMDEiIC8+CiAgPHBhdGggZD0iTTcgMjB2LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/signal-low\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 SignalLow = createLucideIcon('SignalLow', [\n ['path', { d: 'M2 20h.01', key: '4haj6o' }],\n ['path', { d: 'M7 20v-4', key: 'j294jx' }],\n]);\n\nexport default SignalLow;\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,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,80 @@
{
"name": "enhanced-resolve",
"version": "5.20.1",
"description": "Offers a async require.resolve function. It's highly configurable.",
"homepage": "http://github.com/webpack/enhanced-resolve",
"repository": {
"type": "git",
"url": "git://github.com/webpack/enhanced-resolve.git"
},
"license": "MIT",
"author": "Tobias Koppers @sokra",
"main": "lib/index.js",
"browser": {
"process": "./lib/util/process-browser.js",
"module": "./lib/util/module-browser.js"
},
"types": "types.d.ts",
"files": [
"lib",
"types.d.ts",
"LICENSE"
],
"scripts": {
"prepare": "husky",
"lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run lint:special && npm run fmt:check && npm run lint:spellcheck",
"lint:code": "eslint --cache .",
"lint:special": "node node_modules/tooling/inherit-types && node node_modules/tooling/generate-types",
"lint:types": "tsc",
"lint:types-test": "tsc -p tsconfig.types.test.json",
"lint:spellcheck": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
"fmt": "npm run fmt:base -- --loglevel warn --write",
"fmt:check": "npm run fmt:base -- --check",
"fmt:base": "node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .",
"fix": "npm run fix:code && npm run fix:special",
"fix:code": "npm run lint:code -- --fix",
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/generate-types --write",
"type-report": "rimraf coverage && npm run cover:types && npm run cover:report && open-cli coverage/lcov-report/index.html",
"pretest": "npm run lint",
"test": "npm run test:coverage",
"test:only": "jest",
"test:watch": "npm run test:only -- --watch",
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"lib/**/*.js\" --coverage",
"version": "changeset version",
"release": "changeset publish"
},
"lint-staged": {
"*.{js,cjs,mjs}": [
"eslint --cache --fix"
],
"*": [
"prettier --cache --write --ignore-unknown",
"cspell --cache --no-must-find-files"
]
},
"dependencies": {
"graceful-fs": "^4.2.4",
"tapable": "^2.3.0"
},
"devDependencies": {
"@changesets/cli": "^2.30.0",
"@changesets/get-github-info": "^0.8.0",
"@types/graceful-fs": "^4.1.6",
"@types/jest": "^30.0.0",
"@types/node": "^24.10.4",
"cspell": "^9.4.0",
"eslint": "^9.39.2",
"eslint-config-webpack": "^4.9.0",
"husky": "^9.1.7",
"jest": "^30.3.0",
"lint-staged": "^16.2.7",
"memfs": "^4.56.11",
"prettier": "^3.7.4",
"prettier-2": "npm:prettier@^2",
"tooling": "webpack/tooling#v1.25.0",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=10.13.0"
}
}
@@ -0,0 +1,104 @@
[![Prettier Banner](https://unpkg.com/prettier-logo@1.0.3/images/prettier-banner-light.svg)](https://prettier.io)
<h2 align="center">Opinionated Code Formatter</h2>
<p align="center">
<em>
JavaScript
· TypeScript
· Flow
· JSX
· JSON
</em>
<br />
<em>
CSS
· SCSS
· Less
</em>
<br />
<em>
HTML
· Vue
· Angular
</em>
<br />
<em>
GraphQL
· Markdown
· YAML
</em>
<br />
<em>
<a href="https://prettier.io/docs/plugins">
Your favorite language?
</a>
</em>
</p>
<p align="center">
<a href="https://github.com/prettier/prettier/actions?query=branch%3Amain">
<img alt="CI Status" src="https://img.shields.io/github/check-runs/prettier/prettier/main?style=flat-square&label=CI"></a>
<a href="https://codecov.io/gh/prettier/prettier">
<img alt="Coverage Status" src="https://img.shields.io/codecov/c/github/prettier/prettier.svg?style=flat-square"></a>
<a href="https://x.com/acdlite/status/974390255393505280">
<img alt="Blazing Fast" src="https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg?style=flat-square"></a>
<br/>
<a href="https://www.npmjs.com/package/prettier">
<img alt="npm version" src="https://img.shields.io/npm/v/prettier.svg?style=flat-square"></a>
<a href="https://www.npmjs.com/package/prettier">
<img alt="weekly downloads from npm" src="https://img.shields.io/npm/dw/prettier.svg?style=flat-square"></a>
<a href="https://github.com/prettier/prettier#badge">
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
<a href="https://x.com/intent/follow?screen_name=PrettierCode">
<img alt="Follow Prettier on X" src="https://img.shields.io/badge/%40PrettierCode-9f9f9f?style=flat-square&logo=x&labelColor=555"></a>
</p>
## Intro
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
### Input
<!-- prettier-ignore -->
```js
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
```
### Output
```js
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne(),
);
```
Prettier can be run [in your editor](https://prettier.io/docs/editors) on-save, in a [pre-commit hook](https://prettier.io/docs/precommit), or in [CI environments](https://prettier.io/docs/cli#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
---
**[Documentation](https://prettier.io/docs/)**
[Install](https://prettier.io/docs/install) ·
[Options](https://prettier.io/docs/options) ·
[CLI](https://prettier.io/docs/cli) ·
[API](https://prettier.io/docs/api)
**[Playground](https://prettier.io/playground/)**
---
## Badge
Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
```md
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_wR","2":"_EO","4":"_AC _TJ _WQ"},D:{"1":"_7D","2":"J"},E:{"1":"_nB","2":"_k"},F:{"1":"_a","2":"_T"},G:{"1":"_eB","2":"lC"},H:{"2":"1D"},I:{"1":"_IR","2":"2D"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"sandbox attribute for iframes",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"make-command.js","sourceRoot":"","sources":["../../src/make-command.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,GACb,MAAM,cAAc,CAAA;AA+HrB,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,QAA8D,EAC9D,SAIkB,EAClB,UAAuE,EACvE,WAGe,EACf,QAAwD,EACrB,EAAE;IACrC,OAAO,MAAM,CAAC,MAAM,CAClB,CACE,OAAyC,EAAE,EAC3C,OAAuB,EACvB,EAAO,EACP,EAAE;QACF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,GAAG,IAAI,CAAA;YACd,IAAI,GAAG,EAAE,CAAA;QACX,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAClC,EAAE,GAAG,OAAO,CAAA;YACZ,OAAO,GAAG,SAAS,CAAA;QACrB,CAAC;QAED,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE7C,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;QAEzB,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAExB,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,SAAS,CACjB,+CAA+C,CAChD,CAAA;YACH,CAAC;YACD,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAC/B,CAAC;aAAM,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;YACjC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACxC,CAAC;aAAM,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,SAAS,CACjB,+CAA+C,CAChD,CAAA;YACH,CAAC;YACD,OAAO,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAA;YACjE,CAAC;YACD,OAAO,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;YAChC,qBAAqB;QACvB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QAEvC,oBAAoB;IACtB,CAAC,EACD;QACE,QAAQ;QACR,SAAS;QACT,UAAU;QACV,WAAW;QACX,QAAQ;KACT,CACmC,CAAA;AACxC,CAAC,CAAA","sourcesContent":["import type {\n TarOptions,\n TarOptionsAsyncFile,\n TarOptionsAsyncNoFile,\n TarOptionsSyncFile,\n TarOptionsSyncNoFile,\n TarOptionsWithAliases,\n TarOptionsWithAliasesAsync,\n TarOptionsWithAliasesAsyncFile,\n TarOptionsWithAliasesAsyncNoFile,\n TarOptionsWithAliasesFile,\n TarOptionsWithAliasesNoFile,\n TarOptionsWithAliasesSync,\n TarOptionsWithAliasesSyncFile,\n TarOptionsWithAliasesSyncNoFile,\n} from './options.js'\nimport {\n dealias,\n isAsyncFile,\n isAsyncNoFile,\n isSyncFile,\n isSyncNoFile,\n} from './options.js'\n\nexport type CB = (er?: Error) => unknown\n\nexport type TarCommand<AsyncClass, SyncClass extends { sync: true }> = {\n // async and no file specified\n (): AsyncClass\n (opt: TarOptionsWithAliasesAsyncNoFile): AsyncClass\n (entries: string[]): AsyncClass\n (opt: TarOptionsWithAliasesAsyncNoFile, entries: string[]): AsyncClass\n} & {\n // sync and no file\n (opt: TarOptionsWithAliasesSyncNoFile): SyncClass\n (opt: TarOptionsWithAliasesSyncNoFile, entries: string[]): SyncClass\n} & {\n // async and file\n (opt: TarOptionsWithAliasesAsyncFile): Promise<void>\n (opt: TarOptionsWithAliasesAsyncFile, entries: string[]): Promise<void>\n (opt: TarOptionsWithAliasesAsyncFile, cb: CB): Promise<void>\n (\n opt: TarOptionsWithAliasesAsyncFile,\n entries: string[],\n cb: CB,\n ): Promise<void>\n} & {\n // sync and file\n (opt: TarOptionsWithAliasesSyncFile): void\n (opt: TarOptionsWithAliasesSyncFile, entries: string[]): void\n} & {\n // sync, maybe file\n (opt: TarOptionsWithAliasesSync): typeof opt extends (\n TarOptionsWithAliasesFile\n ) ?\n void\n : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass\n : void | SyncClass\n (\n opt: TarOptionsWithAliasesSync,\n entries: string[],\n ): typeof opt extends TarOptionsWithAliasesFile ? void\n : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass\n : void | SyncClass\n} & {\n // async, maybe file\n (opt: TarOptionsWithAliasesAsync): typeof opt extends (\n TarOptionsWithAliasesFile\n ) ?\n Promise<void>\n : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass\n : Promise<void> | AsyncClass\n (\n opt: TarOptionsWithAliasesAsync,\n entries: string[],\n ): typeof opt extends TarOptionsWithAliasesFile ? Promise<void>\n : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass\n : Promise<void> | AsyncClass\n (opt: TarOptionsWithAliasesAsync, cb: CB): Promise<void>\n (\n opt: TarOptionsWithAliasesAsync,\n entries: string[],\n cb: CB,\n ): typeof opt extends TarOptionsWithAliasesFile ? Promise<void>\n : typeof opt extends TarOptionsWithAliasesNoFile ? never\n : Promise<void>\n} & {\n // maybe sync, file\n (opt: TarOptionsWithAliasesFile): Promise<void> | void\n (\n opt: TarOptionsWithAliasesFile,\n entries: string[],\n ): typeof opt extends TarOptionsWithAliasesSync ? void\n : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void>\n : Promise<void> | void\n (opt: TarOptionsWithAliasesFile, cb: CB): Promise<void>\n (\n opt: TarOptionsWithAliasesFile,\n entries: string[],\n cb: CB,\n ): typeof opt extends TarOptionsWithAliasesSync ? never\n : typeof opt extends TarOLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-az.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,4 @@
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedFunctionType", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1 @@
{"version":3,"file":"between-horizonal-end.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Chrome = createLucideIcon("Chrome", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
["line", { x1: "21.17", x2: "12", y1: "8", y2: "8", key: "a0cw5f" }],
["line", { x1: "3.95", x2: "8.54", y1: "6.06", y2: "14", key: "1kftof" }],
["line", { x1: "10.88", x2: "15.46", y1: "21.94", y2: "14", key: "1ymyh8" }]
]);
export { Chrome as default };
//# sourceMappingURL=chrome.js.map
@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-enum-initializers',
meta: {
type: 'suggestion',
docs: {
description: 'Require each enum member value to be explicitly initialized',
},
hasSuggestions: true,
messages: {
defineInitializer: "The value of the member '{{ name }}' should be explicitly defined.",
defineInitializerSuggestion: 'Can be fixed to {{ name }} = {{ suggested }}',
},
schema: [],
},
defaultOptions: [],
create(context) {
function TSEnumDeclaration(node) {
const { members } = node.body;
members.forEach((member, index) => {
if (member.initializer == null) {
const name = context.sourceCode.getText(member);
context.report({
node: member,
messageId: 'defineInitializer',
data: {
name,
},
suggest: [
{
messageId: 'defineInitializerSuggestion',
data: { name, suggested: index },
fix: (fixer) => {
return fixer.replaceText(member, `${name} = ${index}`);
},
},
{
messageId: 'defineInitializerSuggestion',
data: { name, suggested: index + 1 },
fix: (fixer) => {
return fixer.replaceText(member, `${name} = ${index + 1}`);
},
},
{
messageId: 'defineInitializerSuggestion',
data: { name, suggested: `'${name}'` },
fix: (fixer) => {
return fixer.replaceText(member, `${name} = '${name}'`);
},
},
],
});
}
});
}
return {
TSEnumDeclaration,
};
},
});
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Octagon = createLucideIcon("Octagon", [
[
"path",
{
d: "M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",
key: "2d38gg"
}
]
]);
export { Octagon as default };
//# sourceMappingURL=octagon.js.map
@@ -0,0 +1,106 @@
name: CI
on:
push:
branches:
- main
- next
- 'v*'
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
test-regression-check-node10:
name: Test compatibility with Node.js 10
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: '10'
cache: 'npm'
cache-dependency-path: package.json
check-latest: true
- name: Install
run: |
npm install --ignore-scripts
- name: Copy project as fast-uri to node_node_modules
run: |
rm -rf ./node_modules/fast-uri/lib &&
rm -rf ./node_modules/fast-uri/index.js &&
cp -r ./lib ./node_modules/fast-uri/lib &&
cp ./index.js ./node_modules/fast-uri/index.js
- name: Run tests
run: |
npm run test:unit
env:
NODE_OPTIONS: no-network-family-autoselection
test-browser:
name: Test browser compatibility
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
browser: ['chromium', 'firefox', 'webkit']
exclude:
- os: ubuntu-latest
browser: webkit
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: package.json
check-latest: true
- name: Install dependencies
run: |
npm install --ignore-scripts
- if: ${{ matrix.os == 'windows-latest' }}
run: npx playwright install winldd
- name: Run browser tests
run: |
npm run test:browser:${{ matrix.browser }}
test:
needs:
- test-regression-check-node10
permissions:
contents: write
pull-requests: write
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v6
with:
license-check: true
lint: true
node-versions: '["16", "18", "20", "22", "24"]'
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const WifiLow = createLucideIcon("WifiLow", [
["path", { d: "M12 20h.01", key: "zekei9" }],
["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }]
]);
export { WifiLow as default };
//# sourceMappingURL=wifi-low.js.map
@@ -0,0 +1,11 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"max-statements-per-line": [2, { "max": 2 }],
"no-magic-numbers": 0,
"multiline-comment-style": 0,
}
}
@@ -0,0 +1 @@
{"version":3,"file":"folder-pen.js","sources":["../../../src/icons/folder-pen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderPen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxMS41VjVhMiAyIDAgMCAxIDItMmgzLjljLjcgMCAxLjMuMyAxLjcuOWwuOCAxLjJjLjQuNiAxIC45IDEuNy45SDIwYTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxLTIgMmgtOS41IiAvPgogIDxwYXRoIGQ9Ik0xMS4zNzggMTMuNjI2YTEgMSAwIDEgMC0zLjAwNC0zLjAwNGwtNS4wMSA1LjAxMmEyIDIgMCAwIDAtLjUwNi44NTRsLS44MzcgMi44N2EuNS41IDAgMCAwIC42Mi42MmwyLjg3LS44MzdhMiAyIDAgMCAwIC44NTQtLjUwNnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/folder-pen\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 FolderPen = createLucideIcon('FolderPen', [\n [\n 'path',\n {\n d: 'M2 11.5V5a2 2 0 0 1 2-2h3.9c.7 0 1.3.3 1.7.9l.8 1.2c.4.6 1 .9 1.7.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-9.5',\n key: 'a8xqs0',\n },\n ],\n [\n 'path',\n {\n d: 'M11.378 13.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z',\n key: '1saktj',\n },\n ],\n]);\n\nexport default FolderPen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
'use strict';
/*
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
const LcovOnly = require('../lcovonly');
class TextLcov extends LcovOnly {
constructor(opts) {
super({
...opts,
file: '-'
});
}
}
module.exports = TextLcov;
@@ -0,0 +1 @@
{"version":3,"file":"color.mjs","sources":["../../../../src/utils/mix/color.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n"],"names":[],"mappings":";;;;;;;;AASA;AACA;AACA;AACO,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS,KAAI;AAClE,IAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI;AAC5B,IAAA,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,GAAG,QAAQ;AAChD,IAAA,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACzC;AAEA,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AACpC,MAAM,YAAY,GAAG,CAAC,CAAiB,KACnC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE3C,SAAS,MAAM,CAAC,KAAqB,EAAA;AACjC,IAAA,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC;AAEhC,IAAA,OAAO,CACH,OAAO,CAAC,IAAI,CAAC,EACb,CAAA,CAAA,EAAI,KAAK,CAAA,oEAAA,CAAsE,EAC/E,sBAAsB,CACzB;AAED,IAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,KAAK;IAEhC,IAAI,KAAK,GAAG,IAAK,CAAC,KAAK,CAAC,KAAK,CAAC;AAE9B,IAAA,IAAI,IAAI,KAAK,IAAI,EAAE;;AAEf,QAAA,KAAK,GAAG,UAAU,CAAC,KAAa,CAAC;IACrC;AAEA,IAAA,OAAO,KAAa;AACxB;MAEa,QAAQ,GAAG,CAAC,IAAoB,EAAE,EAAkB,KAAI;AACjE,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC;AAC7B,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAEzB,IAAA,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE;AACtB,QAAA,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;IACjC;AAEA,IAAA,MAAM,OAAO,GAAG,EAAE,GAAG,QAAQ,EAAE;IAE/B,OAAO,CAAC,CAAS,KAAI;AACjB,QAAA,OAAO,CAAC,GAAG,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AACzD,QAAA,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC/D,QAAA,OAAO,CAAC,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5D,QAAA,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC1D,QAAA,OAAO,IAAI,CAAC,SAAU,CAAC,OAAO,CAAC;AACnC,IAAA,CAAC;AACL;;;;"}
@@ -0,0 +1,22 @@
import { ILayout, Level, ConsoleAppender, LogEvent } from 'base-log-factory';
export interface ColorfulAppenderOptions {
layout?: ILayout;
colors?: Record<Level, string>;
}
/**
* Console appender (控制台输出)
*/
export declare class ColorfulAppender extends ConsoleAppender {
name: string;
colors: Record<Level, string>;
/**
* Constructor (构造函数)
*/
constructor(opts?: ColorfulAppenderOptions);
/**
* Write log (写入日志)
* @param event Log event (日志事件)
*/
write(event: LogEvent): void;
protected color(str: string, event: LogEvent): string;
}
@@ -0,0 +1,12 @@
import { PasswordChanges } from '../matching/unmunger/getCleanPasswords';
export interface L33tOptions {
l33t: string;
subs: PasswordChanges[];
token: string;
}
export interface GetCountsOptions {
token: string;
sub: PasswordChanges;
}
declare const _default: ({ l33t, subs, token }: L33tOptions) => number;
export default _default;
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2015_collection: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n /::view-transition-(old|new|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;IAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAC7B,uDAAuD,CAC1D;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;AAC9C;;;;"}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2024_promise: LibDefinition;
@@ -0,0 +1,53 @@
"use client";
import { jsx } from 'react/jsx-runtime';
import { useContext, useMemo } from 'react';
import { resolveTransition } from 'motion-dom';
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
import { loadExternalIsValidProp } from '../../render/dom/utils/filter-props.mjs';
import { useConstant } from '../../utils/use-constant.mjs';
/**
* `MotionConfig` is used to set configuration options for all children `motion` components.
*
* ```jsx
* import { motion, MotionConfig } from "framer-motion"
*
* export function App() {
* return (
* <MotionConfig transition={{ type: "spring" }}>
* <motion.div animate={{ x: 100 }} />
* </MotionConfig>
* )
* }
* ```
*
* @public
*/
function MotionConfig({ children, isValidProp, ...config }) {
isValidProp && loadExternalIsValidProp(isValidProp);
/**
* Inherit props from any parent MotionConfig components
*/
const parentConfig = useContext(MotionConfigContext);
config = { ...parentConfig, ...config };
config.transition = resolveTransition(config.transition, parentConfig.transition);
/**
* Don't allow isStatic to change between renders as it affects how many hooks
* motion components fire.
*/
config.isStatic = useConstant(() => config.isStatic);
/**
* Creating a new config context object will re-render every `motion` component
* every time it renders. So we only want to create a new one sparingly.
*/
const context = useMemo(() => config, [
JSON.stringify(config.transition),
config.transformPagePoint,
config.reducedMotion,
config.skipAnimations,
]);
return (jsx(MotionConfigContext.Provider, { value: context, children: children }));
}
export { MotionConfig };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,94 @@
import { expectTypeOf, test } from "vitest";
import * as z from "../index.js";
test("branded types", () => {
const mySchema = z
.object({
name: z.string(),
})
.brand<"superschema">();
// simple branding
type MySchema = z.infer<typeof mySchema>;
// Using true for type equality assertion
expectTypeOf<MySchema>().toEqualTypeOf<{ name: string } & z.$brand<"superschema">>();
const doStuff = (arg: MySchema) => arg;
doStuff(z.parse(mySchema, { name: "hello there" }));
// inheritance
const extendedSchema = mySchema.brand<"subschema">();
type ExtendedSchema = z.infer<typeof extendedSchema>;
expectTypeOf<ExtendedSchema>().toEqualTypeOf<{ name: string } & z.$brand<"superschema"> & z.$brand<"subschema">>();
doStuff(z.parse(extendedSchema, { name: "hello again" }));
// number branding
const numberSchema = z.number().brand<42>();
type NumberSchema = z.infer<typeof numberSchema>;
expectTypeOf<NumberSchema>().toEqualTypeOf<number & { [z.$brand]: { 42: true } }>();
// symbol branding
const MyBrand: unique symbol = Symbol("hello");
type MyBrand = typeof MyBrand;
const symbolBrand = z.number().brand<"sup">().brand<typeof MyBrand>();
type SymbolBrand = z.infer<typeof symbolBrand>;
// number & { [z.$brand]: { sup: true, [MyBrand]: true } }
expectTypeOf<SymbolBrand>().toEqualTypeOf<number & z.$brand<"sup"> & z.$brand<MyBrand>>();
// keeping brands out of input types
const age = z.number().brand<"age">();
type Age1 = z.infer<typeof age>;
type AgeInput1 = z.input<typeof age>;
// Using not for type inequality assertion
expectTypeOf<AgeInput1>().not.toEqualTypeOf<Age1>();
expectTypeOf<number>().toEqualTypeOf<AgeInput1>();
expectTypeOf<number & z.$brand<"age">>().toEqualTypeOf<Age1>();
// @ts-expect-error
doStuff({ name: "hello there!" });
});
test("brand direction: out (default)", () => {
const schema = z.string().brand<"A">();
type Input = z.input<typeof schema>;
type Output = z.output<typeof schema>;
// output is branded
expectTypeOf<Output>().toEqualTypeOf<string & z.$brand<"A">>();
// input is NOT branded (default behavior)
expectTypeOf<Input>().toEqualTypeOf<string>();
});
test("brand direction: out (explicit)", () => {
const schema = z.string().brand<"A", "out">();
type Input = z.input<typeof schema>;
type Output = z.output<typeof schema>;
// output is branded
expectTypeOf<Output>().toEqualTypeOf<string & z.$brand<"A">>();
// input is NOT branded
expectTypeOf<Input>().toEqualTypeOf<string>();
});
test("brand direction: in", () => {
const schema = z.string().brand<"A", "in">();
type Input = z.input<typeof schema>;
type Output = z.output<typeof schema>;
// input is branded
expectTypeOf<Input>().toEqualTypeOf<string & z.$brand<"A">>();
// output is NOT branded
expectTypeOf<Output>().toEqualTypeOf<string>();
});
test("brand direction: inout", () => {
const schema = z.string().brand<"A", "inout">();
type Input = z.input<typeof schema>;
type Output = z.output<typeof schema>;
// both are branded
expectTypeOf<Input>().toEqualTypeOf<string & z.$brand<"A">>();
expectTypeOf<Output>().toEqualTypeOf<string & z.$brand<"A">>();
});
@@ -0,0 +1,15 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FlagTriangleLeft = createLucideIcon("FlagTriangleLeft", [
["path", { d: "M17 22V2L7 7l10 5", key: "1rmf0r" }]
]);
export { FlagTriangleLeft as default };
//# sourceMappingURL=flag-triangle-left.js.map
@@ -0,0 +1,3 @@
declare function clearRequireCache(files: string[]): void;
export { clearRequireCache };
@@ -0,0 +1,62 @@
export interface Options {
/* a list of files to search */
files?: string[]
/* the directory to search from */
cwd?: string
/* the directory to stop searching */
stopDir?: string
/* the key in package.json to read data at */
packageKey?: string
/* the function used to parse json */
parseJSON?: (str: string) => any
}
export interface LoadResult {
/* file path */
path?: string
/* file data */
data?: any
}
export interface AsyncLoader {
/** Optional loader name */
name?: string
test: RegExp
load(filepath: string): Promise<any>
}
export interface SyncLoader {
/** Optional loader name */
name?: string
test: RegExp
loadSync(filepath: string): any
}
export interface MultiLoader {
/** Optional loader name */
name?: string
test: RegExp
load(filepath: string): Promise<any>
loadSync(filepath: string): any
}
declare class JoyCon {
constructor(options?: Options)
options: Options
resolve(files?: string[] | Options, cwd?: string, stopDir?: string): Promise<string | null>
resolveSync(files?: string[] | Options, cwd?: string, stopDir?: string): string | null
load(files?: string[] | Options, cwd?: string, stopDir?: string): Promise<LoadResult>
loadSync(files?: string[] | Options, cwd?: string, stopDir?: string): LoadResult
addLoader(loader: AsyncLoader | SyncLoader | MultiLoader): this
removeLoader(name: string): this
/** Clear internal cache */
clearCache(): this
}
export default JoyCon
@@ -0,0 +1 @@
{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"}
@@ -0,0 +1,24 @@
import { ConsolaInstance, ConsolaOptions } from './core.cjs';
export { ConfirmPromptOptions, Consola, ConsolaReporter, FormatOptions, InputLogObject, LogLevel, LogLevels, LogObject, LogType, LogTypes, MultiSelectOptions, PromptOptions, SelectPromptOptions, TextPromptOptions } from './core.cjs';
/**
* Factory function to create a new Consola instance tailored for use in different environments.
* It automatically adjusts logging levels based on environment variables and execution context.
*
* @param {Partial<ConsolaOptions & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link ConsolaOptions}.
* @returns {ConsolaInstance} A new Consola instance with configurations based on the given options and the execution environment.
*/
declare function createConsola(options?: Partial<ConsolaOptions & {
fancy: boolean;
}>): ConsolaInstance;
/**
* A default instance of Consola, created and configured for immediate use.
* This instance is configured based on the execution environment and the options provided.
*
* @type {ConsolaInstance} consola - The default Consola instance, ready to use.
*/
declare const consola: ConsolaInstance;
// @ts-ignore
export = consola;
export { ConsolaInstance, ConsolaOptions, consola, createConsola };
@@ -0,0 +1 @@
{"version":3,"file":"spell-check-2.js","sources":["../../../src/icons/spell-check-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SpellCheck2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNiAxNiA2LTEyIDYgMTIiIC8+CiAgPHBhdGggZD0iTTggMTJoOCIgLz4KICA8cGF0aCBkPSJNNCAyMWMxLjEgMCAxLjEtMSAyLjMtMXMxLjEgMSAyLjMgMWMxLjEgMCAxLjEtMSAyLjMtMSAxLjEgMCAxLjEgMSAyLjMgMSAxLjEgMCAxLjEtMSAyLjMtMSAxLjEgMCAxLjEgMSAyLjMgMSAxLjEgMCAxLjEtMSAyLjMtMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/spell-check-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SpellCheck2 = createLucideIcon('SpellCheck2', [\n ['path', { d: 'm6 16 6-12 6 12', key: '1b4byz' }],\n ['path', { d: 'M8 12h8', key: '1wcyev' }],\n [\n 'path',\n {\n d: 'M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1',\n key: '8mdmtu',\n },\n ],\n]);\n\nexport default SpellCheck2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,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,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,72 @@
import { formatWithOptions } from 'node:util';
import { sep } from 'node:path';
function parseStack(stack, message) {
const cwd = process.cwd() + sep;
const lines = stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
return lines;
}
function writeStream(data, stream) {
const write = stream.__write || stream.write;
return write.call(stream, data);
}
const bracket = (x) => x ? `[${x}]` : "";
class BasicReporter {
formatStack(stack, message, opts) {
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
return indent + parseStack(stack, message).join(`
${indent}`);
}
formatError(err, opts) {
const message = err.message ?? formatWithOptions(opts, err);
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
const level = opts?.errorLevel || 0;
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
return causedPrefix + message + "\n" + stack + causedError;
}
formatArgs(args, opts) {
const _args = args.map((arg) => {
if (arg && typeof arg.stack === "string") {
return this.formatError(arg, opts);
}
return arg;
});
return formatWithOptions(opts, ..._args);
}
formatDate(date, opts) {
return opts.date ? date.toLocaleTimeString() : "";
}
filterAndJoin(arr) {
return arr.filter(Boolean).join(" ");
}
formatLogObj(logObj, opts) {
const message = this.formatArgs(logObj.args, opts);
if (logObj.type === "box") {
return "\n" + [
bracket(logObj.tag),
logObj.title && logObj.title,
...message.split("\n")
].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
}
return this.filterAndJoin([
bracket(logObj.type),
bracket(logObj.tag),
message
]);
}
log(logObj, ctx) {
const line = this.formatLogObj(logObj, {
columns: ctx.options.stdout.columns || 0,
...ctx.options.formatOptions
});
return writeStream(
line + "\n",
logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
);
}
}
export { BasicReporter as B, parseStack as p };
@@ -0,0 +1,23 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_adapter_bun_server = require("./server.js");
//#region src/adapter/bun/conninfo.ts
/**
* Get ConnInfo with Bun
* @param c Context
* @returns ConnInfo
* @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead.
*/
const getConnInfo = (c) => {
const server = require_adapter_bun_server.getBunServer(c);
if (!server) throw new TypeError("env has to include the 2nd argument of fetch.");
if (typeof server.requestIP !== "function") throw new TypeError("server.requestIP is not a function.");
const info = server.requestIP(c.req.raw);
if (!info) return { remote: {} };
return { remote: {
address: info.address,
addressType: info.family === "IPv6" || info.family === "IPv4" ? info.family : void 0,
port: info.port
} };
};
//#endregion
exports.getConnInfo = getConnInfo;
@@ -0,0 +1,43 @@
{
"name": "json-schema-traverse",
"version": "0.4.1",
"description": "Traverse JSON Schema passing each schema object to callback",
"main": "index.js",
"scripts": {
"eslint": "eslint index.js spec",
"test-spec": "mocha spec -R spec",
"test": "npm run eslint && nyc npm run test-spec"
},
"repository": {
"type": "git",
"url": "git+https://github.com/epoberezkin/json-schema-traverse.git"
},
"keywords": [
"JSON-Schema",
"traverse",
"iterate"
],
"author": "Evgeny Poberezkin",
"license": "MIT",
"bugs": {
"url": "https://github.com/epoberezkin/json-schema-traverse/issues"
},
"homepage": "https://github.com/epoberezkin/json-schema-traverse#readme",
"devDependencies": {
"coveralls": "^2.13.1",
"eslint": "^3.19.0",
"mocha": "^3.4.2",
"nyc": "^11.0.2",
"pre-commit": "^1.2.2"
},
"nyc": {
"exclude": [
"**/spec/**",
"node_modules"
],
"reporter": [
"lcov",
"text-summary"
]
}
}
@@ -0,0 +1,27 @@
import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';
import { animateTarget } from './visual-element-target.mjs';
import { animateVariant } from './visual-element-variant.mjs';
function animateVisualElement(visualElement, definition, options = {}) {
visualElement.notify("AnimationStart", definition);
let animation;
if (Array.isArray(definition)) {
const animations = definition.map((variant) => animateVariant(visualElement, variant, options));
animation = Promise.all(animations);
}
else if (typeof definition === "string") {
animation = animateVariant(visualElement, definition, options);
}
else {
const resolvedDefinition = typeof definition === "function"
? resolveVariant(visualElement, definition, options.custom)
: definition;
animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
}
return animation.then(() => {
visualElement.notify("AnimationComplete", definition);
});
}
export { animateVisualElement };
//# sourceMappingURL=visual-element.mjs.map
@@ -0,0 +1,114 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "znakov", verb: "imeti" },
file: { unit: "bajtov", verb: "imeti" },
array: { unit: "elementov", verb: "imeti" },
set: { unit: "elementov", verb: "imeti" },
map: { unit: "elementov", verb: "imeti" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "vnos",
email: "e-poštni naslov",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO datum in čas",
date: "ISO datum",
time: "ISO čas",
duration: "ISO trajanje",
ipv4: "IPv4 naslov",
ipv6: "IPv6 naslov",
mac: "MAC naslov",
cidrv4: "obseg IPv4",
cidrv6: "obseg IPv6",
base64: "base64 kodiran niz",
base64url: "base64url kodiran niz",
json_string: "JSON niz",
e164: "E.164 številka",
credit_card: "številka kreditne kartice",
currency_code: "koda valute",
iban: "IBAN",
jwt: "JWT",
template_literal: "vnos",
};
const TypeDictionary = {
nan: "NaN",
number: "število",
array: "tabela",
};
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 `Neveljaven vnos: pričakovano instanceof ${issue.expected}, prejeto ${received}`;
}
return `Neveljaven vnos: pričakovano ${expected}, prejeto ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
if (_issue.format === "regex")
return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
return `Neveljaven ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
case "unrecognized_keys":
return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Neveljaven ključ v ${issue.origin}`;
case "invalid_union":
return "Neveljaven vnos";
case "invalid_element":
return `Neveljavna vrednost v ${issue.origin}`;
default:
return "Neveljaven vnos";
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,18 @@
import { complex } from '../complex/index.mjs';
import { filter } from '../complex/filter.mjs';
import { mask } from '../complex/mask.mjs';
import { getDefaultValueType } from '../maps/defaults.mjs';
const customTypes = /*@__PURE__*/ new Set([filter, mask]);
function getAnimatableNone(key, value) {
let defaultValueType = getDefaultValueType(key);
if (!customTypes.has(defaultValueType))
defaultValueType = complex;
// If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
return defaultValueType.getAnimatableNone
? defaultValueType.getAnimatableNone(value)
: undefined;
}
export { getAnimatableNone };
//# sourceMappingURL=animatable-none.mjs.map
@@ -0,0 +1 @@
module.exports={C:{"4":0.00418,"52":0.00418,"56":0.00418,"58":0.00418,"78":0.00418,"115":0.32596,"120":0.01254,"121":0.02925,"122":0.00418,"123":0.01672,"124":0.00836,"125":0.00836,"128":0.0209,"132":0.00418,"133":0.00418,"134":0.03343,"135":0.03343,"136":0.05433,"139":0.00418,"140":0.26746,"142":0.00418,"144":0.00418,"145":0.00418,"146":0.00836,"147":0.09194,"148":0.01672,"149":0.00418,"150":0.0209,"151":0.01254,"152":0.02925,"153":0.04179,"154":0.42208,"155":1.21191,"156":1.13251,"157":0.05433,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 57 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 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 126 127 129 130 131 137 138 141 143 158 159 160 3.5 3.6"},D:{"70":0.07104,"79":0.00418,"80":0.00418,"81":0.00418,"87":0.00836,"91":0.00418,"92":0.00418,"101":0.00418,"102":0.00418,"103":0.06269,"104":0.05851,"105":0.06269,"106":0.07522,"107":0.06269,"108":0.06269,"109":0.90684,"110":0.06269,"111":0.06269,"112":0.14627,"114":0.01254,"116":0.14209,"117":0.06269,"118":0.08358,"119":0.05015,"120":0.14209,"121":0.06686,"122":0.24238,"123":0.0209,"124":0.06686,"125":0.00418,"126":0.01672,"127":0.00836,"128":0.0209,"129":0.01254,"130":0.22567,"131":0.12537,"132":0.03761,"133":0.18806,"134":0.14209,"135":0.07522,"136":0.09194,"137":0.08776,"138":0.36775,"139":0.08776,"140":0.09194,"141":0.15462,"142":0.27999,"143":0.02925,"144":0.10865,"145":0.08776,"146":0.04597,"147":0.21313,"148":0.26328,"149":0.27999,"150":0.44297,"151":1.81787,"152":8.59202,"153":7.02072,"154":1.71757,"155":0.0209,_:"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 71 72 73 74 75 76 77 78 83 84 85 86 88 89 90 93 94 95 96 97 98 99 100 113 115 156 157"},F:{"79":0.00418,"83":0.00418,"86":0.00836,"90":0.00418,"95":0.13791,"99":0.00418,"100":0.00836,"101":0.03343,"102":0.01254,"105":0.00836,"106":0.00836,"107":0.00418,"114":0.0209,"119":0.00418,"120":0.00418,"122":0.00418,"125":0.00418,"126":0.01672,"127":0.00418,"131":0.00418,"133":0.02507,"134":0.2382,"135":1.48772,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 84 85 87 88 89 91 92 93 94 96 97 98 103 104 108 109 110 111 112 113 115 116 117 118 121 123 124 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00836,"109":0.04597,"119":0.0209,"120":0.01254,"122":0.01672,"123":0.00418,"124":0.00418,"128":0.00418,"132":0.00418,"133":0.00836,"135":0.00418,"138":0.00418,"139":0.00418,"140":0.00418,"141":0.02925,"142":0.01254,"143":0.01672,"144":0.01672,"145":0.01254,"146":0.01254,"147":0.01672,"148":0.01254,"149":0.08776,"150":0.05433,"151":0.11283,"152":1.40832,"153":1.61727,"154":0.43462,_:"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 129 130 131 134 136 137"},E:{"10":0.00836,"11":0.00836,"14":0.00418,"15":0.00418,"27":0.07104,_:"4 5 6 7 8 9 12 13 3.1 3.2 5.1 6.1 7.1 9.1 11.1 12.1 13.1 15.1 15.2-15.3 15.5 16.0 16.1 16.2 18.2 27.1 27.2 TP","10.1":0.01254,"14.1":0.00418,"15.4":0.00418,"15.6":0.02507,"16.3":0.00418,"16.4":0.00418,"16.5":0.00418,"16.6":0.04179,"17.0":0.00418,"17.1":0.01254,"17.2":0.00418,"17.3":0.00836,"17.4":0.00418,"17.5":0.00418,"17.6":0.03761,"18.0":0.00418,"18.1":0.02925,"18.3":0.01254,"18.4":0.00418,"18.5-18.7":0.01254,"26.0":0.02925,"26.1":0.00418,"26.2":0.02507,"26.3":0.02507,"26.4":0.0209,"26.5":0.11701,"26.6":0.46805},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00064,"5.0-5.1":0.00064,"6.0-6.1":0,"7.0-7.1":0.00128,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00639,"11.0-11.2":0.00064,"11.3-11.4":0.00128,"12.0-12.1":0,"12.2-12.5":0.01662,"13.0-13.1":0,"13.2":0.0032,"13.3":0,"13.4-13.7":0.00064,"14.0-14.4":0.00256,"14.5-14.8":0.00384,"15.0-15.1":0.00384,"15.2-15.3":0.00256,"15.4":0.0032,"15.5":0.00384,"15.6-15.8":0.0831,"16.0":0.00639,"16.1":0.01151,"16.2":0.00639,"16.3":0.01406,"16.4":0.0032,"16.5":0.00511,"16.6-16.7":0.11571,"17.0":0.00447,"17.1":0.00639,"17.2":0.00639,"17.3":0.00959,"17.4":0.01342,"17.5":0.02621,"17.6-17.7":0.06776,"18.0":0.01406,"18.1":0.02813,"18.2":0.03836,"18.3":0.06648,"18.4":0.04155,"18.5-18.7":0.85852,"26.0":0.04155,"26.1":0.04219,"26.2":0.10995,"26.3":0.1189,"26.4":0.08694,"26.5":0.58236,"26.6":3.59326,"27.0":0.27552,"27.1":0,"27.2":0.00703},P:{"20":0.00913,"21":0.01826,"22":0.02738,"23":0.03651,"24":0.04564,"25":0.03651,"26":0.09128,"27":0.07303,"28":0.13692,"29":0.18257,"30":2.18167,_:"4 5.0-5.4 6.2-6.4 9.2 10.1 12.0 15.0 16.0","7.2-7.4":0.04564,"8.2":0.00913,"11.1-11.2":0.00913,"13Line truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_Z","292":"_A"},B:{"1":"_K","2":"_I"},C:{"1":"_pF","2":"_f","164":"_IC"},D:{"1":"_mO","2":"_7N"},E:{"1":"_PB","2":"_UB"},F:{"1":"_bO","2":"_HP"},G:{"1":"_s","2":"_3"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","164":"LE"}},B:5,C:":placeholder-shown CSS pseudo-class",D:true};
@@ -0,0 +1,6 @@
"use strict";
const addMonths = require("./addMonths.js");
function subMonths(date, months) {
return addMonths(date, -months);
}
module.exports = subMonths;
@@ -0,0 +1,79 @@
import { describe, it, expect } from "vitest";
import {
parseDocument,
parseDOM,
createDocumentStream,
createDomStream,
DomHandler,
DefaultHandler,
type Parser,
} from "./index.js";
import { Element } from "domhandler";
// Add an `attributes` prop to the Element for now, to make it possible for Jest to render DOM nodes.
Object.defineProperty(Element.prototype, "attributes", {
get() {
return Object.keys(this.attribs).map((name) => ({
name,
value: this.attribs[name],
}));
},
configurable: true,
enumerable: false,
});
describe("Index", () => {
it("parseDocument", () => {
const dom = parseDocument("<a foo><b><c><?foo>Yay!");
expect(dom).toMatchSnapshot();
});
it("parseDOM", () => {
const dom = parseDOM("<a foo><b><c><?foo>Yay!");
expect(dom).toMatchSnapshot();
});
it("createDocumentStream", () => {
let documentStream!: Parser;
const documentPromise = new Promise(
(resolve, reject) =>
(documentStream = createDocumentStream((error, dom) =>
error ? reject(error) : resolve(dom),
)),
);
for (const c of "&amp;This is text<!-- and comments --><tags>") {
documentStream.write(c);
}
documentStream.end();
return expect(documentPromise).resolves.toMatchSnapshot();
});
it("createDomStream", () => {
let domStream!: Parser;
const domPromise = new Promise(
(resolve, reject) =>
(domStream = createDomStream((error, dom) =>
error ? reject(error) : resolve(dom),
)),
);
for (const c of "&amp;This is text<!-- and comments --><tags>") {
domStream.write(c);
}
domStream.end();
return expect(domPromise).resolves.toMatchSnapshot();
});
describe("API", () => {
it("should export the appropriate APIs", () => {
expect(DomHandler).toEqual(DefaultHandler);
});
});
});
@@ -0,0 +1 @@
{"version":3,"file":"resolve-subjects.mjs","sources":["../../../../src/animation/animate/resolve-subjects.ts"],"sourcesContent":["import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects<O extends {}>(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf<Element>\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget<O>,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n"],"names":[],"mappings":";;;AASM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE;IACb;IAEA,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAO,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC;IACzD;AAAO,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC3C;SAAO;QACH,OAAO,CAAC,OAAO,CAAC;IACpB;AACJ;;;;"}
@@ -0,0 +1,46 @@
{
"name": "raw-body",
"description": "Get and validate the raw body of a readable stream.",
"version": "3.0.2",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Raynos <raynos2@gmail.com>"
],
"license": "MIT",
"repository": "stream-utils/raw-body",
"dependencies": {
"bytes": "~3.1.2",
"http-errors": "~2.0.1",
"iconv-lite": "~0.7.0",
"unpipe": "~1.0.0"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^5.1.0",
"@stylistic/eslint-plugin-js": "^4.1.0",
"bluebird": "3.7.2",
"eslint": "^9.0.0",
"mocha": "10.7.0",
"neostandard": "^0.12.0",
"nyc": "17.0.0",
"readable-stream": "2.3.7",
"safe-buffer": "5.2.1"
},
"engines": {
"node": ">= 0.10"
},
"files": [
"LICENSE",
"README.md",
"index.d.ts",
"index.js"
],
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "mocha --trace-deprecation --reporter spec --check-leaks test/",
"test:ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test:cov": "nyc --reporter=html --reporter=text npm test",
"version": "node scripts/version-history.js && git add HISTORY.md"
}
}
@@ -0,0 +1 @@
{"version":3,"names":["_cloneNode","require","cloneDeepWithoutLoc","node","cloneNode"],"sources":["../../src/clone/cloneDeepWithoutLoc.ts"],"sourcesContent":["import cloneNode from \"./cloneNode.ts\";\nimport type * as t from \"../index.ts\";\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * excluding `_private` and location properties.\n */\nexport default function cloneDeepWithoutLoc<T extends t.Node>(node: T): T {\n return cloneNode(node, /* deep */ true, /* withoutLoc */ true);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOe,SAASC,mBAAmBA,CAAmBC,IAAO,EAAK;EACxE,OAAO,IAAAC,kBAAS,EAACD,IAAI,EAAa,IAAI,EAAmB,IAAI,CAAC;AAChE","ignoreList":[]}
@@ -0,0 +1,18 @@
function renderHTML(element, { style, vars }, styleProp, projection) {
const elementStyle = element.style;
let key;
for (key in style) {
// CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.
elementStyle[key] = style[key];
}
// Write projection styles directly to element style
projection?.applyProjectionStyles(elementStyle, styleProp);
for (key in vars) {
// Loop over any CSS variables and assign those.
// They can only be assigned using `setProperty`.
elementStyle.setProperty(key, vars[key]);
}
}
export { renderHTML };
//# sourceMappingURL=render.mjs.map
@@ -0,0 +1,39 @@
{
"name": "@babel/types",
"version": "7.29.7",
"description": "Babel Types is a Lodash-esque utility library for AST nodes",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-types",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-types"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/helper-string-parser": "^7.29.7",
"@babel/helper-validator-identifier": "^7.29.7"
},
"devDependencies": {
"@babel/generator": "^7.29.7",
"@babel/helper-fixtures": "^7.29.7",
"@babel/parser": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs",
"types": "./lib/index-legacy.d.ts",
"typesVersions": {
">=4.1": {
"lib/index-legacy.d.ts": [
"lib/index.d.ts"
]
}
}
}
@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportVisitor = void 0;
const definition_1 = require("../definition");
const Visitor_1 = require("./Visitor");
class ImportVisitor extends Visitor_1.Visitor {
#declaration;
#referencer;
constructor(declaration, referencer) {
super(referencer);
this.#declaration = declaration;
this.#referencer = referencer;
}
static visit(referencer, declaration) {
const importReferencer = new ImportVisitor(declaration, referencer);
importReferencer.visit(declaration);
}
ImportDefaultSpecifier(node) {
const local = node.local;
this.visitImport(local, node);
}
ImportNamespaceSpecifier(node) {
const local = node.local;
this.visitImport(local, node);
}
ImportSpecifier(node) {
const local = node.local;
this.visitImport(local, node);
}
visitImport(id, specifier) {
this.#referencer
.currentScope()
.defineIdentifier(id, new definition_1.ImportBindingDefinition(id, specifier, this.#declaration));
}
}
exports.ImportVisitor = ImportVisitor;
@@ -0,0 +1,981 @@
import { t as declaredDialect } from "./dialects-BOhdv1Fc.mjs";
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
function deepCompareStrict(a, b) {
const typeofa = typeof a;
if (typeofa !== typeof b) return false;
if (Array.isArray(a)) {
if (!Array.isArray(b)) return false;
const length = a.length;
if (length !== b.length) return false;
for (let i = 0; i < length; i++) if (!deepCompareStrict(a[i], b[i])) return false;
return true;
}
if (typeofa === "object") {
if (!a || !b) return a === b;
const aKeys = Object.keys(a);
const bKeys = Object.keys(b);
if (aKeys.length !== bKeys.length) return false;
for (const k of aKeys) if (!deepCompareStrict(a[k], b[k])) return false;
return true;
}
return a === b;
}
//#endregion
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/pointer.js
function encodePointer(p) {
return encodeURI(escapePointer(p));
}
function escapePointer(p) {
return p.replace(/~/g, "~0").replace(/\//g, "~1");
}
//#endregion
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/dereference.js
const schemaArrayKeyword = {
prefixItems: true,
items: true,
allOf: true,
anyOf: true,
oneOf: true
};
const schemaMapKeyword = {
$defs: true,
definitions: true,
properties: true,
patternProperties: true,
dependentSchemas: true
};
const ignoredKeyword = {
id: true,
$id: true,
$ref: true,
$schema: true,
$anchor: true,
$vocabulary: true,
$comment: true,
default: true,
enum: true,
const: true,
required: true,
type: true,
maximum: true,
minimum: true,
exclusiveMaximum: true,
exclusiveMinimum: true,
multipleOf: true,
maxLength: true,
minLength: true,
pattern: true,
format: true,
maxItems: true,
minItems: true,
uniqueItems: true,
maxProperties: true,
minProperties: true
};
let initialBaseURI = typeof self !== "undefined" && self.location && self.location.origin !== "null" ? new URL(self.location.origin + self.location.pathname + location.search) : new URL("https://github.com/cfworker");
function dereference(schema, lookup = Object.create(null), baseURI = initialBaseURI, basePointer = "") {
if (schema && typeof schema === "object" && !Array.isArray(schema)) {
const id = schema.$id || schema.id;
if (id) {
const url = new URL(id, baseURI.href);
if (url.hash.length > 1) lookup[url.href] = schema;
else {
url.hash = "";
if (basePointer === "") baseURI = url;
else dereference(schema, lookup, baseURI);
}
}
} else if (schema !== true && schema !== false) return lookup;
const schemaURI = baseURI.href + (basePointer ? "#" + basePointer : "");
if (lookup[schemaURI] !== void 0) throw new Error(`Duplicate schema URI "${schemaURI}".`);
lookup[schemaURI] = schema;
if (schema === true || schema === false) return lookup;
if (schema.__absolute_uri__ === void 0) Object.defineProperty(schema, "__absolute_uri__", {
enumerable: false,
value: schemaURI
});
if (schema.$ref && schema.__absolute_ref__ === void 0) {
const url = new URL(schema.$ref, baseURI.href);
url.hash = url.hash;
Object.defineProperty(schema, "__absolute_ref__", {
enumerable: false,
value: url.href
});
}
if (schema.$recursiveRef && schema.__absolute_recursive_ref__ === void 0) {
const url = new URL(schema.$recursiveRef, baseURI.href);
url.hash = url.hash;
Object.defineProperty(schema, "__absolute_recursive_ref__", {
enumerable: false,
value: url.href
});
}
if (schema.$anchor) {
const url = new URL("#" + schema.$anchor, baseURI.href);
lookup[url.href] = schema;
}
for (let key in schema) {
if (ignoredKeyword[key]) continue;
const keyBase = `${basePointer}/${encodePointer(key)}`;
const subSchema = schema[key];
if (Array.isArray(subSchema)) {
if (schemaArrayKeyword[key]) {
const length = subSchema.length;
for (let i = 0; i < length; i++) dereference(subSchema[i], lookup, baseURI, `${keyBase}/${i}`);
}
} else if (schemaMapKeyword[key]) for (let subKey in subSchema) dereference(subSchema[subKey], lookup, baseURI, `${keyBase}/${encodePointer(subKey)}`);
else dereference(subSchema, lookup, baseURI, keyBase);
}
return lookup;
}
//#endregion
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/format.js
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
const DAYS = [
0,
31,
28,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
];
const TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
const HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
const URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
const URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
const URL_ = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
const UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
const JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
const JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
const RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
const EMAIL = (input) => {
if (input[0] === "\"") return false;
const [name, host, ...rest] = input.split("@");
if (!name || !host || rest.length !== 0 || name.length > 64 || host.length > 253) return false;
if (name[0] === "." || name.endsWith(".") || name.includes("..")) return false;
if (!/^[a-z0-9.-]+$/i.test(host) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(name)) return false;
return host.split(".").every((part) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(part));
};
const IPV4 = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;
const IPV6 = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;
const DURATION = (input) => input.length > 1 && input.length < 80 && (/^P\d+([.,]\d+)?W$/.test(input) || /^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(input) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(input));
function bind(r) {
return r.test.bind(r);
}
const format = {
date,
time: time.bind(void 0, false),
"date-time": date_time,
duration: DURATION,
uri,
"uri-reference": bind(URIREF),
"uri-template": bind(URITEMPLATE),
url: bind(URL_),
email: EMAIL,
hostname: bind(HOSTNAME),
ipv4: bind(IPV4),
ipv6: bind(IPV6),
regex,
uuid: bind(UUID),
"json-pointer": bind(JSON_POINTER),
"json-pointer-uri-fragment": bind(JSON_POINTER_URI_FRAGMENT),
"relative-json-pointer": bind(RELATIVE_JSON_POINTER)
};
function isLeapYear(year) {
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}
function date(str) {
const matches = str.match(DATE);
if (!matches) return false;
const year = +matches[1];
const month = +matches[2];
const day = +matches[3];
return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
}
function time(full, str) {
const matches = str.match(TIME);
if (!matches) return false;
const hour = +matches[1];
const minute = +matches[2];
const second = +matches[3];
const timeZone = !!matches[5];
return (hour <= 23 && minute <= 59 && second <= 59 || hour == 23 && minute == 59 && second == 60) && (!full || timeZone);
}
const DATE_TIME_SEPARATOR = /t|\s/i;
function date_time(str) {
const dateTime = str.split(DATE_TIME_SEPARATOR);
return dateTime.length == 2 && date(dateTime[0]) && time(true, dateTime[1]);
}
const NOT_URI_FRAGMENT = /\/|:/;
const URI_PATTERN = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
function uri(str) {
return NOT_URI_FRAGMENT.test(str) && URI_PATTERN.test(str);
}
const Z_ANCHOR = /[^\\]\\Z/;
function regex(str) {
if (Z_ANCHOR.test(str)) return false;
try {
new RegExp(str, "u");
return true;
} catch (e) {
return false;
}
}
//#endregion
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/ucs2-length.js
function ucs2length(s) {
let result = 0;
let length = s.length;
let index = 0;
let charCode;
while (index < length) {
result++;
charCode = s.charCodeAt(index++);
if (charCode >= 55296 && charCode <= 56319 && index < length) {
charCode = s.charCodeAt(index);
if ((charCode & 64512) == 56320) index++;
}
}
return result;
}
//#endregion
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/validate.js
function validate(instance, schema, draft = "2019-09", lookup = dereference(schema), shortCircuit = true, recursiveAnchor = null, instanceLocation = "#", schemaLocation = "#", evaluated = Object.create(null)) {
if (schema === true) return {
valid: true,
errors: []
};
if (schema === false) return {
valid: false,
errors: [{
instanceLocation,
keyword: "false",
keywordLocation: instanceLocation,
error: "False boolean schema."
}]
};
const rawInstanceType = typeof instance;
let instanceType;
switch (rawInstanceType) {
case "boolean":
case "number":
case "string":
instanceType = rawInstanceType;
break;
case "object":
if (instance === null) instanceType = "null";
else if (Array.isArray(instance)) instanceType = "array";
else instanceType = "object";
break;
default: throw new Error(`Instances of "${rawInstanceType}" type are not supported.`);
}
const { $ref, $recursiveRef, $recursiveAnchor, type: $type, const: $const, enum: $enum, required: $required, not: $not, anyOf: $anyOf, allOf: $allOf, oneOf: $oneOf, if: $if, then: $then, else: $else, format: $format, properties: $properties, patternProperties: $patternProperties, additionalProperties: $additionalProperties, unevaluatedProperties: $unevaluatedProperties, minProperties: $minProperties, maxProperties: $maxProperties, propertyNames: $propertyNames, dependentRequired: $dependentRequired, dependentSchemas: $dependentSchemas, dependencies: $dependencies, prefixItems: $prefixItems, items: $items, additionalItems: $additionalItems, unevaluatedItems: $unevaluatedItems, contains: $contains, minContains: $minContains, maxContains: $maxContains, minItems: $minItems, maxItems: $maxItems, uniqueItems: $uniqueItems, minimum: $minimum, maximum: $maximum, exclusiveMinimum: $exclusiveMinimum, exclusiveMaximum: $exclusiveMaximum, multipleOf: $multipleOf, minLength: $minLength, maxLength: $maxLength, pattern: $pattern, __absolute_ref__, __absolute_recursive_ref__ } = schema;
const errors = [];
if ($recursiveAnchor === true && recursiveAnchor === null) recursiveAnchor = schema;
if ($recursiveRef === "#") {
const refSchema = recursiveAnchor === null ? lookup[__absolute_recursive_ref__] : recursiveAnchor;
const keywordLocation = `${schemaLocation}/$recursiveRef`;
const result = validate(instance, recursiveAnchor === null ? schema : recursiveAnchor, draft, lookup, shortCircuit, refSchema, instanceLocation, keywordLocation, evaluated);
if (!result.valid) errors.push({
instanceLocation,
keyword: "$recursiveRef",
keywordLocation,
error: "A subschema had errors."
}, ...result.errors);
}
if ($ref !== void 0) {
const refSchema = lookup[__absolute_ref__ || $ref];
if (refSchema === void 0) {
let message = `Unresolved $ref "${$ref}".`;
if (__absolute_ref__ && __absolute_ref__ !== $ref) message += ` Absolute URI "${__absolute_ref__}".`;
message += `\nKnown schemas:\n- ${Object.keys(lookup).join("\n- ")}`;
throw new Error(message);
}
const keywordLocation = `${schemaLocation}/$ref`;
const result = validate(instance, refSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated);
if (!result.valid) errors.push({
instanceLocation,
keyword: "$ref",
keywordLocation,
error: "A subschema had errors."
}, ...result.errors);
if (draft === "4" || draft === "7") return {
valid: errors.length === 0,
errors
};
}
if (Array.isArray($type)) {
let length = $type.length;
let valid = false;
for (let i = 0; i < length; i++) if (instanceType === $type[i] || $type[i] === "integer" && instanceType === "number" && instance % 1 === 0 && instance === instance) {
valid = true;
break;
}
if (!valid) errors.push({
instanceLocation,
keyword: "type",
keywordLocation: `${schemaLocation}/type`,
error: `Instance type "${instanceType}" is invalid. Expected "${$type.join("\", \"")}".`
});
} else if ($type === "integer") {
if (instanceType !== "number" || instance % 1 || instance !== instance) errors.push({
instanceLocation,
keyword: "type",
keywordLocation: `${schemaLocation}/type`,
error: `Instance type "${instanceType}" is invalid. Expected "${$type}".`
});
} else if ($type !== void 0 && instanceType !== $type) errors.push({
instanceLocation,
keyword: "type",
keywordLocation: `${schemaLocation}/type`,
error: `Instance type "${instanceType}" is invalid. Expected "${$type}".`
});
if ($const !== void 0) {
if (instanceType === "object" || instanceType === "array") {
if (!deepCompareStrict(instance, $const)) errors.push({
instanceLocation,
keyword: "const",
keywordLocation: `${schemaLocation}/const`,
error: `Instance does not match ${JSON.stringify($const)}.`
});
} else if (instance !== $const) errors.push({
instanceLocation,
keyword: "const",
keywordLocation: `${schemaLocation}/const`,
error: `Instance does not match ${JSON.stringify($const)}.`
});
}
if ($enum !== void 0) {
if (instanceType === "object" || instanceType === "array") {
if (!$enum.some((value) => deepCompareStrict(instance, value))) errors.push({
instanceLocation,
keyword: "enum",
keywordLocation: `${schemaLocation}/enum`,
error: `Instance does not match any of ${JSON.stringify($enum)}.`
});
} else if (!$enum.some((value) => instance === value)) errors.push({
instanceLocation,
keyword: "enum",
keywordLocation: `${schemaLocation}/enum`,
error: `Instance does not match any of ${JSON.stringify($enum)}.`
});
}
if ($not !== void 0) {
const keywordLocation = `${schemaLocation}/not`;
if (validate(instance, $not, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation).valid) errors.push({
instanceLocation,
keyword: "not",
keywordLocation,
error: "Instance matched \"not\" schema."
});
}
let subEvaluateds = [];
if ($anyOf !== void 0) {
const keywordLocation = `${schemaLocation}/anyOf`;
const errorsLength = errors.length;
let anyValid = false;
for (let i = 0; i < $anyOf.length; i++) {
const subSchema = $anyOf[i];
const subEvaluated = Object.create(evaluated);
const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
errors.push(...result.errors);
anyValid = anyValid || result.valid;
if (result.valid) subEvaluateds.push(subEvaluated);
}
if (anyValid) errors.length = errorsLength;
else errors.splice(errorsLength, 0, {
instanceLocation,
keyword: "anyOf",
keywordLocation,
error: "Instance does not match any subschemas."
});
}
if ($allOf !== void 0) {
const keywordLocation = `${schemaLocation}/allOf`;
const errorsLength = errors.length;
let allValid = true;
for (let i = 0; i < $allOf.length; i++) {
const subSchema = $allOf[i];
const subEvaluated = Object.create(evaluated);
const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
errors.push(...result.errors);
allValid = allValid && result.valid;
if (result.valid) subEvaluateds.push(subEvaluated);
}
if (allValid) errors.length = errorsLength;
else errors.splice(errorsLength, 0, {
instanceLocation,
keyword: "allOf",
keywordLocation,
error: `Instance does not match every subschema.`
});
}
if ($oneOf !== void 0) {
const keywordLocation = `${schemaLocation}/oneOf`;
const errorsLength = errors.length;
const matches = $oneOf.filter((subSchema, i) => {
const subEvaluated = Object.create(evaluated);
const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
errors.push(...result.errors);
if (result.valid) subEvaluateds.push(subEvaluated);
return result.valid;
}).length;
if (matches === 1) errors.length = errorsLength;
else errors.splice(errorsLength, 0, {
instanceLocation,
keyword: "oneOf",
keywordLocation,
error: `Instance does not match exactly one subschema (${matches} matches).`
});
}
if (instanceType === "object" || instanceType === "array") Object.assign(evaluated, ...subEvaluateds);
if ($if !== void 0) {
const keywordLocation = `${schemaLocation}/if`;
if (validate(instance, $if, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated).valid) {
if ($then !== void 0) {
const thenResult = validate(instance, $then, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/then`, evaluated);
if (!thenResult.valid) errors.push({
instanceLocation,
keyword: "if",
keywordLocation,
error: `Instance does not match "then" schema.`
}, ...thenResult.errors);
}
} else if ($else !== void 0) {
const elseResult = validate(instance, $else, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/else`, evaluated);
if (!elseResult.valid) errors.push({
instanceLocation,
keyword: "if",
keywordLocation,
error: `Instance does not match "else" schema.`
}, ...elseResult.errors);
}
}
if (instanceType === "object") {
if ($required !== void 0) {
for (const key of $required) if (!(key in instance)) errors.push({
instanceLocation,
keyword: "required",
keywordLocation: `${schemaLocation}/required`,
error: `Instance does not have required property "${key}".`
});
}
const keys = Object.keys(instance);
if ($minProperties !== void 0 && keys.length < $minProperties) errors.push({
instanceLocation,
keyword: "minProperties",
keywordLocation: `${schemaLocation}/minProperties`,
error: `Instance does not have at least ${$minProperties} properties.`
});
if ($maxProperties !== void 0 && keys.length > $maxProperties) errors.push({
instanceLocation,
keyword: "maxProperties",
keywordLocation: `${schemaLocation}/maxProperties`,
error: `Instance does not have at least ${$maxProperties} properties.`
});
if ($propertyNames !== void 0) {
const keywordLocation = `${schemaLocation}/propertyNames`;
for (const key in instance) {
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
const result = validate(key, $propertyNames, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
if (!result.valid) errors.push({
instanceLocation,
keyword: "propertyNames",
keywordLocation,
error: `Property name "${key}" does not match schema.`
}, ...result.errors);
}
}
if ($dependentRequired !== void 0) {
const keywordLocation = `${schemaLocation}/dependantRequired`;
for (const key in $dependentRequired) if (key in instance) {
const required = $dependentRequired[key];
for (const dependantKey of required) if (!(dependantKey in instance)) errors.push({
instanceLocation,
keyword: "dependentRequired",
keywordLocation,
error: `Instance has "${key}" but does not have "${dependantKey}".`
});
}
}
if ($dependentSchemas !== void 0) for (const key in $dependentSchemas) {
const keywordLocation = `${schemaLocation}/dependentSchemas`;
if (key in instance) {
const result = validate(instance, $dependentSchemas[key], draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`, evaluated);
if (!result.valid) errors.push({
instanceLocation,
keyword: "dependentSchemas",
keywordLocation,
error: `Instance has "${key}" but does not match dependant schema.`
}, ...result.errors);
}
}
if ($dependencies !== void 0) {
const keywordLocation = `${schemaLocation}/dependencies`;
for (const key in $dependencies) if (key in instance) {
const propsOrSchema = $dependencies[key];
if (Array.isArray(propsOrSchema)) {
for (const dependantKey of propsOrSchema) if (!(dependantKey in instance)) errors.push({
instanceLocation,
keyword: "dependencies",
keywordLocation,
error: `Instance has "${key}" but does not have "${dependantKey}".`
});
} else {
const result = validate(instance, propsOrSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`);
if (!result.valid) errors.push({
instanceLocation,
keyword: "dependencies",
keywordLocation,
error: `Instance has "${key}" but does not match dependant schema.`
}, ...result.errors);
}
}
}
const thisEvaluated = Object.create(null);
let stop = false;
if ($properties !== void 0) {
const keywordLocation = `${schemaLocation}/properties`;
for (const key in $properties) {
if (!(key in instance)) continue;
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
const result = validate(instance[key], $properties[key], draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(key)}`);
if (result.valid) evaluated[key] = thisEvaluated[key] = true;
else {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "properties",
keywordLocation,
error: `Property "${key}" does not match schema.`
}, ...result.errors);
if (stop) break;
}
}
}
if (!stop && $patternProperties !== void 0) {
const keywordLocation = `${schemaLocation}/patternProperties`;
for (const pattern in $patternProperties) {
const regex$1 = new RegExp(pattern, "u");
const subSchema = $patternProperties[pattern];
for (const key in instance) {
if (!regex$1.test(key)) continue;
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
const result = validate(instance[key], subSchema, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(pattern)}`);
if (result.valid) evaluated[key] = thisEvaluated[key] = true;
else {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "patternProperties",
keywordLocation,
error: `Property "${key}" matches pattern "${pattern}" but does not match associated schema.`
}, ...result.errors);
}
}
}
}
if (!stop && $additionalProperties !== void 0) {
const keywordLocation = `${schemaLocation}/additionalProperties`;
for (const key in instance) {
if (thisEvaluated[key]) continue;
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
const result = validate(instance[key], $additionalProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
if (result.valid) evaluated[key] = true;
else {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "additionalProperties",
keywordLocation,
error: `Property "${key}" does not match additional properties schema.`
}, ...result.errors);
}
}
} else if (!stop && $unevaluatedProperties !== void 0) {
const keywordLocation = `${schemaLocation}/unevaluatedProperties`;
for (const key in instance) if (!evaluated[key]) {
const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
const result = validate(instance[key], $unevaluatedProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
if (result.valid) evaluated[key] = true;
else errors.push({
instanceLocation,
keyword: "unevaluatedProperties",
keywordLocation,
error: `Property "${key}" does not match unevaluated properties schema.`
}, ...result.errors);
}
}
} else if (instanceType === "array") {
if ($maxItems !== void 0 && instance.length > $maxItems) errors.push({
instanceLocation,
keyword: "maxItems",
keywordLocation: `${schemaLocation}/maxItems`,
error: `Array has too many items (${instance.length} > ${$maxItems}).`
});
if ($minItems !== void 0 && instance.length < $minItems) errors.push({
instanceLocation,
keyword: "minItems",
keywordLocation: `${schemaLocation}/minItems`,
error: `Array has too few items (${instance.length} < ${$minItems}).`
});
const length = instance.length;
let i = 0;
let stop = false;
if ($prefixItems !== void 0) {
const keywordLocation = `${schemaLocation}/prefixItems`;
const length2 = Math.min($prefixItems.length, length);
for (; i < length2; i++) {
const result = validate(instance[i], $prefixItems[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);
evaluated[i] = true;
if (!result.valid) {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "prefixItems",
keywordLocation,
error: `Items did not match schema.`
}, ...result.errors);
if (stop) break;
}
}
}
if ($items !== void 0) {
const keywordLocation = `${schemaLocation}/items`;
if (Array.isArray($items)) {
const length2 = Math.min($items.length, length);
for (; i < length2; i++) {
const result = validate(instance[i], $items[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);
evaluated[i] = true;
if (!result.valid) {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "items",
keywordLocation,
error: `Items did not match schema.`
}, ...result.errors);
if (stop) break;
}
}
} else for (; i < length; i++) {
const result = validate(instance[i], $items, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
evaluated[i] = true;
if (!result.valid) {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "items",
keywordLocation,
error: `Items did not match schema.`
}, ...result.errors);
if (stop) break;
}
}
if (!stop && $additionalItems !== void 0) {
const keywordLocation$1 = `${schemaLocation}/additionalItems`;
for (; i < length; i++) {
const result = validate(instance[i], $additionalItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation$1);
evaluated[i] = true;
if (!result.valid) {
stop = shortCircuit;
errors.push({
instanceLocation,
keyword: "additionalItems",
keywordLocation: keywordLocation$1,
error: `Items did not match additional items schema.`
}, ...result.errors);
}
}
}
}
if ($contains !== void 0) if (length === 0 && $minContains === void 0) errors.push({
instanceLocation,
keyword: "contains",
keywordLocation: `${schemaLocation}/contains`,
error: `Array is empty. It must contain at least one item matching the schema.`
});
else if ($minContains !== void 0 && length < $minContains) errors.push({
instanceLocation,
keyword: "minContains",
keywordLocation: `${schemaLocation}/minContains`,
error: `Array has less items (${length}) than minContains (${$minContains}).`
});
else {
const keywordLocation = `${schemaLocation}/contains`;
const errorsLength = errors.length;
let contained = 0;
for (let j = 0; j < length; j++) {
const result = validate(instance[j], $contains, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${j}`, keywordLocation);
if (result.valid) {
evaluated[j] = true;
contained++;
} else errors.push(...result.errors);
}
if (contained >= ($minContains || 0)) errors.length = errorsLength;
if ($minContains === void 0 && $maxContains === void 0 && contained === 0) errors.splice(errorsLength, 0, {
instanceLocation,
keyword: "contains",
keywordLocation,
error: `Array does not contain item matching schema.`
});
else if ($minContains !== void 0 && contained < $minContains) errors.push({
instanceLocation,
keyword: "minContains",
keywordLocation: `${schemaLocation}/minContains`,
error: `Array must contain at least ${$minContains} items matching schema. Only ${contained} items were found.`
});
else if ($maxContains !== void 0 && contained > $maxContains) errors.push({
instanceLocation,
keyword: "maxContains",
keywordLocation: `${schemaLocation}/maxContains`,
error: `Array may contain at most ${$maxContains} items matching schema. ${contained} items were found.`
});
}
if (!stop && $unevaluatedItems !== void 0) {
const keywordLocation = `${schemaLocation}/unevaluatedItems`;
for (; i < length; i++) {
if (evaluated[i]) continue;
const result = validate(instance[i], $unevaluatedItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
evaluated[i] = true;
if (!result.valid) errors.push({
instanceLocation,
keyword: "unevaluatedItems",
keywordLocation,
error: `Items did not match unevaluated items schema.`
}, ...result.errors);
}
}
if ($uniqueItems) for (let j = 0; j < length; j++) {
const a = instance[j];
const ao = typeof a === "object" && a !== null;
for (let k = 0; k < length; k++) {
if (j === k) continue;
const b = instance[k];
if (a === b || ao && typeof b === "object" && b !== null && deepCompareStrict(a, b)) {
errors.push({
instanceLocation,
keyword: "uniqueItems",
keywordLocation: `${schemaLocation}/uniqueItems`,
error: `Duplicate items at indexes ${j} and ${k}.`
});
j = Number.MAX_SAFE_INTEGER;
k = Number.MAX_SAFE_INTEGER;
}
}
}
} else if (instanceType === "number") {
if (draft === "4") {
if ($minimum !== void 0 && ($exclusiveMinimum === true && instance <= $minimum || instance < $minimum)) errors.push({
instanceLocation,
keyword: "minimum",
keywordLocation: `${schemaLocation}/minimum`,
error: `${instance} is less than ${$exclusiveMinimum ? "or equal to " : ""} ${$minimum}.`
});
if ($maximum !== void 0 && ($exclusiveMaximum === true && instance >= $maximum || instance > $maximum)) errors.push({
instanceLocation,
keyword: "maximum",
keywordLocation: `${schemaLocation}/maximum`,
error: `${instance} is greater than ${$exclusiveMaximum ? "or equal to " : ""} ${$maximum}.`
});
} else {
if ($minimum !== void 0 && instance < $minimum) errors.push({
instanceLocation,
keyword: "minimum",
keywordLocation: `${schemaLocation}/minimum`,
error: `${instance} is less than ${$minimum}.`
});
if ($maximum !== void 0 && instance > $maximum) errors.push({
instanceLocation,
keyword: "maximum",
keywordLocation: `${schemaLocation}/maximum`,
error: `${instance} is greater than ${$maximum}.`
});
if ($exclusiveMinimum !== void 0 && instance <= $exclusiveMinimum) errors.push({
instanceLocation,
keyword: "exclusiveMinimum",
keywordLocation: `${schemaLocation}/exclusiveMinimum`,
error: `${instance} is less than ${$exclusiveMinimum}.`
});
if ($exclusiveMaximum !== void 0 && instance >= $exclusiveMaximum) errors.push({
instanceLocation,
keyword: "exclusiveMaximum",
keywordLocation: `${schemaLocation}/exclusiveMaximum`,
error: `${instance} is greater than or equal to ${$exclusiveMaximum}.`
});
}
if ($multipleOf !== void 0) {
const remainder = instance % $multipleOf;
if (Math.abs(0 - remainder) >= 1.1920929e-7 && Math.abs($multipleOf - remainder) >= 1.1920929e-7) errors.push({
instanceLocation,
keyword: "multipleOf",
keywordLocation: `${schemaLocation}/multipleOf`,
error: `${instance} is not a multiple of ${$multipleOf}.`
});
}
} else if (instanceType === "string") {
const length = $minLength === void 0 && $maxLength === void 0 ? 0 : ucs2length(instance);
if ($minLength !== void 0 && length < $minLength) errors.push({
instanceLocation,
keyword: "minLength",
keywordLocation: `${schemaLocation}/minLength`,
error: `String is too short (${length} < ${$minLength}).`
});
if ($maxLength !== void 0 && length > $maxLength) errors.push({
instanceLocation,
keyword: "maxLength",
keywordLocation: `${schemaLocation}/maxLength`,
error: `String is too long (${length} > ${$maxLength}).`
});
if ($pattern !== void 0 && !new RegExp($pattern, "u").test(instance)) errors.push({
instanceLocation,
keyword: "pattern",
keywordLocation: `${schemaLocation}/pattern`,
error: `String does not match pattern.`
});
if ($format !== void 0 && format[$format] && !format[$format](instance)) errors.push({
instanceLocation,
keyword: "format",
keywordLocation: `${schemaLocation}/format`,
error: `String does not match format "${$format}".`
});
}
return {
valid: errors.length === 0,
errors
};
}
//#endregion
//#region ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/validator.js
var Validator = class {
schema;
draft;
shortCircuit;
lookup;
constructor(schema, draft = "2019-09", shortCircuit = true) {
this.schema = schema;
this.draft = draft;
this.shortCircuit = shortCircuit;
this.lookup = dereference(schema);
}
validate(instance) {
return validate(instance, this.schema, this.draft, this.lookup, this.shortCircuit);
}
addSchema(schema, id) {
if (id) schema = {
...schema,
$id: id
};
dereference(schema, this.lookup);
}
};
//#endregion
//#region ../core-internal/src/validators/cfWorkerProvider.ts
/**
* Cloudflare Worker-compatible JSON Schema validator provider
*
* This provider uses @cfworker/json-schema for validation without code generation,
* making it compatible with edge runtimes like Cloudflare Workers that restrict
* eval and new Function.
*
* @see {@linkcode AjvJsonSchemaValidator} for the Node.js alternative
*/
/**
* `@cfworker/json-schema`-backed JSON Schema validator. See
* `@modelcontextprotocol/{client,server}/validators/cf-worker` for the customisation entry point.
*
* Default dispatches on the schema's declared dialect: no `$schema` or 2020-12 → `'2020-12'`
* (SEP-1613); 2019-09 → `'2019-09'`; draft-07 or draft-06 → `'7'`. Schemas declaring any other `$schema` are rejected
* with a plain `Error`. Passing an explicit `draft` to the constructor
* overrides this — that draft is used for every schema regardless of `$schema`.
*
* Known draft-07 engine gap: `@cfworker/json-schema` does not treat draft-07 `dependencies` as
* a name→subschema map during `$ref` collection, so a dependency entry whose KEY collides with
* a JSON Schema keyword (`type`, `default`, `format`, `required`, `pattern`, …) and whose
* subschema contains a `$ref` throws `Unresolved $ref` at validation time when the dependency
* triggers — data-dependently, not at compile. The Node (classic Ajv) engine handles the same
* schema correctly. Callers that hit this receive the SDK's typed validation error (the throw
* is captured by the validation paths), and the deviation is pinned by a recorded-contract test.
*
* @example Use with default configuration (2020-12, shortcircuit on)
* ```ts source="./cfWorkerProvider.examples.ts#CfWorkerJsonSchemaValidator_default"
* const validator = new CfWorkerJsonSchemaValidator();
* ```
*
* @example Use with custom configuration
* ```ts source="./cfWorkerProvider.examples.ts#CfWorkerJsonSchemaValidator_customConfig"
* const validator = new CfWorkerJsonSchemaValidator({
* draft: '2020-12',
* shortcircuit: false // Report all errors
* });
* ```
*/
var CfWorkerJsonSchemaValidator = class {
shortcircuit;
/** Caller-supplied draft; when set, the `$schema` check is skipped (caller owns dialect). */
draft;
/**
* Create a validator
*
* @param options - Configuration options
* @param options.shortcircuit - If `true`, stop validation after first error (default: `true`)
* @param options.draft - JSON Schema draft version to force for every schema. When set, the
* `$schema` dispatch is skipped. When omitted, the provider dispatches on each schema's
* declared `$schema` (2020-12, 2019-09, draft-07, draft-06; absent means 2020-12) and rejects others.
*/
constructor(options) {
this.shortcircuit = options?.shortcircuit ?? true;
this.draft = options?.draft;
}
/**
* Pick the engine draft for a schema's declared dialect (a caller-forced `{draft}` bypasses
* this — do not second-guess by `$schema`). No `$schema` or 2020-12 → `'2020-12'`; 2019-09 →
* `'2019-09'`; draft-07 or draft-06 → `'7'`; anything else → `Error`.
*/
_draftFor(schema) {
const dialect = declaredDialect(schema, "pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.");
return dialect === "draft-7" ? "7" : dialect;
}
/**
* Create a validator for the given JSON Schema
*
* Unlike AJV, this validator is not cached internally
*
* @param schema - Standard JSON Schema object
* @returns A validator function that validates input data
*/
getValidator(schema) {
const validator = new Validator(schema, this.draft ?? this._draftFor(schema), this.shortcircuit);
return (input) => {
const result = validator.validate(input);
return result.valid ? {
valid: true,
data: input,
errorMessage: void 0
} : {
valid: false,
data: void 0,
errorMessage: result.errors.map((err) => `${err.instanceLocation}: ${err.error}`).join("; ")
};
};
}
};
//#endregion
export { CfWorkerJsonSchemaValidator as t };
//# sourceMappingURL=cfWorkerProvider-BylNJ1R5.mjs.map
@@ -0,0 +1,2 @@
export declare const umask: () => number;
//# sourceMappingURL=process-umask.d.ts.map
@@ -0,0 +1,381 @@
/**
* Utilities for MCP servers to register tools and resources that display interactive UIs.
*
* Use these helpers instead of the base SDK's `registerTool` and `registerResource` when
* your tool should render an {@link app!App `App`} in the client. They handle UI metadata normalization
* and provide sensible defaults for the MCP Apps MIME type ({@link RESOURCE_MIME_TYPE `RESOURCE_MIME_TYPE`}).
*
* @module server-helpers
*
* @example
* ```ts source="./index.examples.ts#index_overview"
* // Register a tool that displays a view
* registerAppTool(
* server,
* "weather",
* {
* description: "Get weather forecast",
* _meta: { ui: { resourceUri: "ui://weather/view.html" } },
* },
* toolCallback,
* );
*
* // Register the HTML resource the tool references
* registerAppResource(
* server,
* "Weather View",
* "ui://weather/view.html",
* {},
* readCallback,
* );
* ```
*/
import { McpUiResourceMeta, McpUiToolMeta, McpUiClientCapabilities } from "../spec.types.js";
import { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE } from "../constants.js";
import type { CallToolResult, ClientCapabilities, InputRequiredResult, McpServer, ReadResourceResult, RegisteredTool, ResourceMetadata, ServerContext, StandardSchemaWithJSON, ToolAnnotations, ToolCallback, ReadResourceCallback as _ReadResourceCallback, RegisteredResource } from "@modelcontextprotocol/server";
import type { z } from "zod/v4";
export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE };
export type { ResourceMetadata, ToolCallback };
/**
* A plain `{ field: z.string() }` record accepted by the deprecated raw-shape
* form of {@link registerAppTool `registerAppTool`}; the SDK auto-wraps it with `z.object()`.
*
* @deprecated Wrap with `z.object({...})` instead.
*/
export type ZodRawShape = Record<string, z.ZodType>;
/**
* {@link ToolCallback `ToolCallback`} variant used when `inputSchema` is a {@link ZodRawShape `ZodRawShape`}.
* Mirrors the callback type of the SDK's deprecated `registerTool` overload.
*
* @deprecated Wrap with `z.object({...})` instead and use {@link ToolCallback `ToolCallback`}.
*/
export type LegacyToolCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: z.infer<z.ZodObject<Args>>, ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult> : (ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult>;
/**
* Base tool configuration matching the standard MCP server tool options.
* Extended by {@link McpUiAppToolConfig `McpUiAppToolConfig`} to add UI metadata requirements.
*
* `inputSchema`/`outputSchema` accept any Standard JSON Schema (zod v4, ArkType,
* Valibot, ...). A raw zod shape (`{ field: z.string() }`) is still accepted for
* backward compatibility but deprecated.
*/
export interface ToolConfig {
title?: string;
description?: string;
inputSchema?: ZodRawShape | StandardSchemaWithJSON;
outputSchema?: ZodRawShape | StandardSchemaWithJSON;
annotations?: ToolAnnotations;
_meta?: Record<string, unknown>;
}
/**
* Configuration for tools that render an interactive UI.
*
* Extends {@link ToolConfig `ToolConfig`} with a required `_meta` field that specifies UI metadata.
* The UI resource can be specified in two ways:
* - `_meta.ui.resourceUri` (preferred)
* - `_meta["ui/resourceUri"]` (deprecated, for backward compatibility)
*
* @see {@link registerAppTool `registerAppTool`} for the recommended way to register app tools
*/
export interface McpUiAppToolConfig extends ToolConfig {
_meta: {
[key: string]: unknown;
} & ({
ui: McpUiToolMeta;
} | {
/**
* URI of the UI resource to display for this tool.
* This is converted to `_meta["ui/resourceUri"]`.
*
* @example "ui://weather/view.html"
*
* @deprecated Use `_meta.ui.resourceUri` instead.
*/
[RESOURCE_URI_META_KEY]?: string;
});
}
/**
* MCP App Resource configuration for {@link registerAppResource `registerAppResource`}.
*
* Extends the base MCP SDK `ResourceMetadata` with optional UI metadata
* for configuring security policies and rendering preferences.
*
* The `_meta.ui` field here is included in the `resources/list` response and serves as
* a static default for hosts to review at connection time. When the `resources/read`
* content item also includes `_meta.ui`, the content-item value takes precedence.
*
* @see {@link registerAppResource `registerAppResource`} for usage
*/
export interface McpUiAppResourceConfig extends ResourceMetadata {
/**
* Optional UI metadata for the resource.
*
* This appears on the resource entry in `resources/list` and acts as a listing-level
* fallback. Individual content items returned by `resources/read` may include their
* own `_meta.ui` which takes precedence over this value.
*/
_meta?: {
/**
* UI-specific metadata including CSP configuration and rendering preferences.
*/
ui?: McpUiResourceMeta;
[key: string]: unknown;
};
}
/**
* Register an app tool with the MCP server.
*
* This is a convenience wrapper around `server.registerTool` that normalizes
* UI metadata: if `_meta.ui.resourceUri` is set, the legacy `_meta["ui/resourceUri"]`
* key is also populated (and vice versa) for compatibility with older hosts.
*
* @param server - The MCP server instance
* @param name - Tool name/identifier
* @param config - Tool configuration with `_meta` field containing UI metadata
* @param cb - Tool handler function
*
* @example Basic usage
* ```ts source="./index.examples.ts#registerAppTool_basicUsage"
* registerAppTool(
* server,
* "get-weather",
* {
* title: "Get Weather",
* description: "Get current weather for a location",
* inputSchema: z.object({ location: z.string() }),
* _meta: {
* ui: { resourceUri: "ui://weather/view.html" },
* },
* },
* async (args) => {
* const weather = await fetchWeather(args.location);
* return { content: [{ type: "text", text: JSON.stringify(weather) }] };
* },
* );
* ```
*
* @example Tool visible to model but not callable by UI
* ```ts source="./index.examples.ts#registerAppTool_modelOnlyVisibility"
* registerAppTool(
* server,
* "show-cart",
* {
* description: "Display the user's shopping cart",
* _meta: {
* ui: {
* resourceUri: "ui://shop/cart.html",
* visibility: ["model"],
* },
* },
* },
* async () => {
* const cart = await getCart();
* return { content: [{ type: "text", text: JSON.stringify(cart) }] };
* },
* );
* ```
*
* @example Tool hidden from model, only callable by UI
* ```ts source="./index.examples.ts#registerAppTool_appOnlyVisibility"
* registerAppTool(
* server,
* "update-quantity",
* {
* description: "Update item quantity in cart",
* inputSchema: z.object({ itemId: z.string(), quantity: z.number() }),
* _meta: {
* ui: {
* resourceUri: "ui://shop/cart.html",
* visibility: ["app"],
* },
* },
* },
* async ({ itemId, quantity }) => {
* const cart = await updateCartItem(itemId, quantity);
* return { content: [{ type: "text", text: JSON.stringify(cart) }] };
* },
* );
* ```
*
* @see {@link registerAppResource `registerAppResource`} to register the HTML resource referenced by the tool
*/
export declare function registerAppTool<OutputArgs extends StandardSchemaWithJSON, InputArgs extends StandardSchemaWithJSON | undefined = undefined>(server: Pick<McpServer, "registerTool">, name: string, config: McpUiAppToolConfig & {
inputSchema?: InputArgs;
outputSchema?: OutputArgs;
}, cb: ToolCallback<InputArgs>): RegisteredTool;
/**
* @deprecated Wrap with `z.object({...})` instead. Raw-shape form:
* `inputSchema`/`outputSchema` may be a plain `{ field: z.string() }` record;
* the SDK auto-wraps it with `z.object()`.
*/
export declare function registerAppTool<InputArgs extends ZodRawShape, OutputArgs extends ZodRawShape | StandardSchemaWithJSON | undefined = undefined>(server: Pick<McpServer, "registerTool">, name: string, config: McpUiAppToolConfig & {
inputSchema?: InputArgs;
outputSchema?: OutputArgs;
}, cb: LegacyToolCallback<InputArgs>): RegisteredTool;
export type McpUiReadResourceResult = ReadResourceResult & {
_meta?: {
ui?: McpUiResourceMeta;
[key: string]: unknown;
};
};
export type McpUiReadResourceCallback = (uri: URL, extra: Parameters<_ReadResourceCallback>[1]) => McpUiReadResourceResult | Promise<McpUiReadResourceResult>;
export type ReadResourceCallback = McpUiReadResourceCallback;
/**
* Register an app resource with the MCP server.
*
* This is a convenience wrapper around `server.registerResource` that:
* - Defaults the MIME type to {@link RESOURCE_MIME_TYPE `RESOURCE_MIME_TYPE`} (`"text/html;profile=mcp-app"`)
* - Provides a cleaner API matching the SDK's callback signature
*
* @param server - The MCP server instance
* @param name - Human-readable resource name
* @param uri - Resource URI (should match the `_meta.ui` field in tool config)
* @param config - Resource configuration
* @param readCallback - Callback that returns the resource contents
*
* @example Basic usage
* ```ts source="./index.examples.ts#registerAppResource_basicUsage"
* registerAppResource(
* server,
* "Weather View",
* "ui://weather/view.html",
* {
* description: "Interactive weather display",
* },
* async () => ({
* contents: [
* {
* uri: "ui://weather/view.html",
* mimeType: RESOURCE_MIME_TYPE,
* text: await fs.readFile("dist/view.html", "utf-8"),
* },
* ],
* }),
* );
* ```
*
* @example With CSP configuration for network access
* ```ts source="./index.examples.ts#registerAppResource_withCsp"
* registerAppResource(
* server,
* "Music Player",
* "ui://music/player.html",
* {
* description: "Audio player with external soundfonts",
* },
* async () => ({
* contents: [
* {
* uri: "ui://music/player.html",
* mimeType: RESOURCE_MIME_TYPE,
* text: musicPlayerHtml,
* _meta: {
* ui: {
* csp: {
* resourceDomains: ["https://cdn.example.com"], // For scripts/styles/images
* connectDomains: ["https://api.example.com"], // For fetch/WebSocket
* },
* },
* },
* },
* ],
* }),
* );
* ```
*
* @example With stable origin for external API CORS allowlists
* ```ts source="./index.examples.ts#registerAppResource_withDomain"
* // Computes a stable origin from an MCP server URL for hosting in Claude.
* function computeAppDomainForClaude(mcpServerUrl: string): string {
* const hash = crypto
* .createHash("sha256")
* .update(mcpServerUrl)
* .digest("hex")
* .slice(0, 32);
* return `${hash}.claudemcpcontent.com`;
* }
*
* const APP_DOMAIN = computeAppDomainForClaude("https://example.com/mcp");
*
* registerAppResource(
* server,
* "Company Dashboard",
* "ui://dashboard/view.html",
* {
* description: "Internal dashboard with company data",
* },
* async () => ({
* contents: [
* {
* uri: "ui://dashboard/view.html",
* mimeType: RESOURCE_MIME_TYPE,
* text: dashboardHtml,
* _meta: {
* ui: {
* // CSP: tell browser the app is allowed to make requests
* csp: {
* connectDomains: ["https://api.example.com"],
* },
* // CORS: give app a stable origin for the API server to allowlist
* //
* // (Public APIs that use `Access-Control-Allow-Origin: *` or API
* // key auth don't need this.)
* domain: APP_DOMAIN,
* },
* },
* },
* ],
* }),
* );
* ```
*
* @see {@link McpUiResourceMeta `McpUiResourceMeta`} for `_meta.ui` configuration options
* @see {@link McpUiResourceCsp `McpUiResourceCsp`} for CSP domain allowlist configuration
* @see {@link registerAppTool `registerAppTool`} to register tools that reference this resource
*/
export declare function registerAppResource(server: Pick<McpServer, "registerResource">, name: string, uri: string, config: McpUiAppResourceConfig, readCallback: McpUiReadResourceCallback): RegisteredResource;
/**
* Extension identifier for MCP Apps capability negotiation.
*
* Used as the key in `extensions` to advertise MCP Apps support.
*/
export declare const EXTENSION_ID = "io.modelcontextprotocol/ui";
/**
* Get MCP Apps capability settings from client capabilities.
*
* This helper retrieves the capability object from the `extensions` field
* where MCP Apps advertises its support.
*
* @param clientCapabilities - The client capabilities from the initialize response
* @returns The MCP Apps capability settings, or `undefined` if not supported
*
* @example Check for MCP Apps support in server initialization
* ```ts source="./index.examples.ts#getUiCapability_checkSupport"
* server.server.oninitialized = () => {
* const clientCapabilities = server.server.getClientCapabilities();
* const uiCap = getUiCapability(clientCapabilities);
*
* if (uiCap?.mimeTypes?.includes(RESOURCE_MIME_TYPE)) {
* // App-enhanced tool
* registerAppTool(
* server,
* "weather",
* {
* description: "Get weather information with interactive dashboard",
* _meta: { ui: { resourceUri: "ui://weather/dashboard" } },
* },
* weatherHandler,
* );
* } else {
* // Text-only fallback
* server.registerTool(
* "weather",
* {
* description: "Get weather information",
* },
* textWeatherHandler,
* );
* }
* };
* ```
*/
export declare function getUiCapability(clientCapabilities: ClientCapabilities | null | undefined): McpUiClientCapabilities | undefined;
@@ -0,0 +1,13 @@
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
const require_RouterProvider = require("../RouterProvider.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/ssr/RouterServer.tsx
function RouterServer(props) {
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RouterProvider.RouterProvider, { router: props.router });
}
//#endregion
exports.RouterServer = RouterServer;
//# sourceMappingURL=RouterServer.cjs.map
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Music2 = createLucideIcon("Music2", [
["circle", { cx: "8", cy: "18", r: "4", key: "1fc0mg" }],
["path", { d: "M12 18V2l7 4", key: "g04rme" }]
]);
export { Music2 as default };
//# sourceMappingURL=music-2.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_pR","2":"_f","33":"_BL _2B","164":"_1I"},D:{"1":"_5L","2":"_UC","33":"JB KB","164":"Q nB _FH","420":"_oD _gF"},E:{"1":"_jB","2":"_u","33":"L"},F:{"1":"_a","2":"_T"},G:{"1":"_2","2":"_1","33":"fD"},H:{"2":"1D"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"requestAnimationFrame",D:true};
@@ -0,0 +1,249 @@
let _lazyMatch = () => { var __lib__=(()=>{var m=Object.defineProperty,V=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,T=Object.prototype.hasOwnProperty,q=(r,e)=>{for(var n in e)m(r,n,{get:e[n],enumerable:true});},H=(r,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of G(e))!T.call(r,t)&&t!==n&&m(r,t,{get:()=>e[t],enumerable:!(a=V(e,t))||a.enumerable});return r},J=r=>H(m({},"__esModule",{value:true}),r),w={};q(w,{default:()=>re});var A=r=>Array.isArray(r),d=r=>typeof r=="function",Q=r=>r.length===0,W=r=>typeof r=="number",K=r=>typeof r=="object"&&r!==null,X=r=>r instanceof RegExp,b=r=>typeof r=="string",h=r=>r===void 0,Y=r=>{const e=new Map;return n=>{const a=e.get(n);if(a)return a;const t=r(n);return e.set(n,t),t}},rr=(r,e,n={})=>{const a={cache:{},input:r,index:0,indexMax:0,options:n,output:[]};if(v(e)(a)&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${a.indexMax}`)},i=(r,e)=>A(r)?er(r,e):b(r)?ar(r,e):nr(r,e),er=(r,e)=>{const n={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const t=a.charCodeAt(0);n[t]=true;}return a=>{const t=a.index,o=a.input;for(;a.index<o.length&&o.charCodeAt(a.index)in n;)a.index+=1;const u=a.index;if(u>t){if(!h(e)&&!a.options.silent){const s=a.input.slice(t,u),c=d(e)?e(s,o,String(t)):e;h(c)||a.output.push(c);}a.indexMax=Math.max(a.indexMax,a.index);}return true}},nr=(r,e)=>{const n=r.source,a=r.flags.replace(/y|$/,"y"),t=new RegExp(n,a);return g(o=>{t.lastIndex=o.index;const u=t.exec(o.input);if(u){if(!h(e)&&!o.options.silent){const s=d(e)?e(...u,o.input,String(o.index)):e;h(s)||o.output.push(s);}return o.index+=u[0].length,o.indexMax=Math.max(o.indexMax,o.index),true}else return false})},ar=(r,e)=>n=>{if(n.input.startsWith(r,n.index)){if(!h(e)&&!n.options.silent){const t=d(e)?e(r,n.input,String(n.index)):e;h(t)||n.output.push(t);}return n.index+=r.length,n.indexMax=Math.max(n.indexMax,n.index),true}else return false},C=(r,e,n,a)=>{const t=v(r);return g(_(M(o=>{let u=0;for(;u<n;){const s=o.index;if(!t(o)||(u+=1,o.index===s))break}return u>=e})))},tr=(r,e)=>C(r,0,1),f=(r,e)=>C(r,0,1/0),x=(r,e)=>{const n=r.map(v);return g(_(M(a=>{for(let t=0,o=n.length;t<o;t++)if(!n[t](a))return false;return true})))},l=(r,e)=>{const n=r.map(v);return g(_(a=>{for(let t=0,o=n.length;t<o;t++)if(n[t](a))return true;return false}))},M=(r,e=false)=>{const n=v(r);return a=>{const t=a.index,o=a.output.length,u=n(a);return (!u||e)&&(a.index=t,a.output.length!==o&&(a.output.length=o)),u}},_=(r,e)=>{const n=v(r);return n},g=(()=>{let r=0;return e=>{const n=v(e),a=r+=1;return t=>{var o;if(t.options.memoization===false)return n(t);const u=t.index,s=(o=t.cache)[a]||(o[a]=new Map),c=s.get(u);if(c===false)return false;if(W(c))return t.index=c,true;if(c)return t.index=c.index,c.output?.length&&t.output.push(...c.output),true;{const Z=t.output.length;if(n(t)){const D=t.index,U=t.output.length;if(U>Z){const ee=t.output.slice(Z,U);s.set(u,{index:D,output:ee});}else s.set(u,D);return true}else return s.set(u,false),false}}}})(),E=r=>{let e;return n=>(e||(e=v(r())),e(n))},v=Y(r=>{if(d(r))return Q(r)?E(r):r;if(b(r)||X(r))return i(r);if(A(r))return x(r);if(K(r))return l(Object.values(r));throw new Error("Invalid rule")}),P="abcdefghijklmnopqrstuvwxyz",ir=r=>{let e="";for(;r>0;){const n=(r-1)%26;e=P[n]+e,r=Math.floor((r-1)/26);}return e},O=r=>{let e=0;for(let n=0,a=r.length;n<a;n++)e=e*26+P.indexOf(r[n])+1;return e},S=(r,e)=>{if(e<r)return S(e,r);const n=[];for(;r<=e;)n.push(r++);return n},or=(r,e,n)=>S(r,e).map(a=>String(a).padStart(n,"0")),R=(r,e)=>S(O(r),O(e)).map(ir),p=r=>r,z=r=>ur(e=>rr(e,r,{memoization:false}).join("")),ur=r=>{const e={};return n=>e[n]??(e[n]=r(n))},sr=i(/^\*\*\/\*$/,".*"),cr=i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(r,e,n)=>`.*${e?"":"(?:^|/)"}${n.replaceAll(".","\\.")}`),lr=i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(r,e,n,a)=>`.*${e?"":"(?:^|/)"}${n.replaceAll(".","\\.")}(?:${a.replaceAll(",","|").replaceAll(".","\\.")})`),y=i(/\\./,p),pr=i(/[$.*+?^(){}[\]\|]/,r=>`\\${r}`),vr=i(/./,p),hr=i(/^(?:!!)*!(.*)$/,(r,e)=>`(?!^${L(e)}$).*?`),dr=i(/^(!!)+/,""),fr=l([hr,dr]),xr=i(/\/(\*\*\/)+/,"(?:/.+/|/)"),gr=i(/^(\*\*\/)+/,"(?:^|.*/)"),mr=i(/\/(\*\*)$/,"(?:/.*|$)"),_r=i(/\*\*/,".*"),j=l([xr,gr,mr,_r]),Sr=i(/\*\/(?!\*\*\/)/,"[^/]*/"),yr=i(/\*/,"[^/]*"),N=l([Sr,yr]),k=i("?","[^/]"),$r=i("[",p),wr=i("]",p),Ar=i(/[!^]/,"^/"),br=i(/[a-z]-[a-z]|[0-9]-[0-9]/i,p),Cr=i(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Mr=i(/[^\]]/,p),Er=l([y,Cr,br,Mr]),B=x([$r,tr(Ar),f(Er),wr]),Pr=i("{","(?:"),Or=i("}",")"),Rr=i(/(\d+)\.\.(\d+)/,(r,e,n)=>or(+e,+n,Math.min(e.length,n.length)).join("|")),zr=i(/([a-z]+)\.\.([a-z]+)/,(r,e,n)=>R(e,n).join("|")),jr=i(/([A-Z]+)\.\.([A-Z]+)/,(r,e,n)=>R(e.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),Nr=l([Rr,zr,jr]),I=x([Pr,Nr,Or]),kr=i("{","(?:"),Br=i("}",")"),Ir=i(",","|"),Fr=i(/[$.*+?^(){[\]\|]/,r=>`\\${r}`),Lr=i(/[^}]/,p),Zr=E(()=>F),Dr=l([j,N,k,B,I,Zr,y,FrLine truncated
return __lib__.default || __lib__; };
let _match;
const zeptomatch = (path, pattern) => {
if (!_match) {
_match = _lazyMatch();
_lazyMatch = null;
}
return _match(path, pattern);
};
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
function normalizeWindowsPath(input = "") {
if (!input) {
return input;
}
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
}
const _UNC_REGEX = /^[/\\]{2}/;
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
const sep = "/";
const normalize = function(path) {
if (path.length === 0) {
return ".";
}
path = normalizeWindowsPath(path);
const isUNCPath = path.match(_UNC_REGEX);
const isPathAbsolute = isAbsolute(path);
const trailingSeparator = path[path.length - 1] === "/";
path = normalizeString(path, !isPathAbsolute);
if (path.length === 0) {
if (isPathAbsolute) {
return "/";
}
return trailingSeparator ? "./" : ".";
}
if (trailingSeparator) {
path += "/";
}
if (_DRIVE_LETTER_RE.test(path)) {
path += "/";
}
if (isUNCPath) {
if (!isPathAbsolute) {
return `//./${path}`;
}
return `//${path}`;
}
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
};
const join = function(...segments) {
let path = "";
for (const seg of segments) {
if (!seg) {
continue;
}
if (path.length > 0) {
const pathTrailing = path[path.length - 1] === "/";
const segLeading = seg[0] === "/";
const both = pathTrailing && segLeading;
if (both) {
path += seg.slice(1);
} else {
path += pathTrailing || segLeading ? seg : `/${seg}`;
}
} else {
path += seg;
}
}
return normalize(path);
};
function cwd() {
if (typeof process !== "undefined" && typeof process.cwd === "function") {
return process.cwd().replace(/\\/g, "/");
}
return "/";
}
const resolve = function(...arguments_) {
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
let resolvedPath = "";
let resolvedAbsolute = false;
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
const path = index >= 0 ? arguments_[index] : cwd();
if (!path || path.length === 0) {
continue;
}
resolvedPath = `${path}/${resolvedPath}`;
resolvedAbsolute = isAbsolute(path);
}
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
return `/${resolvedPath}`;
}
return resolvedPath.length > 0 ? resolvedPath : ".";
};
function normalizeString(path, allowAboveRoot) {
let res = "";
let lastSegmentLength = 0;
let lastSlash = -1;
let dots = 0;
let char = null;
for (let index = 0; index <= path.length; ++index) {
if (index < path.length) {
char = path[index];
} else if (char === "/") {
break;
} else {
char = "/";
}
if (char === "/") {
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
if (res.length > 2) {
const lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex === -1) {
res = "";
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
}
lastSlash = index;
dots = 0;
continue;
} else if (res.length > 0) {
res = "";
lastSegmentLength = 0;
lastSlash = index;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
res += res.length > 0 ? "/.." : "..";
lastSegmentLength = 2;
}
} else {
if (res.length > 0) {
res += `/${path.slice(lastSlash + 1, index)}`;
} else {
res = path.slice(lastSlash + 1, index);
}
lastSegmentLength = index - lastSlash - 1;
}
lastSlash = index;
dots = 0;
} else if (char === "." && dots !== -1) {
++dots;
} else {
dots = -1;
}
}
return res;
}
const isAbsolute = function(p) {
return _IS_ABSOLUTE_RE.test(p);
};
const toNamespacedPath = function(p) {
return normalizeWindowsPath(p);
};
const extname = function(p) {
if (p === "..") return "";
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
return match && match[1] || "";
};
const relative = function(from, to) {
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
return _to.join("/");
}
const _fromCopy = [..._from];
for (const segment of _fromCopy) {
if (_to[0] !== segment) {
break;
}
_from.shift();
_to.shift();
}
return [..._from.map(() => ".."), ..._to].join("/");
};
const dirname = function(p) {
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
segments[0] += "/";
}
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
};
const format = function(p) {
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
Boolean
);
return normalizeWindowsPath(
p.root ? resolve(...segments) : segments.join("/")
);
};
const basename = function(p, extension) {
const segments = normalizeWindowsPath(p).split("/");
let lastSegment = "";
for (let i = segments.length - 1; i >= 0; i--) {
const val = segments[i];
if (val) {
lastSegment = val;
break;
}
}
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
};
const parse = function(p) {
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
const base = basename(p);
const extension = extname(base);
return {
root,
dir: dirname(p),
base,
ext: extension,
name: base.slice(0, base.length - extension.length)
};
};
const matchesGlob = (path, pattern) => {
return zeptomatch(pattern, normalize(path));
};
const _path = {
__proto__: null,
basename: basename,
dirname: dirname,
extname: extname,
format: format,
isAbsolute: isAbsolute,
join: join,
matchesGlob: matchesGlob,
normalize: normalize,
normalizeString: normalizeString,
parse: parse,
relative: relative,
resolve: resolve,
sep: sep,
toNamespacedPath: toNamespacedPath
};
export { _path as _, normalizeString as a, relative as b, basename as c, dirname as d, extname as e, format as f, normalizeWindowsPath as g, isAbsolute as i, join as j, matchesGlob as m, normalize as n, parse as p, resolve as r, sep as s, toNamespacedPath as t };
@@ -0,0 +1,4 @@
const isPressing = new WeakSet();
export { isPressing };
//# sourceMappingURL=state.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"streamableHttpWithSseFallbackClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.postcss=e()}})(function(){"use strict";var Bl=Object.create;var Tt=Object.defineProperty;var Ul=Object.getOwnPropertyDescriptor;var Fl=Object.getOwnPropertyNames;var Wl=Object.getPrototypeOf,$l=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(s){throw e=0,s}},hn=(t,e)=>{for(var s in e)Tt(t,s,{get:e[s],enumerable:!0})},dn=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fl(e))!$l.call(t,n)&&n!==s&&Tt(t,n,{get:()=>e[n],enumerable:!(r=Ul(e,n))||r.enumerable});return t};var Ne=(t,e,s)=>(s=t!=null?Bl(Wl(t)):{},dn(e||!t||!t.__esModule?Tt(s,"default",{value:t,enumerable:!0}):s,t)),Gl=t=>dn(Tt({},"__esModule",{value:!0}),t);var Vi=w((Ux,ds)=>{var _=String,Yi=function(){return{isColorSupported:!1,reset:_,bold:_,dim:_,italic:_,underline:_,inverse:_,hidden:_,strikethrough:_,black:_,red:_,green:_,yellow:_,blue:_,magenta:_,cyan:_,white:_,gray:_,bgBlack:_,bgRed:_,bgGreen:_,bgYellow:_,bgBlue:_,bgMagenta:_,bgCyan:_,bgWhite:_,blackBright:_,redBright:_,greenBright:_,yellowBright:_,blueBright:_,magentaBright:_,cyanBright:_,whiteBright:_,bgBlackBright:_,bgRedBright:_,bgGreenBright:_,bgYellowBright:_,bgBlueBright:_,bgMagentaBright:_,bgCyanBright:_,bgWhiteBright:_}};ds.exports=Yi();ds.exports.createColors=Yi});var ms=w(()=>{});var Xt=w(($x,Hi)=>{"use strict";var zi=Vi(),ji=ms(),ot=class t extends Error{constructor(e,s,r,n,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=zi.isColorSupported);let r=f=>f,n=f=>f,i=f=>f;if(e){let{bold:f,gray:h,red:l}=zi.createColors(!0);n=m=>f(l(m)),r=m=>h(m),ji&&(i=m=>ji(m))}let o=s.split(/\r?\n/),u=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;return o.slice(u,a).map((f,h)=>{let l=u+1+h,m=" "+(" "+l).slice(-c)+" | ";if(l===this.line){if(f.length>160){let d=20,p=Math.max(0,this.column-d),y=Math.max(this.column+d,this.endColumn+d),g=f.slice(p,y),v=r(m.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return n(">")+r(m)+i(g)+`
`+v+n("^")}let x=r(m.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(m)+i(f)+`
`+x+n("^")}return" "+r(m)+i(f)}).join(`
`)}toString(){let e=this.showSourceCode();return e&&(e=`
`+e+`
`),this.name+": "+this.message+e}};Hi.exports=ot;ot.default=ot});var Jt=w((Gx,Ki)=>{"use strict";var Zc=/(<)(\/?style\b)/gi,ef=/(<)(!--)/g;function fe(t){return typeof t!="string"||!t.includes("<")?t:t.replace(Zc,"\\3c $2").replace(ef,"\\3c $2")}var Qi={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function tf(t){return t[0].toUpperCase()+t.slice(1)}var at=class{constructor(e){this.builder=e}atrule(e,s){let r=e.raws,n="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof r.afterName<"u"?n+=r.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i);else{let o=(r.between||"")+(s?";":"");this.builder(fe(n+i+o),e)}}beforeAfter(e,s){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):s==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&n.type!=="root";)i+=1,n=n.parent;if(r.includes(`
`)){let o=this.raw(e,null,"indent");if(o.length)for(let u=0;u<i;u++)r+=o}return r}block(e,s){let r=this.raw(e,"between","beforeOpen");this.builder(fe(s+r)+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(fe(n)),this.builder("}",e,"end")}body(e){let s=e.nodes,r=s.length-1;for(;r>0&&s[r].type==="comment";)r-=1;let n=this.raw(e,"semicolon"),i=e.type==="document";for(let o=0;o<s.length;o++){let u=s[o],a=this.raw(u,"before");a&&this.builder(i?a:fe(a)),this.stringify(u,r!==o||n)}}comment(e){let s=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(fe("/*"+s+e.text+r+"*/"),e)}decl(e,s){let r=e.raws,n=this.raw(e,"between","colon"),i=e.prop+n+this.rawValue(e,"value");e.important&&(i+=r.important||" !important"),s&&(i+=";"),this.builder(fe(i),e)}document(e){this.body(e)}raw(e,s,r){let n;if(r||(r=s),s&&(n=e.raws[s],typeof n<"u"))return n;let i=e.parent;if(r==="before"&&(!i||i.type==="root"&&i.first===e||i&&i.type==="document"))return"";if(!i)return Qi[r];let o=e.root(),u=o.rawCache||(o.rawCache={});if(typeof u[r]<"u")return u[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let a="raw"+tf(r);this[a]?n=this[a](o,e):o.walk(c=>{if(n=c.raws[s],typeof n<"u")return!1})}return typeof n>"u"&&(n=Qi[r]),u[r]=n,n}rawBeforeClose(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return s=r.raws.after,s.includes(`
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawBeforeComment(e,s){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,s){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let s;return e.walk(r=>{if(r.type!=="decl"&&(s=r.raws.between,typeof s<"u"))return!1}),s}rawBeforeRule(e){let s;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(e){let s;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return s=r.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(s=r.raws.after,typeof s<"u"))return!1}),s}rawIndent(e){if(e.raws.indent)return e.raws.indent;let s;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof r.raws.before<"u"){let i=r.raws.before.split(`
`);return s=i[i.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(e){let s;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(s=r.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(e,s){let r=e[s],n=e.raws[s];return n&&n.value===r?n.raw:r}root(e){if(this.body(e),e.raws.after){let s=e.raws.after,r=e.parent&&e.parent.type==="document";this.builder(r?s:fe(s))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(fe(e.raws.ownSemicolon),e,"end")}stringify(e,s){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,s)}};Ki.exports=at;at.default=at});var ut=w((Yx,Xi)=>{"use strict";var rf=Jt();function ys(t,e){new rf(e).stringify(t)}Xi.exports=ys;ys.default=ys});var Zt=w((Vx,gs)=>{"use strict";gs.exports.isClean=Symbol("isClean");gs.exports.my=Symbol("my")});var ft=w((zx,Ji)=>{"use strict";var sf=Xt(),nf=Jt(),of=ut(),{isClean:lt,my:af}=Zt();function ws(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let n=t[r],i=typeof n;r==="parent"&&i==="object"?e&&(s[r]=e):r==="source"?s[r]=n:Array.isArray(n)?s[r]=n.map(o=>ws(o,s)):(i==="object"&&n!==null&&(n=ws(n)),s[r]=n)}return s}function J(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,n=0;for(let i=0;i<t.length;i++){if(r===e.line&&s===e.column){n=i;break}t[i]===`
`?(s=1,r+=1):s+=1}return n}var ct=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[lt]=!1,this[af]=!0;for(let s in e)if(s==="nodes"){this.nodes=[];for(let r of e[s])typeof r.clone=="function"&&r.parent?this.append(r.clone()):this.append(r)}else this[s]=e[s]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let s=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${s.input.from}:${s.start.line}:${s.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let s in e)this[s]=e[s];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let s=ws(this);for(let r in e)s[r]=e[r];return s}cloneAfter(e={}){let s=this.clone(e);return this.parent.insertAfter(this,s),s}cloneBefore(e={}){let s=this.clone(e);return this.parent.insertBefore(this,s),s}error(e,s={}){if(this.source){let{end:r,start:n}=this.rangeBy(s);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},s)}return new sf(e)}getProxyProcessor(){return{get(e,s){return s==="proxyOf"?e:s==="root"?()=>e.root().toProxy():e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="prop"||s==="value"||s==="name"||s==="params"||s==="important"||s==="text")&&e.markDirty()),!0}}}markClean(){this[lt]=!0}markDirty(){if(this[lt]){this[lt]=!1;let e=this;for(;e=e.parent;)e[lt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:J(s,this.source.start)};if(e.index)r=this.positionInside(e.index);else if(e.word){let i=s.slice(J(s,this.source.start),J(s,this.source.end)).indexOf(e.word);i!==-1&&(r=this.positionInside(i))}return r}positionInside(e){let s=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=J(n,this.source.start),o=i+e;for(let u=i;u<o;u++)n[u]===`
`?(s=1,r+=1):s+=1;return{column:s,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:J(s,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:J(s,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let o=s.slice(J(s,this.source.start),J(s,this.source.end)).indexOf(e.word);o!==-1&&(r=this.positionInside(o),n=this.positionInside(o+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:J(s,e.start)}:typeof e.index=="number"&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:J(s,e.end)}:typeof e.endIndex=="number"?n=this.positionInside(e.endIndex):typeof e.index=="number"&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,s){return new nf().raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let s=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(s,n),s=n):this.parent.insertBefore(s,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,s){let r={},n=s==null;s=s||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let u=this[o];if(Array.isArray(u))r[o]=u.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,s):a);else if(typeof u=="object"&&u.toJSON)r[o]=u.toJSON(null,s);else if(o==="source"){if(u==null)continue;let a=s.get(u.input);a==null&&(a=i,s.set(u.input,i),i++),r[o]={end:u.end,inputId:a,start:u.start}}else r[o]=u}return n&&(r.inputs=[...s.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=of){e.stringify&&(e=e.stringify);let s="";return e(this,r=>{s+=r}),s}warn(e,s,r={}){let n={node:this};for(let i in r)n[i]=r[i];return e.warn(s,n)}};Ji.exports=ct;ct.default=ct});var Fe=w((jx,Zi)=>{"use strict";var uf=ft(),pt=class extends uf{constructor(e){super(e),this.type="comment"}};Zi.exports=pt;pt.default=pt});var dt=w((Hx,eo)=>{"use strict";var lf=ft(),ht=class extends lf{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};eo.exports=ht;ht.default=ht});var pe=w((Qx,lo)=>{"use strict";var to=Fe(),ro=dt(),cf=ft(),{isClean:so,my:no}=Zt(),vs,io,oo,xs;function ao(t){return t.map(e=>(e.nodes&&(e.nodes=ao(e.nodes)),delete e.source,e))}function uo(t){if(t[so]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)uo(e)}var z=class t extends cf{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let n of r)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,n;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(n=>typeof n=="function"?(i,o)=>n(i.toProxy(),o):n)):s==="every"||s==="some"?r=>e[s]((n,...i)=>r(n.toProxy(),...i)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),n=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of n)this.proxyOf.nodes.splice(r+1,0,o);let i;for(let o in this.indexes)i=this.indexes[o],r<i&&(this.indexes[o]=i+n.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),n=r===0?"prepend":!1,i=this.normalize(s,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let u of i)this.proxyOf.nodes.splice(r,0,u);let o;for(let u in this.indexes)o=this.indexes[u],r<=o&&(this.indexes[u]=o+i.length);return this.markDirty(),this}normalize(e,s){iLine truncated
`),s=new Array(e.length),r=0;for(let n=0,i=e.length;n<i;n++)s[n]=r,r+=e[n].length+1;return t[Es]=s,s}var We=class{get from(){return this.file||this.id}constructor(e,s={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!go||/^\w+:\/\//.test(s.from)||Ss(s.from)?this.file=s.from:this.file=Ts(s.from)),go&&wf){let r=new gf(this.css,s);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+df(6)+">"),this.map&&(this.map.file=this.from)}error(e,s,r,n={}){let i,o,u,a,c;if(s&&typeof s=="object"){let h=s,l=r;if(typeof h.offset=="number"){a=h.offset;let m=this.fromOffset(a);s=m.line,r=m.col}else s=h.line,r=h.column,a=this.fromLineAndColumn(s,r);if(typeof l.offset=="number"){u=l.offset;let m=this.fromOffset(u);o=m.line,i=m.col}else o=l.line,i=l.column,u=this.fromLineAndColumn(l.line,l.column)}else if(r)a=this.fromLineAndColumn(s,r);else{a=s;let h=this.fromOffset(a);s=h.line,r=h.col}let f=this.origin(s,r,o,i);return f?c=new yo(e,f.endLine===void 0?f.line:{column:f.column,line:f.line},f.endLine===void 0?f.column:{column:f.endColumn,line:f.endLine},f.source,f.file,n.plugin):c=new yo(e,o===void 0?s:{column:r,line:s},o===void 0?r:{column:i,line:o},this.css,this.file,n.plugin),c.input={column:r,endColumn:i,endLine:o,endOffset:u,line:s,offset:a,source:this.css},this.file&&(er&&(c.input.url=er(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,s){return wo(this)[e-1]+s-1}fromOffset(e){let s=wo(this),r=s[s.length-1],n=0;if(e>=r)n=s.length-1;else{let i=s.length-2,o;for(;n<i;)if(o=n+(i-n>>1),e<s[o])i=o-1;else if(e>=s[o+1])n=o+1;else{n=o;break}}return{col:e-s[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ts(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,r,n){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:s-1,line:e});if(!o.source)return!1;let u;typeof r=="number"&&(u=i.originalPositionFor({column:n-1,line:r}));let a;Ss(o.source)?a=er(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||er(this.map.mapFile));let c={column:o.column+1,endColumn:u&&u.column+1,endLine:u&&u.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(mo)c.file=mo(a);else throw new Error("file: protocol is not available in this PostCSS build");let f=i.sourceContentFor(o.source);return f&&(c.source=f),c}toJSON(){let e={};for(let s of["hasBOM","css","file","id"])this[s]!=null&&(e[s]=this[s]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};vo.exports=We;We.default=We;bs&&bs.registerInput&&bs.registerInput(We)});var tr=w((r_,_o)=>{"use strict";var xo=pe(),Ge=class extends xo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};_o.exports=Ge;Ge.default=Ge;xo.registerAtRule(Ge)});var Ye=w((s_,To)=>{"use strict";var bo=pe(),Eo,So,he=class extends bo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,s,r){let n=super.normalize(e);if(s){if(r==="prepend")this.nodes.length>1?s.raws.before=this.nodes[1].raws.before:delete s.raws.before;else if(this.first!==s)for(let i of n)i.raws.before=s.raws.before}return n}removeChild(e,s){let r=this.index(e);return!s&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Eo(new So,this,e).stringify()}};he.registerLazyResult=t=>{Eo=t};he.registerProcessor=t=>{So=t};To.exports=he;he.default=he;bo.registerRoot(he)});var ks=w((n_,ko)=>{"use strict";var mt={comma(t){return mt.split(t,[","],!0)},space(t){let e=[" ",`
`," "];return mt.split(t,e)},split(t,e,s){let r=[],n="",i=!1,o=0,u=!1,a="",c=!1;for(let f of t)c?c=!1:f==="\\"?c=!0:u?f===a&&(u=!1):f==='"'||f==="'"?(u=!0,a=f):f==="("?o+=1:f===")"?o>0&&(o-=1):o===0&&e.includes(f)&&(i=!0),i?(n!==""&&r.push(n.trim()),n="",i=!1):n+=f;return(s||n!=="")&&r.push(n.trim()),r}};ko.exports=mt;mt.default=mt});var rr=w((i_,Ao)=>{"use strict";var Oo=pe(),vf=ks(),Ve=class extends Oo{get selectors(){return vf.comma(this.selector)}set selectors(e){let s=this.selector?this.selector.match(/,\s*/):null,r=s?s[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};Ao.exports=Ve;Ve.default=Ve;Oo.registerRule(Ve)});var ir=w((o_,No)=>{"use strict";var sr=/[\t\n\f\r "#'()/;[\\\]{}]/g,nr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xf=/.[\r\n"'(/\\]/,Co=/[\da-f]/i;No.exports=function(e,s={}){let r=e.css.valueOf(),n=s.ignoreErrors,i,o,u,a,c,f,h,l,m,x,d=r.length,p=0,y=[],g=[],v=-1;function C(){return p}function q(k){throw e.error("Unclosed "+k,p)}function W(){return g.length===0&&p>=d}function se(k){if(g.length)return g.pop();if(p>=d)return;let b=k?k.ignoreUnclosed:!1;switch(i=r.charCodeAt(p),i){case 10:case 32:case 9:case 13:case 12:{a=p;do a+=1,i=r.charCodeAt(a);while(i===32||i===10||i===9||i===13||i===12);f=["space",r.slice(p,a)],p=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let S=String.fromCharCode(i);f=[S,S,p];break}case 40:{if(x=y.length?y.pop()[1]:"",m=r.charCodeAt(p+1),x==="url"&&m!==39&&m!==34&&m!==32&&m!==10&&m!==9&&m!==12&&m!==13){a=p;do{if(h=!1,a=r.indexOf(")",a+1),a===-1)if(n||b){a=p;break}else q("bracket");for(l=a;r.charCodeAt(l-1)===92;)l-=1,h=!h}while(h);f=["brackets",r.slice(p,a+1),p,a],p=a}else p<=v?f=["(","(",p]:(a=r.indexOf(")",p+1),o=r.slice(p,a+1),a===-1||xf.test(o)?(v=a===-1?d:a,f=["(","(",p]):(f=["brackets",o,p,a],p=a));break}case 39:case 34:{c=i===39?"'":'"',a=p;do{if(h=!1,a=r.indexOf(c,a+1),a===-1)if(n||b){a=p+1;break}else q("string");for(l=a;r.charCodeAt(l-1)===92;)l-=1,h=!h}while(h);f=["string",r.slice(p,a+1),p,a],p=a;break}case 64:{sr.lastIndex=p+1,sr.test(r),sr.lastIndex===0?a=r.length-1:a=sr.lastIndex-2,f=["at-word",r.slice(p,a+1),p,a],p=a;break}case 92:{for(a=p,u=!0;r.charCodeAt(a+1)===92;)a+=1,u=!u;if(i=r.charCodeAt(a+1),u&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(a+=1,Co.test(r.charAt(a)))){for(;Co.test(r.charAt(a+1));)a+=1;r.charCodeAt(a+1)===32&&(a+=1)}f=["word",r.slice(p,a+1),p,a],p=a;break}default:{i===47&&r.charCodeAt(p+1)===42?(a=r.indexOf("*/",p+2)+1,a===0&&(n||b?a=r.length:q("comment")),f=["comment",r.slice(p,a+1),p,a],p=a):(nr.lastIndex=p+1,nr.test(r),nr.lastIndex===0?a=r.length-1:a=nr.lastIndex-2,f=["word",r.slice(p,a+1),p,a],y.push(f),p=a);break}}return p++,f}function ye(k){g.push(k)}return{back:ye,endOfFile:W,nextToken:se,position:C}}});var or=w((a_,Io)=>{"use strict";var _f=tr(),bf=Fe(),Ef=dt(),Sf=Ye(),Po=rr(),Tf=ir(),Ro={empty:!0,space:!0};function kf(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}function Os(t,e,s){let r="";for(let n=e;n<s;n++)r+=t[n][1];return r}var As=class{constructor(e){this.input=e,this.root=new Sf,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let s=new _f;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let r,n,i,o=!1,u=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){u=!0;break}else if(r==="}"){if(a.length>0){for(i=a.length-1,n=a[i];n&&n[0]==="space";)n=a[--i];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),u&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let s=this.colon(e);if(s===!1)return;let r=0,n;for(let i=s-1;i>=0&&(n=e[i],!(n[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let s=0,r,n,i;for(let[o,u]of e.entries()){if(n=u,i=n[0],i==="("&&(s+=1),i===")"&&(s-=1),s===0&&i===":")if(!r)this.doubleColon(n);else{if(r[0]==="word"&&r[1]==="progid")continue;return o}r=n}return!1}comment(e){let s=new bf;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let r=e[1].slice(2,-2);if(!r.trim())s.text="",s.raws.left=r,s.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);s.text=n[2],s.raws.left=n[1],s.raws.right=n[3Line truncated
`))),n=t[1].substring(t[1].indexOf(`
`));let o=this.input.css.valueOf().substring(this.tokenizer.position());n+=o,r=t[3]+o.length-n.length}else this.tokenizer.back(t);break}s.push(t[1]),r=t[2],t=this.tokenizer.nextToken({ignoreUnclosed:!0})}let i=["comment",s.join(""),e[2],r];return this.inlineComment(i),n&&(this.input=new Pf(n),this.tokenizer=Nf(this.input)),!0}else if(t[1]==="/"){let e=this.tokenizer.nextToken({ignoreUnclosed:!0});if(e[0]==="comment"&&/^\/\*/.test(e[1]))return e[0]="word",e[1]=e[1].slice(1),t[1]="//",this.tokenizer.back(e),Cs.exports.isInlineComment.bind(this)(t)}return!1}}});var Mo=w((c_,Do)=>{Do.exports={interpolation(t){let e=[t,this.tokenizer.nextToken()],s=["word","}"];if(e[0][1].length>1||e[1][0]!=="{")return this.tokenizer.back(e[1]),!1;for(t=this.tokenizer.nextToken();t&&s.includes(t[0]);)e.push(t),t=this.tokenizer.nextToken();let r=e.map(u=>u[1]),[n]=e,i=e.pop(),o=["word",r.join(""),n[2],i[2]];return this.tokenizer.back(t),this.tokenizer.back(o),!0}}});var Uo=w((f_,Bo)=>{var Rf=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/,If=/\.[0-9]/,Lf=t=>{let[,e]=t,[s]=e;return(s==="."||s==="#")&&Rf.test(e)===!1&&If.test(e)===!1};Bo.exports={isMixinToken:Lf}});var Wo=w((p_,Fo)=>{var qf=ir(),Df=/^url\((.+)\)/;Fo.exports=t=>{let{name:e,params:s=""}=t;if(e==="import"&&s.length){t.import=!0;let r=qf({css:s});for(t.filename=s.replace(Df,"$1");!r.endOfFile();){let[n,i]=r.nextToken();if(n==="word"&&i==="url")return;if(n==="brackets"){t.options=i,t.filename=s.replace(i,"").trim();break}}}}});var Vo=w((h_,Yo)=>{var $o=/:$/,Go=/^:(\s+)?/;Yo.exports=t=>{let{name:e,params:s=""}=t;if(t.name.slice(-1)===":"){if($o.test(e)){let[r]=e.match($o);t.name=e.replace(r,""),t.raws.afterName=r+(t.raws.afterName||""),t.variable=!0,t.value=t.params}if(Go.test(s)){let[r]=s.match(Go);t.value=s.replace(r,""),t.raws.afterName=(t.raws.afterName||"")+r,t.variable=!0}}}});var Ho=w((m_,jo)=>{var Mf=Fe(),Bf=or(),{isInlineComment:Uf}=qo(),{interpolation:zo}=Mo(),{isMixinToken:Ff}=Uo(),Wf=Wo(),$f=Vo(),Gf=/(!\s*important)$/i;jo.exports=class extends Bf{constructor(...e){super(...e),this.lastNode=null}atrule(e){zo.bind(this)(e)||(super.atrule(e),Wf(this.lastNode),$f(this.lastNode))}decl(...e){super.decl(...e),/extend\(.+\)/i.test(this.lastNode.value)&&(this.lastNode.extend=!0)}each(e){e[0][1]=` ${e[0][1]}`;let s=e.findIndex(u=>u[0]==="("),r=e.reverse().find(u=>u[0]===")"),n=e.reverse().indexOf(r),o=e.splice(s,n).map(u=>u[1]).join("");for(let u of e.reverse())this.tokenizer.back(u);this.atrule(this.tokenizer.nextToken()),this.lastNode.function=!0,this.lastNode.params=o}init(e,s,r){super.init(e,s,r),this.lastNode=e}inlineComment(e){let s=new Mf,r=e[1].slice(2);if(this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.inline=!0,s.raws.begin="//",/^\s*$/.test(r))s.text="",s.raws.left=r,s.raws.right="";else{let n=r.match(/^(\s*)([^]*[^\s])(\s*)$/);[,s.raws.left,s.text,s.raws.right]=n}}mixin(e){let[s]=e,r=s[1].slice(0,1),n=e.findIndex(c=>c[0]==="brackets"),i=e.findIndex(c=>c[0]==="("),o="";if((n<0||n>3)&&i>0){let c=e.reduce((v,C,q)=>C[0]===")"?q:v),h=e.slice(i,c+i).map(v=>v[1]).join(""),[l]=e.slice(i),m=[l[2],l[3]],[x]=e.slice(c,c+1),d=[x[2],x[3]],p=["brackets",h].concat(m,d),y=e.slice(0,i),g=e.slice(c+1);e=y,e.push(p),e=e.concat(g)}let u=[];for(let c of e)if((c[1]==="!"||u.length)&&u.push(c),c[1]==="important")break;if(u.length){let[c]=u,f=e.indexOf(c),h=u[u.length-1],l=[c[2],c[3]],m=[h[4],h[5]],d=["word",u.map(p=>p[1]).join("")].concat(l,m);e.splice(f,u.length,d)}let a=e.findIndex(c=>Gf.test(c[1]));a>0&&([,o]=e[a],e.splice(a,1));for(let c of e.reverse())this.tokenizer.back(c);this.atrule(this.tokenizer.nextToken()),this.lastNode.mixin=!0,this.lastNode.raws.identifier=r,o&&(this.lastNode.important=!0,this.lastNode.raws.important=o)}other(e){Uf.bind(this)(e)||super.other(e)}rule(e){let s=e[e.length-1],r=e[e.length-2];if(r[0]==="at-word"&&s[0]==="{"&&(this.tokenizer.back(s),zo.bind(this)(r))){let i=this.tokenizer.nextToken();e=e.slice(0,e.length-2).concat([i]);for(let o of e.reverse())this.tokenizer.back(o);return}super.rule(e),/:extend\(.+\)/i.test(this.lastNode.selector)&&(this.lastNode.extend=!0)}unknownWord(e){let[s]=e;if(e[0][1]==="each"&&e[1][0]==="("){this.each(e);return}if(Ff(s)){this.mixin(e);return}super.unknownWord(e)}}});var Ko=w((g_,Qo)=>{var Yf=Jt();Qo.exports=class extends Yf{atrule(e,s){if(!e.mixin&&!e.variable&&!e.function){super.atrule(e,s);return}let n=`${e.function?"":e.raws.identifier||"@"}${e.name}`,i=e.params?this.rawValue(e,"params"):"",o=e.raws.important||"";if(e.variable&&(i=e.value),typeof e.raws.afterName<"u"?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i+o);else{let u=(e.raws.between||"")+o+(s?";":"");this.builder(n+i+u,e)}}comment(e){if(e.inline){let s=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(`//${s}${e.text}${r}`,e)}else super.comment(e)}}});var Xo=w((w_,Ns)=>{var Vf=$e(),zf=Ho(),jf=Ko();Ns.exports={parse(t,e){let s=new Vf(t,e),r=new zf(s);return r.parse(),r.root.walk(n=>{let i=s.css.lastIndexLine truncated
https://evilmartians.com/chronicles/postcss-8-plugin-migration`));let u=s(...o);return u.postcssPlugin=e,u.postcssVersion=new Ms().version,u}let i;return Object.defineProperty(n,"postcss",{get(){return i||(i=n()),i}}),n.process=function(o,u,a){return E([n(a)]).process(o,u)},n};E.stringify=Np;E.parse=Ap;E.fromJSON=Ep;E.list=kp;E.comment=t=>new ga(t);E.atRule=t=>new ya(t);E.decl=t=>new wa(t);E.rule=t=>new _a(t);E.root=t=>new xa(t);E.document=t=>new va(t);E.CssSyntaxError=bp;E.Declaration=wa;E.Container=_p;E.Processor=Ms;E.Document=va;E.Comment=ga;E.Warning=Pp;E.AtRule=ya;E.Result=Cp;E.Input=Sp;E.Rule=_a;E.Root=xa;E.Node=Op;Tp.registerPostcss(E);ba.exports=E;E.default=E});var Sa=w((R_,Ea)=>{var{Container:Rp}=cr(),Bs=class extends Rp{constructor(e){super(e),this.type="decl",this.isNested=!0,this.nodes||(this.nodes=[])}};Ea.exports=Bs});var Oa=w((I_,ka)=>{"use strict";var fr=/[\t\n\f\r "#'()/;[\\\]{}]/g,pr=/[,\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ip=/.[\r\n"'(/\\]/,Ta=/[\da-f]/i,hr=/[\n\f\r]/g;ka.exports=function(e,s={}){let r=e.css.valueOf(),n=s.ignoreErrors,i,o,u,a,c,f,h,l,m,x=r.length,d=0,p=[],y=[],g;function v(){return d}function C(k){throw e.error("Unclosed "+k,d)}function q(){return y.length===0&&d>=x}function W(){let k=1,b=!1,S=!1;for(;k>0;)o+=1,r.length<=o&&C("interpolation"),i=r.charCodeAt(o),l=r.charCodeAt(o+1),b?!S&&i===b?(b=!1,S=!1):i===92?S=!S:S&&(S=!1):i===39||i===34?b=i:i===125?k-=1:i===35&&l===123&&(k+=1)}function se(k){if(y.length)return y.pop();if(d>=x)return;let b=k?k.ignoreUnclosed:!1;switch(i=r.charCodeAt(d),i){case 10:case 32:case 9:case 13:case 12:{o=d;do o+=1,i=r.charCodeAt(o);while(i===32||i===10||i===9||i===13||i===12);m=["space",r.slice(d,o)],d=o-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let S=String.fromCharCode(i);m=[S,S,d];break}case 44:{m=["word",",",d,d+1];break}case 40:{if(h=p.length?p.pop()[1]:"",l=r.charCodeAt(d+1),h==="url"&&l!==39&&l!==34){for(g=1,f=!1,o=d+1;o<=r.length-1;){if(l=r.charCodeAt(o),l===92)f=!f;else if(l===40)g+=1;else if(l===41&&(g-=1,g===0))break;o+=1}a=r.slice(d,o+1),m=["brackets",a,d,o],d=o}else o=r.indexOf(")",d+1),a=r.slice(d,o+1),o===-1||Ip.test(a)?m=["(","(",d]:(m=["brackets",a,d,o],d=o);break}case 39:case 34:{for(u=i,o=d,f=!1;o<x&&(o++,o===x&&C("string"),i=r.charCodeAt(o),l=r.charCodeAt(o+1),!(!f&&i===u));)i===92?f=!f:f?f=!1:i===35&&l===123&&W();m=["string",r.slice(d,o+1),d,o],d=o;break}case 64:{fr.lastIndex=d+1,fr.test(r),fr.lastIndex===0?o=r.length-1:o=fr.lastIndex-2,m=["at-word",r.slice(d,o+1),d,o],d=o;break}case 92:{for(o=d,c=!0;r.charCodeAt(o+1)===92;)o+=1,c=!c;if(i=r.charCodeAt(o+1),c&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(o+=1,Ta.test(r.charAt(o)))){for(;Ta.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===32&&(o+=1)}m=["word",r.slice(d,o+1),d,o],d=o;break}default:l=r.charCodeAt(d+1),i===35&&l===123?(o=d,W(),a=r.slice(d,o+1),m=["word",a,d,o],d=o):i===47&&l===42?(o=r.indexOf("*/",d+2)+1,o===0&&(n||b?o=r.length:C("comment")),m=["comment",r.slice(d,o+1),d,o],d=o):i===47&&l===47?(hr.lastIndex=d+1,hr.test(r),hr.lastIndex===0?o=r.length-1:o=hr.lastIndex-2,a=r.slice(d,o+1),m=["comment",a,d,o,"inline"],d=o):(pr.lastIndex=d+1,pr.test(r),pr.lastIndex===0?o=r.length-1:o=pr.lastIndex-2,m=["word",r.slice(d,o+1),d,o],p.push(m),d=o);break}return d++,m}function ye(k){y.push(k)}return{back:ye,endOfFile:q,nextToken:se,position:v}}});var Ca=w((L_,Aa)=>{var{Comment:Lp}=cr(),qp=or(),Dp=Sa(),Mp=Oa(),Us=class extends qp{atrule(e){let s=e[1],r=e;for(;!this.tokenizer.endOfFile();){let n=this.tokenizer.nextToken();if(n[0]==="word"&&n[2]===r[3]+1)s+=n[1],r=n;else{this.tokenizer.back(n);break}}super.atrule(["at-word",s,e[2],r[3]])}comment(e){if(e[4]==="inline"){let s=new Lp;this.init(s,e[2]),s.raws.inline=!0;let r=this.input.fromOffset(e[3]);s.source.end={column:r.col,line:r.line,offset:e[3]+1};let n=e[1].slice(2);if(/^\s*$/.test(n))s.text="",s.raws.left=n,s.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/),o=i[2].replace(/(\*\/|\/\*)/g,"*//*");s.text=o,s.raws.left=i[1],s.raws.right=i[3],s.raws.text=i[2]}}else super.comment(e)}createTokenizer(){this.tokenizer=Mp(this.input)}raw(e,s,r,n){if(super.raw(e,s,r,n),e.raws[s]){let i=e.raws[s].raw;e.raws[s].raw=r.reduce((o,u)=>{if(u[0]==="comment"&&u[4]==="inline"){let a=u[1].slice(2).replace(/(\*\/|\/\*)/g,"*//*");return o+"/*"+a+"*/"}else return o+u[1]},""),i!==e.raws[s].raw&&(e.raws[s].scss=i)}}rule(e){let s=!1,r=0,n="";for(let i of e)if(s)i[0]!=="comment"&&i[0]!=="{"&&(n+=i[1]);else{if(i[0]==="space"&&i[1].includes(`
`))break;i[0]==="("?r+=1:i[0]===")"?r-=1:r===0&&i[0]===":"&&(s=!0)}if(!s||n.trim()===""||/^[#:A-Za-z-]/.test(n))super.rule(e);else{e.pop();let i=new Dp;this.init(i,e[0][2]);let o;for(let a=e.length-1;a>=0;a--)if(e[a][0]!=="space"){o=e[a];break}if(o[3]){let a=this.input.fromOffset(o[3]);i.source.end={column:a.col,line:a.line,offset:o[3]+1}}else{let a=this.input.fromOffset(o[2]);i.source.end={column:a.col,line:a.line,offset:o[2]+1}}for(;e[0][0]!=="word";)i.raws.before+=e.shift()[1];if(e[0][2]){let a=this.input.fromOffset(e[0][2]);i.source.start={column:a.col,line:a.line,offset:e[0][2]}}for(i.prop="";e.length;){let a=e[0][0];if(a===":"||a==="space"||a==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let u;for(;e.length;)if(u=e.shift(),u[0]===":"){i.raws.between+=u[1];break}else i.raws.between+=u[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1)),i.raws.between+=this.spacesAndCommentsFromStart(e),this.precheckMissedSemicolon(e);for(let a=e.length-1;a>0;a--){if(u=e[a],u[1]==="!important"){i.important=!0;let c=this.stringFrom(e,a);c=this.spacesFromEnd(e)+c,c!==" !important"&&(i.raws.important=c);break}else if(u[1]==="important"){let c=e.slice(0),f="";for(let h=a;h>0;h--){let l=c[h][0];if(f.trim().indexOf("!")===0&&l!=="space")break;f=c.pop()[1]+f}f.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=f,e=c)}if(u[0]!=="space"&&u[0]!=="comment")break}this.raw(i,"value",e),i.value.includes(":")&&this.checkMissedSemicolon(e),this.current=i}}};Aa.exports=Us});var Pa=w((q_,Na)=>{var{Input:Bp}=cr(),Up=Ca();Na.exports=function(e,s){let r=new Bp(e,s),n=new Up(r);return n.parse(),n.root}});var Ws=w(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});function $p(t){this.after=t.after,this.before=t.before,this.type=t.type,this.value=t.value,this.sourceIndex=t.sourceIndex}Fs.default=$p});var Gs=w($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var Gp=Ws(),Ia=Yp(Gp);function Yp(t){return t&&t.__esModule?t:{default:t}}function bt(t){var e=this;this.constructor(t),this.nodes=t.nodes,this.after===void 0&&(this.after=this.nodes.length>0?this.nodes[this.nodes.length-1].after:""),this.before===void 0&&(this.before=this.nodes.length>0?this.nodes[0].before:""),this.sourceIndex===void 0&&(this.sourceIndex=this.before.length),this.nodes.forEach(function(s){s.parent=e})}bt.prototype=Object.create(Ia.default.prototype);bt.constructor=Ia.default;bt.prototype.walk=function(e,s){for(var r=typeof e=="string"||e instanceof RegExp,n=r?s:e,i=typeof e=="string"?new RegExp(e):e,o=0;o<this.nodes.length;o++){var u=this.nodes[o],a=r?i.test(u.type):!0;if(a&&n&&n(u,o,this.nodes)===!1||u.nodes&&u.walk(e,s)===!1)return!1}return!0};bt.prototype.each=function(){for(var e=arguments.length<=0||arguments[0]===void 0?function(){}:arguments[0],s=0;s<this.nodes.length;s++){var r=this.nodes[s];if(e(r,s,this.nodes)===!1)return!1}return!0};$s.default=bt});var Ma=w(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.parseMediaFeature=Da;Et.parseMediaQuery=Vs;Et.parseMediaList=jp;var Vp=Ws(),La=qa(Vp),zp=Gs(),Ys=qa(zp);function qa(t){return t&&t.__esModule?t:{default:t}}function Da(t){var e=arguments.length<=1||arguments[1]===void 0?0:arguments[1],s=[{mode:"normal",character:null}],r=[],n=0,i="",o=null,u=null,a=e,c=t;t[0]==="("&&t[t.length-1]===")"&&(c=t.substring(1,t.length-1),a++);for(var f=0;f<c.length;f++){var h=c[f];if((h==="'"||h==='"')&&(s[n].isCalculationEnabled===!0?(s.push({mode:"string",isCalculationEnabled:!1,character:h}),n++):s[n].mode==="string"&&s[n].character===h&&c[f-1]!=="\\"&&(s.pop(),n--)),h==="{"?(s.push({mode:"interpolation",isCalculationEnabled:!0}),n++):h==="}"&&(s.pop(),n--),s[n].mode==="normal"&&h===":"){var l=c.substring(f+1);u={type:"value",before:/^(\s*)/.exec(l)[1],after:/(\s*)$/.exec(l)[1],value:l.trim()},u.sourceIndex=u.before.length+f+1+a,o={type:"colon",sourceIndex:f+a,after:u.before,value:":"};break}i+=h}return i={type:"media-feature",before:/^(\s*)/.exec(i)[1],after:/(\s*)$/.exec(i)[1],value:i.trim()},i.sourceIndex=i.before.length+a,r.push(i),o!==null&&(o.before=i.after,r.push(o)),u!==null&&r.push(u),r}function Vs(t){var e=arguments.length<=1||arguments[1]===void 0?0:arguments[1],s=[],r=0,n=!1,i=void 0;function o(){return{before:"",after:"",value:""}}i=o();for(var u=0;u<t.length;u++){var a=t[u];n?(i.value+=a,(a==="{"||a==="(")&&r++,(a===")"||a==="}")&&r--):a.search(/\s/)!==-1?i.before+=a:(a==="("&&(i.type="media-feature-expression",r++),i.value=a,i.sourceIndex=e+u,n=!0),n&&r===0&&(a===")"||u===t.length-1||t[u+1].search(/\s/)!==-1)&&(["not","only","and"].indexOf(i.value)!==-1&&(i.type="keyword"),i.type==="media-feature-expression"&&(i.nodes=Da(i.value,i.sourceIndex)),s.push(Array.isArray(i.nodes)?new Ys.default(i):new La.default(i)),i=o(),n=!1)}for(var c=0;c<s.length;c++)if(i=s[c],c>0&&(s[c-1].after=i.before),i.type===void 0){if(c>0){if(s[c-1].type==="media-feature-expression"){i.type="keyword";continue}if(s[c-1].value==="not"Line truncated
`),u=o.length-1,u>0?(f=p+u,h=n-o[u].length):(f=p,h=d),e.push(["comment",a,p,y-d,f,n-h,y]),d=h,p=f,y=n):(Rr.lastIndex=y+1,Rr.test(s),Rr.lastIndex===0?n=s.length-1:n=Rr.lastIndex-2,e.push(["word",s.slice(y,n+1),p,y-d,p,n-d,y]),y=n);break}y++}return e}Ou.exports=Ir.default});var Pu=w((Lr,Nu)=>{"use strict";Lr.__esModule=!0;var Tm=(function(){function t(e,s){for(var r=0;r<s.length;r++){var n=s[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,s,r){return s&&t(e.prototype,s),r&&t(e,r),e}})(),km=Hs(),Om=L(km),Am=Qs(),rn=L(Am),Cm=Ks(),Nm=L(Cm),Pm=Ha(),Rm=L(Pm),Im=Ka(),sn=L(Im),Lm=Za(),qm=L(Lm),Dm=tu(),Mm=L(Dm),Bm=su(),Um=L(Bm),Fm=iu(),Wm=L(Fm),$m=au(),Gm=L($m),Ym=lu(),Vm=L(Ym),zm=fu(),jm=L(zm),Hm=hu(),Qm=L(Hm),Km=mu(),Xm=L(Km),Jm=gu(),Zm=L(Jm),ey=vu(),ty=L(ey),ry=Au(),Cu=L(ry),sy=M(),ny=iy(sy);function iy(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}function L(t){return t&&t.__esModule?t:{default:t}}function oy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ay=(function(){function t(e){oy(this,t),this.input=e,this.lossy=e.options.lossless===!1,this.position=0,this.root=new Rm.default;var s=new sn.default;return this.root.append(s),this.current=s,this.lossy?this.tokens=(0,Cu.default)({safe:e.safe,css:e.css.trim()}):this.tokens=(0,Cu.default)(e),this.loop()}return t.prototype.attribute=function(){var s="",r=void 0,n=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[0]!=="]";)s+=this.tokens[this.position][1],this.position++;this.position===this.tokens.length&&!~s.indexOf("]")&&this.error("Expected a closing square bracket.");var i=s.split(/((?:[*~^$|]?=))([^]*)/),o=i[0].split(/(\|)/g),u={operator:i[1],value:i[2],source:{start:{line:n[2],column:n[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:n[4]};if(o.length>1?(o[0]===""&&(o[0]=!0),u.attribute=this.parseValue(o[2]),u.namespace=this.parseNamespace(o[0])):u.attribute=this.parseValue(i[0]),r=new jm.default(u),i[2]){var a=i[2].split(/(\s+i\s*?)$/),c=a[0].trim();r.value=this.lossy?c:a[0],a[1]&&(r.insensitive=!0,this.lossy||(r.raws.insensitive=a[1])),r.quoted=c[0]==="'"||c[0]==='"',r.raws.unquoted=r.quoted?c.slice(1,-1):c}this.newNode(r),this.position++},t.prototype.combinator=function(){if(this.currToken[1]==="|")return this.namespace();for(var s=new Xm.default({value:"",source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]});this.position<this.tokens.length&&this.currToken&&(this.currToken[0]==="space"||this.currToken[0]==="combinator");)this.nextToken&&this.nextToken[0]==="combinator"?(s.spaces.before=this.parseSpace(this.currToken[1]),s.source.start.line=this.nextToken[2],s.source.start.column=this.nextToken[3],s.source.end.column=this.nextToken[3],s.source.end.line=this.nextToken[2],s.sourceIndex=this.nextToken[4]):this.prevToken&&this.prevToken[0]==="combinator"?s.spaces.after=this.parseSpace(this.currToken[1]):this.currToken[0]==="combinator"?s.value=this.currToken[1]:this.currToken[0]==="space"&&(s.value=this.parseSpace(this.currToken[1]," ")),this.position++;return this.newNode(s)},t.prototype.comma=function(){if(this.position===this.tokens.length-1){this.root.trailingComma=!0,this.position++;return}var s=new sn.default;this.current.parent.append(s),this.current=s,this.position++},t.prototype.comment=function(){var s=new Mm.default({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]});this.newNode(s),this.position++},t.prototype.error=function(s){throw new this.input.error(s)},t.prototype.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.")},t.prototype.missingParenthesis=function(){return this.error("Expected opening parenthesis.")},t.prototype.missingSquareBracket=function(){return this.error("Expected opening square bracket.")},t.prototype.namespace=function(){var s=this.prevToken&&this.prevToken[1]||!0;if(this.nextToken[0]==="word")return this.position++,this.word(s);if(this.nextToken[0]==="*")return this.position++,this.universal(s)},t.prototype.nesting=function(){this.newNode(new Zm.default({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]})),this.position++},t.prototype.parentheses=function(){var s=this.current.last;if(s&&s.type===ny.PSEUDO){var r=new sn.default,n=this.current;s.append(r),this.current=r;var i=1;for(this.position++;this.position<this.tokens.length&&i;)this.currToken[0]==="("&&i++,this.currToken[0]===")"&&i--,i?this.parse():(r.parent.source.end.line=this.currToken[2],r.parent.source.end.columnLine truncated
`?(r=1,n+=1):r+=1;return{line:n,column:r}}positionBy(e){let s=this.source.start;if(Object(e).index)s=this.positionInside(e.index);else if(Object(e).word){let r=this.toString().indexOf(e.word);r!==-1&&(s=this.positionInside(r))}return s}}});var U=w((hb,Du)=>{"use strict";var my=j(),He=class extends my{constructor(e){super(e),this.nodes||(this.nodes=[])}push(e){return e.parent=this,this.nodes.push(e),this}each(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let s=this.lastEach,r,n;if(this.indexes[s]=0,!!this.nodes){for(;this.indexes[s]<this.nodes.length&&(r=this.indexes[s],n=e(this.nodes[r],r),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}}walk(e){return this.each((s,r)=>{let n=e(s,r);return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkType(e,s){if(!e||!s)throw new Error("Parameters {type} and {callback} are required.");let r=typeof e=="function";return this.walk((n,i)=>{if(r&&n instanceof e||!r&&n.type===e)return s.call(this,n,i)})}append(e){return e.parent=this,this.nodes.push(e),this}prepend(e){return e.parent=this,this.nodes.unshift(e),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}insertAfter(e,s){let r=this.index(e),n;this.nodes.splice(r+1,0,s);for(let i in this.indexes)n=this.indexes[i],r<=n&&(this.indexes[i]=n+this.nodes.length);return this}insertBefore(e,s){let r=this.index(e),n;this.nodes.splice(r,0,s);for(let i in this.indexes)n=this.indexes[i],r<=n&&(this.indexes[i]=n+this.nodes.length);return this}removeChild(e){e=this.index(e),this.nodes[e].parent=void 0,this.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this}removeAll(){for(let e of this.nodes)e.parent=void 0;return this.nodes=[],this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return typeof e=="number"?e:this.nodes.indexOf(e)}get first(){if(this.nodes)return this.nodes[0]}get last(){if(this.nodes)return this.nodes[this.nodes.length-1]}toString(){let e=this.nodes.map(String).join("");return this.value&&(e=this.value+e),this.raws.before&&(e=this.raws.before+e),this.raws.after&&(e+=this.raws.after),e}};He.registerWalker=t=>{let e="walk"+t.name;e.lastIndexOf("s")!==e.length-1&&(e+="s"),!He.prototype[e]&&(He.prototype[e]=function(s){return this.walkType(t,s)})};Du.exports=He});var Bu=w((mb,Mu)=>{"use strict";var yy=U();Mu.exports=class extends yy{constructor(e){super(e),this.type="root"}}});var Fu=w((gb,Uu)=>{"use strict";var gy=U();Uu.exports=class extends gy{constructor(e){super(e),this.type="value",this.unbalanced=0}}});var Gu=w((wb,$u)=>{"use strict";var Wu=U(),Dr=class extends Wu{constructor(e){super(e),this.type="atword"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,"@",String.prototype.toString.call(this.value),this.raws.after].join("")}};Wu.registerWalker(Dr);$u.exports=Dr});var Vu=w((vb,Yu)=>{"use strict";var wy=U(),vy=j(),Mr=class extends vy{constructor(e){super(e),this.type="colon"}};wy.registerWalker(Mr);Yu.exports=Mr});var ju=w((xb,zu)=>{"use strict";var xy=U(),_y=j(),Br=class extends _y{constructor(e){super(e),this.type="comma"}};xy.registerWalker(Br);zu.exports=Br});var Qu=w((_b,Hu)=>{"use strict";var by=U(),Ey=j(),Ur=class extends Ey{constructor(e){super(e),this.type="comment",this.inline=Object(e).inline||!1}toString(){return[this.raws.before,this.inline?"//":"/*",String(this.value),this.inline?"":"*/",this.raws.after].join("")}};by.registerWalker(Ur);Hu.exports=Ur});var Ju=w((bb,Xu)=>{"use strict";var Ku=U(),Fr=class extends Ku{constructor(e){super(e),this.type="func",this.unbalanced=-1}};Ku.registerWalker(Fr);Xu.exports=Fr});var el=w((Eb,Zu)=>{"use strict";var Sy=U(),Ty=j(),Wr=class extends Ty{constructor(e){super(e),this.type="number",this.unit=Object(e).unit||""}toString(){return[this.raws.before,String(this.value),this.unit,this.raws.after].join("")}};Sy.registerWalker(Wr);Zu.exports=Wr});var rl=w((Sb,tl)=>{"use strict";var ky=U(),Oy=j(),$r=class extends Oy{constructor(e){super(e),this.type="operator"}};ky.registerWalker($r);tl.exports=$r});var nl=w((Tb,sl)=>{"use strict";var Ay=U(),Cy=j(),Gr=class extends Cy{constructor(e){super(e),this.type="paren",this.parenType=""}};Ay.registerWalker(Gr);sl.exports=Gr});var ol=w((kb,il)=>{"use strict";var Ny=U(),Py=j(),Yr=class extends Py{constructor(e){super(e),this.type="string"}toString(){let e=this.quoted?this.raws.quote:"";return[this.raws.before,e,this.value+"",e,this.raws.after].join("")}};Ny.registerWalker(Yr);il.exports=Yr});var ul=w((Ob,al)=>{"use strict";var Ry=U(),Iy=j(),Vr=class extends Iy{constructor(e){super(e),this.type="word"}};Ry.registerWalker(Vr);al.exports=Vr});var cl=w((Ab,ll)=>{"use strict";var Ly=U(),qy=j(),zr=class extends qy{constructor(e){super(e),this.type="unicode-range"}};Ly.registerWalker(zr);ll.exports=zr});var pl=w((Cb,fl)=>{"use strict";var on=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred whLine truncated
`,a+2);l=S!==-1?S-1:i}p=n.slice(a,l+1),x=p.split(`
`),d=x.length-1,d>0?(g=u+d,v=l-x[d].length):(g=u,v=o),r.push(["comment",p,u,a-o,g,l-v,a]),o=v,u=g,a=l}else if(h===35&&!My.test(n.slice(a+1,a+2)))l=a+1,r.push(["#",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;else if((h===117||h===85)&&n.charCodeAt(a+1)===43){l=a+2;do l+=1,h=n.charCodeAt(l);while(l<i&&By.test(n.slice(l,l+1)));r.push(["unicoderange",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1}else if(h===47)l=a+1,r.push(["operator",n.slice(a,l),u,a-o,u,l-o,a]),a=l-1;else{let b=Dy;if(h>=48&&h<=57&&(b=Qe),b.lastIndex=a+1,b.test(n),b.lastIndex===0?l=n.length-1:l=b.lastIndex-2,b===Qe||h===46){let S=n.charCodeAt(l),fn=n.charCodeAt(l+1),pn=n.charCodeAt(l+2);(S===101||S===69)&&(fn===45||fn===43)&&pn>=48&&pn<=57&&(Qe.lastIndex=l+2,Qe.test(n),Qe.lastIndex===0?l=n.length-1:l=Qe.lastIndex-2)}r.push(["word",n.slice(a,l+1),u,a-o,u,l-o,a]),a=l}break}a++}return r}});var gl=w((Pb,yl)=>{"use strict";var an=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while parsing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};yl.exports=an});var _l=w((Ib,xl)=>{"use strict";var Uy=Bu(),Fy=Fu(),Wy=Gu(),$y=Vu(),Gy=ju(),Yy=Qu(),Vy=Ju(),zy=el(),jy=rl(),wl=nl(),Hy=ol(),vl=ul(),Qy=cl(),Ky=ml(),Xy=Hs(),Jy=Qs(),Zy=Ks(),eg=gl();function tg(t){return t.sort((e,s)=>e-s)}xl.exports=class{constructor(e,s){let r={loose:!1};this.cache=[],this.input=e,this.options=Object.assign({},r,s),this.position=0,this.unbalanced=0,this.root=new Uy;let n=new Fy;this.root.append(n),this.current=n,this.tokens=Ky(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new $y({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comma(){let e=this.currToken;this.newNode(new Gy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comment(){let e=!1,s=this.currToken[1].replace(/\/\*|\*\//g,""),r;this.options.loose&&s.startsWith("//")&&(s=s.substring(2),e=!0),r=new Yy({value:s,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]}),this.newNode(r),this.position++}error(e,s){throw new eg(e+` at line: ${s[2]}, column ${s[3]}`)}loop(){for(;this.position<this.tokens.length;)this.parseTokens();return!this.current.last&&this.spaces?this.current.raws.before+=this.spaces:this.spaces&&(this.current.last.raws.after+=this.spaces),this.spaces="",this.root}operator(){let e=this.currToken[1],s;if(e==="+"||e==="-"){if(this.options.loose||this.position>0&&(this.current.type==="func"&&this.current.value==="calc"?this.prevToken[0]!=="space"&&this.prevToken[0]!=="("?this.error("Syntax Error",this.currToken):this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"?this.error("Syntax Error",this.currToken):this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("&&this.error("Syntax Error",this.currToken):(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator")&&this.error("Syntax Error",this.currToken)),this.options.loose){if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word")return this.word()}else if(this.nextToken[0]==="word")return this.word()}return s=new jy({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),this.position++,this.newNode(s)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,s=this.position+1,r=this.currToken,n;for(;s<this.tokens.length&&e;){let i=this.tokens[s];i[0]==="("&&e++,i[0]===")"&&e--,s++}if(e&&this.error("Expected closing parenthesis",r),n=this.current.last,n&&n.type==="func"&&n.unbalanced<0&&(n.unbalanced=0,this.current=n),this.current.unbalanced++,this.newNode(new wl({value:r[1],source:{start:{line:r[2],column:r[3]},end:{line:r[4],column:r[5]}},sourceIndex:r[6]})),this.position++,this.current.type==="func"&&this.current.unbalanced&&this.current.value==="url"&&this.currToken[0]!=="string"&&this.currToken[0]!==")"&&!this.options.loose){let i=this.nextToken,o=this.currToken[1],u={line:this.currToken[2],column:this.currToken[3]};for(;i&&i[0]!==")"&&this.current.unbalanced;)this.position++,o+=this.currToken[1],i=this.nextToken;this.position!==this.tokens.length-1&&(this.position++,this.newNode(new vl({value:o,source:{start:u,end:{line:this.currToken[4],column:this.cuLine truncated
Expected it to be 'string' or 'object'.`;if(ae(t))throw new Error("doc is valid.");let s=Object.prototype.toString.call(t);if(s!=="[object Object]")return`Unexpected doc '${s}'.`;let r=Kl([...Pt].map(n=>`'${n}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${r}.`}var Kr=class extends Error{name="InvalidDocError";constructor(e){super(Xl(e)),this.doc=e}},yn=Kr;function gn(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){return mn(s,i,n)}function n(i){switch(ae(i)){case Xe:return e(i.map(r));case oe:return e({...i,parts:i.parts.map(r)});case ge:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case ie:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case Pe:case ne:case Ct:case Nt:case Re:return e({...i,contents:r(i.contents)});case Ke:case Ot:case At:case Ie:case H:case Le:return e(i);default:throw new yn(i)}}}function Jl(t){return t.type===H&&!t.hard?t.soft?"":" ":t.type===ge?t.flatContents:t}function wn(t){return gn(t,Jl)}function vn(t,e=xn){return gn(t,s=>typeof s=="string"?Y(e,s.split(`
`)):s)}var F=G,we=G,_n=G,bn=G;function R(t){return F(t),{type:ne,contents:t}}function Zl(t,e){return bn(t),F(e),{type:Pe,contents:e,n:t}}function ue(t){return Zl(-1,t)}var ve={type:Le};function qe(t){return _n(t),{type:oe,parts:t}}function D(t,e={}){return F(t),we(e.expandedStates,!0),{type:ie,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Rt(t,e="",s={}){return F(t),e!==""&&F(e),{type:ge,breakContents:t,flatContents:e,groupId:s.groupId}}function Y(t,e){F(t),we(e);let s=[];for(let r=0;r<e.length;r++)r!==0&&s.push(t),s.push(e[r]);return s}var A={type:H},I={type:H,soft:!0},ec={type:H,hard:!0},O=[ec,ve],Xr={type:H,hard:!0,literal:!0},xn=[Xr,ve];function It(t){return F(t),{type:Re,contents:t}}var Lt={type:Ie};function tc(t){return Array.isArray(t)&&t.length>0}var le=tc;var Sn=Object.freeze({character:"'",codePoint:39}),Tn=Object.freeze({character:'"',codePoint:34}),rc=Object.freeze({preferred:Sn,alternate:Tn}),sc=Object.freeze({preferred:Tn,alternate:Sn});function kn(t,e){let{preferred:s,alternate:r}=e===!0||e==="'"?rc:sc,{length:n}=t,i=0,o=0;for(let u=0;u<n;u++){let a=t.charCodeAt(u);a===s.codePoint?i++:a===r.codePoint&&o++}return(i>o?r:s).character}var nc=/\\(["'\\])|(["'])/g;function ic(t,e){let s=e==='"'?"'":'"',r=T(0,t,nc,(n,i,o)=>i?i===s?s:n:o===e?"\\"+o:o);return e+r+e}var An=ic;function oc(t,e){G(/^(?<quote>["']).*\k<quote>$/s.test(t));let s=t.slice(1,-1),r;return e.parser==="json"||e.parser==="jsonc"||e.parser==="json-stringify"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?r='"':e.__isInHtmlAttribute?r="'":r=kn(s,e.singleQuote),t.charAt(0)===r?t:An(s,r)}var qt=oc;var Zr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},Cn=Zr;function Nn(){}Nn.getVisitorKeys=t=>t.type==="css-root"?["frontMatter"]:[];var Pn=Nn;var Je=null;function Ze(t){if(Je!==null&&typeof Je.property){let e=Je;return Je=Ze.prototype=null,e}return Je=Ze.prototype=t??Object.create(null),new Ze}var ac=10;for(let t=0;t<=ac;t++)Ze();function es(t){return Ze(t)}function uc(t,e="type"){es(t);function s(r){let n=r[e],i=t[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:r});return i}return s}var Rn=uc;var Q=[["nodes"],["group"]],In={"css-root":["frontMatter","nodes"],"css-comment":[],"css-rule":["selector","nodes"],"css-decl":["value","selector","nodes"],"css-atrule":["selector","params","value","nodes"],"media-query-list":Q[0],"media-query":Q[0],"media-type":[],"media-feature-expression":Q[0],"media-feature":[],"media-colon":[],"media-value":[],"media-keyword":[],"media-url":[],"media-unknown":[],"selector-root":Q[0],"selector-selector":Q[0],"selector-comment":[],"selector-string":[],"selector-tag":[],"selector-id":[],"selector-class":[],"selector-attribute":[],"selector-combinator":Q[0],"selector-universal":[],"selector-pseudo":Q[0],"selector-nesting":[],"selector-unknown":[],"value-value":Q[1],"value-root":Q[1],"value-comment":[],"value-comma_group":["groups"],"value-paren_group":["open","groups","close"],"value-func":Q[1],"value-paren":[],"value-number":[],"value-operator":[],"value-word":[],"value-colon":[],"value-comma":[],"value-string":[],"value-atword":[],"value-unicode-range":[],"value-unknown":[]};var lc=Rn(In),Ln=lc;function cc(t,e){let s=0;for(let r=0;r<t.line-1;++r)s=e.indexOf(`
`,s)+1;return s+t.column}var ts=cc;function Dt(t){return(e,s,r)=>{if(s===!1)return!1;let n=!!r?.backwards,{length:i}=e,o=s;for(;o>=0&&o<i;){let u=e.charAt(o);if(t instanceof RegExp){if(!t.test(u))return o}else if(!t.includes(u))return o;n?o--:o++}return o===-1||o===i?o:!1}}var Xw=Dt(/\s/),Mt=Dt(" "),qn=Dt(",; "),Bt=Dt(/[^\n\r]/);function Dn(t,e){let{value:s}=t;return s==="-"||s==="--"||s.charAt(0)!=="-"?e:e-(s.charAt(1)==="-"?2:1)}function Mn(t,e){if(typeof t.source?.start?.offset=="number")return t.source.start.offset;if(typeof t.sourceIndex=="number")return t.type==="value-word"?Dn(t,t.sourceIndex):t.sourceIndex;if(t.source?.start)return ts(t.source.start,e);throw Object.assign(new Error("Can not locate node."),{node:t})}function Bn(t,e){if(t.type==="css-comment"&&t.inline)return Bt(e,t.source.startOffset);if(t.type==="value-paren"&&typeof t.sourceIndex=="number")return t.sourceIndex+(t.value===")"?t.value.length:0);if(typeof t.source?.end?.offset=="number")return t.source.end.offset;if(t.source){if(t.source.end){let s=ts(t.source.end,e);return t.type==="value-word"?Dn(t,s):s}if(le(t.nodes))return Bn($(0,t.nodes,-1),e);if(t.type==="css-atrule"&&typeof t.name=="string")return Mn(t,e)+1+t.name.length+t.raws.afterName.length+t.raws.params.length}return typeof t.sourceIndex=="number"&&typeof t.value=="string"?t.sourceIndex+t.value.length:null}function Un(t,e){ss(t,e,0,!1)}function ss(t,e,s,r){if(r&&typeof t.type=="string")t.source??(t.source={}),t.source.startOffset=s,t.source.endOffset=s+e.length;else if(!(typeof t.source?.startOffset=="number"&&typeof t.source?.endOffset=="number")){if(t.source||typeof t.sourceIndex=="number"){t.source??(t.source={});let n=s+e.length;t.source.startOffset=Math.min(Mn(t,e)+s,n);let i=Bn(t,e);t.source.endOffset=typeof i=="number"?Math.min(i+s,n):i}}for(let n in t){let i=t[n];if(n==="source"||!i||typeof i!="object")continue;let o=Array.isArray(i)?i:[i];for(let u of o){if(!u||typeof u!="object")continue;let a=fc(t,u,s);a?ss(u,a.text,a.rootOffset,!0):ss(u,e,s,!1),$n(u,t)}}dc(t),mc(t)}function fc(t,e,s){if(e.type==="value-root"||e.type==="value-unknown")return{rootOffset:Fn(t),text:e.text||e.value||""};if(e.type==="media-query-list"||t.params===e)return{rootOffset:Wn(t),text:t.raws?.params||e.value||""};if(e.type?.startsWith("selector-")){let r=pc(t,e);if(typeof r=="string")return{rootOffset:hc(t,e,r,s),text:r}}}function Fn(t){let e=t.source.startOffset;return typeof t.prop=="string"&&(e+=t.prop.length),t.type==="css-atrule"&&typeof t.name=="string"&&(e+=1+t.name.length+t.raws.afterName.match(/^\s*:?\s*/)[0].length),t.type!=="css-atrule"&&typeof t.raws?.between=="string"&&(e+=t.raws.between.length),e}function Wn(t){let e=t.source.startOffset;return t.type==="css-atrule"&&typeof t.name=="string"&&(e+=1+t.name.length+t.raws.afterName.match(/^\s*:?\s*/)[0].length),e}function pc(t,e){if(typeof e.raws?.selector=="string")return e.raws.selector;if(t.selector===e){if(t.mixin)return t.raws.identifier+t.name+t.raws.afterName+t.raws.params;if(typeof t.raws?.selector=="string")return t.raws.selector;if(t.customSelector&&typeof t.raws?.params=="string")return t.raws.params.slice(t.customSelector.length).trim();if(typeof t.raws?.params=="string")return t.raws.params;if(t.type==="css-decl"&&typeof t.raws?.value=="string"){let{value:s}=t.raws;return t.extend&&s.startsWith("extend(")?s.slice(7,-1):s}}}function hc(t,e,s,r){return typeof e.sourceIndex=="number"&&typeof e.raws?.selector=="string"?r+e.sourceIndex:t.mixin?t.source.startOffset:typeof t.raws?.selector=="string"?t.source.startOffset+rs(t.raws.selector,s):typeof t.raws?.params=="string"?Wn(t)+rs(t.raws.params,s):t.type==="css-decl"&&typeof t.raws?.value=="string"?Fn(t)+rs(t.raws.value,s):r}function rs(t,e){let s=t.indexOf(e);return s===-1?0:s}function dc(t){var u,a;if(typeof t.type!="string")return;let e=typeof t.source?.startOffset=="number"&&typeof t.source?.endOffset=="number",s=t.source?.start&&t.source.end;if(e&&s)return;let r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i,o;for(let c in t){if(c==="source"||c==="raws"||c==="spaces")continue;let f=t[c],h=Array.isArray(f)?f:[f];for(let l of h)!l||typeof l!="object"||typeof l.source?.startOffset!="number"||typeof l.source?.endOffset!="number"||(l.source.startOffset<r&&(r=l.source.startOffset,i=l.source.start),l.source.endOffset>n&&(n=l.source.endOffset,o=l.source.end))}r!==Number.POSITIVE_INFINITY&&(t.source??(t.source={}),e||(t.source.startOffset=r,t.source.endOffset=n),(u=t.source).start??(u.start=i),(a=t.source).end??(a.end=o))}function $n(t,e){typeof t.type!="string"||t.source||typeof e.source?.startOffset!="number"||typeof e.source?.endOffset!="number"||!yc(t)||(t.source={startOffset:e.source.startOffset,endOffset:e.source.startOffset,start:e.source.start,end:e.source.start})}function mc(t){if(!(typeof t.source?.startOffset!="number"||typeof t.source?.endOffset!="number"))for(let e in t){if(e==="source"||e==="raws"||e==="spaces")continue;let s=t[e],r=Array.isArray(s)?s:[sLine truncated
`||u==="\r")return t;continue;case"double-quotes":if(u==='"'&&t[o-1]!=="\\"&&(e=s,s="initial"),u===`
`||u==="\r")return t;continue;case"url":if(u===")")e="initial";else if(u===`
`||u==="\r")return t;if(u==="'"){e="single-quotes",s="url";continue}if(u==='"'){e="double-quotes",s="url";continue}continue;case"comment-block":u==="/"&&t[o-1]==="*"&&(e="initial");continue;case"comment-inline":u==='"'||u==="'"||u==="*"?n=!0:(u===`
`||u==="\r")&&(n&&i.push([r,o]),e="initial",n=!1);continue}}for(let[o,u]of i)t=t.slice(0,o)+T(0,t.slice(o,u),/["'*]/g," ")+t.slice(u);return t}var N=t=>t.source.startOffset,P=t=>t.source.endOffset;var Ut=Symbol.for("PRETTIER_IS_FRONT_MATTER");function gc(t){return!!t?.[Ut]}var De=gc;function wc(t){return T(0,t,/[^\n]/g," ")}var Ft=wc;var et=3;function vc(t){let e=t.slice(0,et);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(`
`,et);if(s===-1)return;let r=t.slice(et,s).trim(),n=t.indexOf(`
${e}`,s),i=r;if(i||(i=e==="+++"?"toml":"yaml"),n===-1&&e==="---"&&i==="yaml"&&(n=t.indexOf(`
...`,s)),n===-1)return;let o=n+1+et,u=t.charAt(o+1);if(!/\s?/.test(u))return;let a=t.slice(0,o),c;return{language:i,explicitLanguage:r||null,value:t.slice(s+1,n),startDelimiter:e,endDelimiter:a.slice(-et),raw:a,start:{line:1,column:0,index:0},end:{index:a.length,get line(){return c??(c=a.split(`
`)),c.length},get column(){return c??(c=a.split(`
`)),$(0,c,-1).length}},[Ut]:!0}}function xc(t){let e=vc(t);return e?{frontMatter:e,get content(){let{raw:s}=e;return Ft(s)+t.slice(s.length)}}:{content:t}}var xe=xc;var _c=new Set(["raw","raws","sourceIndex","source","before","after","trailingComma","spaces"]);function ns(t,e,s){if(t.type==="css-comment"&&s.type==="css-root"&&s.nodes.length>0&&((s.nodes[0]===t||De(s.nodes[0])&&s.nodes[1]===t)&&(delete e.text,/^\*\s*@(?:format|prettier)\s*$/.test(t.text))||s.type==="css-root"&&$(0,s.nodes,-1)===t))return null;if(t.type==="value-root"&&delete e.text,(t.type==="media-query"||t.type==="media-query-list"||t.type==="media-feature-expression")&&delete e.value,t.type==="css-rule"&&(delete e.params,t.extend&&Ec(t.selector)&&delete e.extend),(t.type==="media-feature"||t.type==="media-keyword"||t.type==="media-type"||t.type==="media-unknown"||t.type==="media-url"||t.type==="media-value"||t.type==="selector-attribute"||t.type==="selector-string"||t.type==="selector-class"||t.type==="selector-combinator"||t.type==="value-string")&&t.value&&(e.value=bc(t.value)),t.type==="selector-combinator"&&(e.value=T(0,e.value,/\s+/g," ")),t.type==="media-feature"&&(e.value=T(0,e.value," ","")),(t.type==="value-word"&&(t.isColor&&t.isHex||["initial","inherit","unset","revert"].includes(t.value.toLowerCase()))||t.type==="media-feature"||t.type==="selector-root-invalid"||t.type==="selector-pseudo")&&(e.value=e.value.toLowerCase()),t.type==="css-decl"&&(e.prop=t.prop.toLowerCase()),(t.type==="css-atrule"||t.type==="css-import")&&(e.name=t.name.toLowerCase()),t.type==="value-number"&&(e.unit=t.unit.toLowerCase()),t.type==="value-unknown"&&(e.value=T(0,e.value,/;$/g,"")),t.type==="selector-attribute"&&(e.attribute=t.attribute.trim(),t.namespace&&typeof t.namespace=="string"&&(e.namespace=t.namespace.trim()||!0),t.value)){let{value:r}=e;/\s[a-z]$/i.test(r)&&(e.__prettier_attribute_selector_flag=$(0,r,-1),r=r.slice(0,-1)),r=r.trim(),r=r.replace(/^(?<quote>["'])(?<value>.*?)\k<quote>$/,"$<value>"),e.value=r,delete e.quoted}if((t.type==="media-value"||t.type==="media-type"||t.type==="value-number"||t.type==="selector-root-invalid"||t.type==="selector-class"||t.type==="selector-combinator"||t.type==="selector-tag")&&t.value&&(e.value=T(0,e.value,/([\d+.e-]+)([a-z]*)/gi,(r,n,i)=>{let o=Number(n);return Number.isNaN(o)?r:o+i.toLowerCase()})),t.type==="selector-tag"){let r=e.value.toLowerCase();["from","to"].includes(r)&&(e.value=r)}if(t.type==="css-atrule"&&t.name.toLowerCase()==="supports"&&delete e.value,t.type==="selector-unknown"&&delete e.value,t.type==="value-comma_group"){let r=t.groups.findIndex(n=>n.type==="value-number"&&n.unit==="...");r!==-1&&(e.groups[r].unit="",e.groups.splice(r+1,0,{type:"value-word",value:"...",isColor:!1,isHex:!1}))}if(t.type==="value-comma_group"&&t.groups.some(r=>r.type==="value-atword"&&(r.value.endsWith("[")||r.value.endsWith("]"))||r.type==="value-word"&&(r.value.startsWith("]")||r.value.startsWith("["))))return{type:"value-atword",value:t.groups.map(r=>r.value).join("")};if(t.type==="value-func"&&t.value==="if"&&t.group.type==="value-paren_group"&&t.group.groups.length===1&&t.group.groups[0].type==="value-comma_group"){let r=t.group.groups[0].groups,n=e.group.groups[0].groups;for(let i=r.length-1;i>=0;i--){let o=r[i];if(o.type==="value-word"&&typeof o.value=="string"&&o.value.endsWith(";")){if(o.value===";"){r[i-1]?.type==="value-number"&&n.splice(i-1,2,{type:"#node-placeholder"});continue}n[i]={type:"#node-placeholder"}}}}}ns.ignoredProperties=_c;function bc(t){return T(0,T(0,t,"'",'"'),/\\([^\da-f])/gi,"$1")}function Ec(t){return t?.nodes?.some(e=>e.nodes?.some(s=>s.type==="selector-pseudo"&&s.value===":extend"))}var Sc=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),is=Sc;var Tc=/\*\/$/,kc=/^\/\*\*?/,jn=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Oc=/(^|\s+)\/\/([^\n\r]*)/g,Yn=/^(\r?\n)+/,Ac=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Vn=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,Cc=/(\r?\n|^) *\* ?/g,Hn=[];function Qn(t){let e=t.match(jn);return e?e[0].trimStart():""}function Kn(t){let s=t.match(jn)?.[0];return s==null?t:t.slice(s.length)}function Xn(t){t=T(0,t.replace(kc,"").replace(Tc,""),Cc,"$1");let s="";for(;s!==t;)s=t,t=T(0,t,Ac,`
$1 $2
`);t=t.replace(Yn,"").trimEnd();let r=Object.create(null),n=T(0,t,Vn,"").replace(Yn,"").trimEnd(),i;for(;i=Vn.exec(t);){let o=T(0,i[2],Oc,"");if(typeof r[i[1]]=="string"||Array.isArray(r[i[1]])){let u=r[i[1]];r[i[1]]=[...Hn,...Array.isArray(u)?u:[u],o]}else r[i[1]]=o}return{comments:n,pragmas:r}}function Jn({comments:t="",pragmas:e={}}){let o=Object.keys(e),u=o.flatMap(c=>zn(c,e[c])).map(c=>` * ${c}
`).join("");if(!t){if(o.length===0)return"";if(o.length===1&&!Array.isArray(e[o[0]])){let c=e[o[0]];return`/** ${zn(o[0],c)[0]} */`}}let a=t.split(`
`).map(c=>` * ${c}`).join(`
`)+`
`;return`/**
`+(t?a:"")+(t&&o.length>0?` *
`:"")+u+" */"}function zn(t,e){return[...Hn,...Array.isArray(e)?e:[e]].map(s=>`@${t} ${s}`.trim())}var Zn=["noformat","noprettier"],ei=["format","prettier"],ti="format";function Nc(t){if(!t.startsWith("#!"))return"";let e=t.indexOf(`
`);return e===-1?t:t.slice(0,e)}var ri=Nc;function os(t){let e=ri(t);e&&(t=t.slice(e.length+1));let s=Qn(t),{pragmas:r,comments:n}=Xn(s);return{shebang:e,text:t,pragmas:r,comments:n}}function si(t){let{pragmas:e}=os(t);return ei.some(s=>is(e,s))}function ni(t){let{pragmas:e}=os(t);return Zn.some(s=>is(e,s))}function ii(t){let{shebang:e,text:s,pragmas:r,comments:n}=os(t),i=Kn(s),o=Jn({pragmas:{[ti]:"",...r},comments:n.trimStart()});return(e?`${e}
`:"")+o+(i.startsWith(`
`)?`
`:`
`)+i}var oi=t=>si(xe(t).content),ai=t=>ni(xe(t).content),ui=t=>{let{frontMatter:e,content:s}=xe(t);return(e?e.raw+`
`:"")+ii(s)};var Pc=new Set(["red","green","blue","alpha","a","rgb","hue","h","saturation","s","lightness","l","whiteness","w","blackness","b","tint","shade","blend","blenda","contrast","hsl","hsla","hwb","hwba"]);function li(t){return t.findAncestor(e=>e.type==="css-decl")?.prop?.toLowerCase()}var Rc=new Set(["initial","inherit","unset","revert"]);function ci(t){return Rc.has(t.toLowerCase())}function fi(t,e){return t.findAncestor(r=>r.type==="css-atrule")?.name?.toLowerCase().endsWith("keyframes")&&["from","to"].includes(e.toLowerCase())}function Me(t){return t.includes("$")||t.includes("@")||t.includes("#")||t.startsWith("%")||t.startsWith("--")||t.startsWith(":--")||t.includes("(")&&t.includes(")")?t:t.toLowerCase()}function _e(t,e){return t.findAncestor(r=>r.type==="value-func")?.value?.toLowerCase()===e}function pi(t){return t.hasAncestor(e=>{if(e.type!=="css-rule")return!1;let s=e.raws?.selector;return s&&(s.startsWith(":import")||s.startsWith(":export"))})}function be(t,e){let s=Array.isArray(e)?e:[e],r=t.findAncestor(n=>n.type==="css-atrule");return r&&s.includes(r.name.toLowerCase())}function hi(t){let{node:e}=t;return e.groups[0]?.value==="url"&&e.groups.length===2&&t.findAncestor(s=>s.type==="css-atrule")?.name==="import"}function di(t){return t.type==="value-func"&&t.value.toLowerCase()==="url"}function mi(t){return t.type==="value-func"&&t.value.toLowerCase()==="var"}function yi(t){let{selector:e}=t;return e?typeof e=="string"&&/^@.+:.*$/.test(e)||e.value&&/^@.+:.*$/.test(e.value):!1}function gi(t){return t.type==="value-word"&&["from","through","end"].includes(t.value)}function wi(t){return t.type==="value-word"&&["and","or","not"].includes(t.value)}function vi(t){return t.type==="value-word"&&t.value==="in"}function Wt(t){return t.type==="value-operator"&&t.value==="*"}function Ee(t){return t?.type==="value-operator"&&t.value==="/"}function K(t){return t.type==="value-operator"&&t.value==="+"}function Se(t){return t.type==="value-operator"&&t.value==="-"}function Ic(t){return t.type==="value-operator"&&t.value==="%"}function tt(t){return Wt(t)||Ee(t)||K(t)||Se(t)||Ic(t)}function xi(t){return t.type==="value-word"&&["==","!="].includes(t.value)}function _i(t){return t.type==="value-word"&&["<",">","<=",">="].includes(t.value)}function rt(t,e){return e.parser==="scss"&&t.type==="css-atrule"&&["if","else","for","each","while"].includes(t.name)}function us(t){return t.raws?.params&&/^\(\s*\)$/.test(t.raws.params)}function $t(t){return t.name.startsWith("prettier-placeholder")}function bi(t){return t.prop.startsWith("@prettier-placeholder")}function Ei(t,e){return t.value==="$$"&&t.type==="value-func"&&e?.type==="value-word"&&!e.raws.before}function Si(t){return t.value?.type==="value-root"&&t.value.group?.type==="value-value"&&t.prop.toLowerCase()==="composes"}function Ti(t){return t.value?.group?.group?.type==="value-paren_group"&&t.value.group.group.open!==null&&t.value.group.group.close!==null}function X(t){return t?.raws?.before===""}function Gt(t){return t.type==="value-comma_group"&&t.groups?.[1]?.type==="value-colon"}function as(t){return t.type==="value-paren_group"&&t.groups?.[0]&&Gt(t.groups[0])}function ls(t,e){if(e.parser!=="scss")return!1;let{node:s}=t;if(s.groups.length===0||s.type==="value-paren_group"&&s.open&&s.close&&s.groups.length===1&&s.groups[0].type!=="value-comma_group")return!1;let r=t.parent;if(r&&r.type==="value-func"&&r.value==="if")return!1;let n=t.grandparent;return!as(s)&&!(n&&as(n))?!1:t.findAncestor(o=>o.type==="css-decl")?.prop?.startsWith("$")?!0:as(n)?!r.groups.some(o=>tt(o)):n.type==="value-func"}function st(t){return t.type==="value-comment"&&t.inline}function Yt(t){return t.type==="value-word"&&t.value==="#"}function cs(t){return t.type==="value-word"&&t.value==="{"}function Vt(t){return t.type==="value-word"&&t.value==="}"}function nt(t){return["value-word","value-atword"].includes(t.type)}function zt(t){return t?.type==="value-colon"}function ki(t,e){if(!Gt(e))return!1;let{groups:s}=e,r=s.indexOf(t);return r===-1?!1:zt(s[r+1])}function Oi(t){return t.value&&["not","and","or"].includes(t.value.toLowerCase())}function Ai(t){return t.type!=="value-func"?!1:Pc.has(t.value.toLowerCase())}function Be(t){return/\/\//.test(t.split(/[\n\r]/).pop())}function ce(t){return t?.type==="value-atword"&&t.value.startsWith("prettier-placeholder-")}function Ci(t,e){if(t.open?.value!=="("||t.close?.value!==")"||t.groups.some(s=>s.type!=="value-comma_group"))return!1;if(e.type==="value-comma_group"){let s=e.groups.indexOf(t)-1,r=e.groups[s];if(r?.type==="value-word"&&r.value==="with")return!0}return!1}function it(t){return t.type==="value-paren_group"&&t.open?.value==="("&&t.close?.value===")"}function Lc(t,e,s){let{node:r}=t,n=t.parent,i=t.grandparent,o=li(t),u=o&&n.type==="value-value"&&(o==="grid"||o.startsWith("grid-template")),a=t.findAncestor(p=>p.type==="css-atrule"),c=a&&rt(a,e),f=r.groups.some(p=>st(p)),h=t.map(s,"groups"),l=[""],m=_e(t,"url"),x=!1,d=!1;for(let p=0;Line truncated
`||t==="\r"||t==="\u2028"||t==="\u2029";function Fc(t,e,s){if(e===!1)return!1;let r=!!s?.backwards,n=t.charAt(e);if(r){if(t.charAt(e-1)==="\r"&&n===`
`)return e-2;if(Di(n))return e-1}else{if(n==="\r"&&t.charAt(e+1)===`
`)return e+2;if(Di(n))return e+1}return e}var Ht=Fc;function Wc(t,e,s={}){let r=Mt(t,s.backwards?e-1:e,s),n=Ht(t,r,s);return r!==n}var Qt=Wc;function $c(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let s=e+2;s<t.length;++s)if(t.charAt(s)==="*"&&t.charAt(s+1)==="/")return s+2}return e}var Mi=$c;function Gc(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?Bt(t,e):e}var Bi=Gc;function Yc(t,e){let s=null,r=e;for(;r!==s;)s=r,r=qn(t,r),r=Mi(t,r),r=Mt(t,r);return r=Bi(t,r),r=Ht(t,r),r!==!1&&Qt(t,r)}var Kt=Yc;function Vc({node:t,parent:e},s){return!!(t.source&&s.originalText.slice(N(t),N(e.close)).trimEnd().endsWith(","))}function zc(t,e){return mi(t.grandparent)&&Vc(t,e)?",":t.node.type!=="value-comment"&&!(t.node.type==="value-comma_group"&&t.node.groups.every(s=>s.type==="value-comment"))&&qi(e)&&t.callParent(()=>ls(t,e))?Rt(","):""}function Ui(t,e,s){let{node:r,parent:n}=t,i=t.map(({node:m})=>typeof m=="string"?m:s(),"groups");if(n&&di(n)&&(r.groups.length===1||r.groups.length>0&&r.groups[0].type==="value-comma_group"&&r.groups[0].groups.length>0&&r.groups[0].groups[0].type==="value-word"&&r.groups[0].groups[0].value.startsWith("data:")))return[r.open?s("open"):"",Y(",",i),r.close?s("close"):""];if(!r.open){let m=hs(t);we(i);let x=Hc(Y(",",i),2),d=Y(m?O:A,x);return R(m?[O,d]:D([jc(t)?I:"",qe(d)]))}let o=t.map(({node:m,isLast:x,index:d})=>{let p=i[d];Gt(m)&&m.type==="value-comma_group"&&m.groups&&m.groups[0].type!=="value-paren_group"&&m.groups[2]?.type==="value-paren_group"&&ae(p)===ie&&ae(p.contents)===ne&&ae(p.contents.contents)===oe&&(p=D(ue(p)));let y=[p,x?zc(t,e):","];if(!x&&m.type==="value-comma_group"&&le(m.groups)){let g=$(0,m.groups,-1);!g.source&&g.close&&(g=g.close),g.source&&Kt(e.originalText,P(g))&&y.push(O)}return y},"groups"),u=ki(r,n),a=Ci(r,n),c=ls(t,e),f=a||c&&!u,h=a||u,l=D([r.open?s("open"):"",R([I,Y(A,o)]),I,Lt,r.close?s("close"):""],{shouldBreak:f});return h?ue(l):l}function hs(t){return t.match(e=>e.type==="value-paren_group"&&!e.open&&e.groups.some(s=>s.type==="value-comma_group"),(e,s)=>s==="group"&&e.type==="value-value",(e,s)=>s==="group"&&e.type==="value-root",(e,s)=>s==="value"&&(e.type==="css-decl"&&!e.prop.startsWith("--")||e.type==="css-atrule"&&e.variable))}function jc(t){return t.match(e=>e.type==="value-paren_group"&&!e.open,(e,s)=>s==="group"&&e.type==="value-value",(e,s)=>s==="group"&&e.type==="value-root",(e,s)=>s==="value"&&e.type==="css-decl")}function Hc(t,e){let s=[];for(let r=0;r<t.length;r+=e)s.push(t.slice(r,r+e));return s}function Qc(t,e,s){let r=[];return t.each(()=>{let{node:n,previous:i}=t;if(i?.type==="css-comment"&&i.text.trim()==="prettier-ignore"?r.push(e.originalText.slice(N(n),P(n))):r.push(s()),t.isLast)return;let{next:o}=t;o.type==="css-comment"&&!Qt(e.originalText,N(o),{backwards:!0})&&!De(n)||o.type==="css-atrule"&&o.name==="else"&&n.type!=="css-comment"?r.push(" "):(r.push(e.__isHTMLStyleAttribute?A:O),Kt(e.originalText,P(n))&&!De(n)&&r.push(O))},"nodes"),r}var Ue=Qc;function Kc(t,e,s){let{node:r}=t;switch(r.type){case"css-root":{let n=Ue(t,e,s),i=r.raws.after.trim();return i.startsWith(";")&&(i=i.slice(1).trim()),[r.frontMatter?[s("frontMatter"),O,r.nodes.length>0?O:""]:"",n,i?` ${i}`:"",r.nodes.length>0?O:""]}case"css-comment":{let n=r.inline||r.raws.inline,i=e.originalText.slice(N(r),P(r));return n?i.trimEnd():i}case"css-rule":return[s("selector"),r.important?" !important":"",r.nodes?[r.selector?.type==="selector-unknown"&&Be(r.selector.value)?A:r.selector?" ":"","{",r.nodes.length>0?R([O,Ue(t,e,s)]):"",O,"}",yi(r)?";":""]:";"];case"css-decl":{let n=t.parent,{between:i}=r.raws,o=i.trim(),u=o===":",a=i.endsWith(" ")&&u,c=typeof r.value=="string"&&/^ *$/.test(r.value),f=typeof r.value=="string"?r.value:s("value");return f=Si(r)?wn(f):f,!u&&Be(o)&&!t.call(()=>hs(t),"value","group","group")&&(f=R([O,ue(f)])),[T(0,r.raws.before,/[\s;]/g,""),n.type==="css-atrule"&&n.variable||pi(t)?r.prop:Me(r.prop),o.startsWith("//")?" ":"",o,r.extend||c||!a&&r.isNested&&(ce(r.value.group.group)||ce(r.value.group.group.groups?.[0]))?"":" ",e.parser==="less"&&r.extend&&r.selector?r.selector.nodes.length>1?D(["extend(",R([I,s("selector")]),I,")"]):["extend(",s("selector"),")"]:"",f,r.raws.important?r.raws.important.replace(/\s*!\s*important/i," !important"):r.important?" !important":"",r.raws.scssDefault?r.raws.scssDefault.replace(/\s*!default/i," !default"):r.scssDefault?" !default":"",r.raws.scssGlobal?r.raws.scssGlobal.replace(/\s*!global/i," !global"):r.scssGlobal?" !global":"",r.nodes?[" {",r.nodes.length>0?R([I,Ue(t,e,s)]):"",I,"}"]:bi(r)&&!n.raws.semicolon&&e.originalText[P(r)-1]!==";"?"":e.__isHTMLStyleAttribute&&t.isLast?Rt(";"):";"]}case"css-atrule":{let n=t.parent,i=$t(r)&&!n.raws.semicolon&&e.originalText[P(r)-1]!==";";if(e.parser==="less"){if(r.mixin)return[s("selector"),r.important?" !important":"",i?"":";"];if(r.function)return[r.name,typeof r.params=="string"?r.params:s("params"),i?"":";"];if(r.variable)return["@",r.namLine truncated
@@ -0,0 +1,5 @@
# use-sync-external-store
Backwards-compatible shim for [`React.useSyncExternalStore`](https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore). Works with any React that supports Hooks.
See also https://github.com/reactwg/react-18/discussions/86.
@@ -0,0 +1,158 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = loadPrivatePartialConfig;
exports.loadPartialConfig = loadPartialConfig;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _plugin = require("./plugin.js");
var _util = require("./util.js");
var _item = require("./item.js");
var _configChain = require("./config-chain.js");
var _environment = require("./helpers/environment.js");
var _options = require("./validation/options.js");
var _index = require("./files/index.js");
var _resolveTargets = require("./resolve-targets.js");
const _excluded = ["showIgnoredFiles"];
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function resolveRootMode(rootDir, rootMode) {
switch (rootMode) {
case "root":
return rootDir;
case "upward-optional":
{
const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
return upwardRootDir === null ? rootDir : upwardRootDir;
}
case "upward":
{
const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
if (upwardRootDir !== null) return upwardRootDir;
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_index.ROOT_CONFIG_FILENAMES.join(", ")}".`), {
code: "BABEL_ROOT_NOT_FOUND",
dirname: rootDir
});
}
default:
throw new Error(`Assertion failure - unknown rootMode value.`);
}
}
function* loadPrivatePartialConfig(inputOpts) {
if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
throw new Error("Babel options must be an object, null, or undefined");
}
const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {};
const {
envName = (0, _environment.getEnv)(),
cwd = ".",
root: rootDir = ".",
rootMode = "root",
caller,
cloneInputAst = true
} = args;
const absoluteCwd = _path().resolve(cwd);
const absoluteRootDir = resolveRootMode(_path().resolve(absoluteCwd, rootDir), rootMode);
const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : undefined;
const showConfigPath = yield* (0, _index.resolveShowConfigPath)(absoluteCwd);
const context = {
filename,
cwd: absoluteCwd,
root: absoluteRootDir,
envName,
caller,
showConfig: showConfigPath === filename
};
const configChain = yield* (0, _configChain.buildRootChain)(args, context);
if (!configChain) return null;
const merged = {
assumptions: {}
};
configChain.options.forEach(opts => {
(0, _util.mergeOptions)(merged, opts);
});
const options = Object.assign({}, merged, {
targets: (0, _resolveTargets.resolveTargets)(merged, absoluteRootDir),
cloneInputAst,
babelrc: false,
configFile: false,
browserslistConfigFile: false,
passPerPreset: false,
envName: context.envName,
cwd: context.cwd,
root: context.root,
rootMode: "root",
filename: typeof context.filename === "string" ? context.filename : undefined,
plugins: configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)),
presets: configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor))
});
return {
options,
context,
fileHandling: configChain.fileHandling,
ignore: configChain.ignore,
babelrc: configChain.babelrc,
config: configChain.config,
files: configChain.files
};
}
function* loadPartialConfig(opts) {
let showIgnoredFiles = false;
if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) {
var _opts = opts;
({
showIgnoredFiles
} = _opts);
opts = _objectWithoutPropertiesLoose(_opts, _excluded);
_opts;
}
const result = yield* loadPrivatePartialConfig(opts);
if (!result) return null;
const {
options,
babelrc,
ignore,
config,
fileHandling,
files
} = result;
if (fileHandling === "ignored" && !showIgnoredFiles) {
return null;
}
(options.plugins || []).forEach(item => {
if (item.value instanceof _plugin.default) {
throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()");
}
});
return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files);
}
class PartialConfig {
constructor(options, babelrc, ignore, config, fileHandling, files) {
this.options = void 0;
this.babelrc = void 0;
this.babelignore = void 0;
this.config = void 0;
this.fileHandling = void 0;
this.files = void 0;
this.options = options;
this.babelignore = ignore;
this.babelrc = babelrc;
this.config = config;
this.fileHandling = fileHandling;
this.files = files;
Object.freeze(this);
}
hasFilesystemConfig() {
return this.babelrc !== undefined || this.config !== undefined;
}
}
Object.freeze(PartialConfig.prototype);
0 && 0;
//# sourceMappingURL=partial.js.map