diff --git a/packages/deepl-mark/.gitignore b/packages/deepl-mark/.gitignore
new file mode 100644
index 00000000..23b4e574
--- /dev/null
+++ b/packages/deepl-mark/.gitignore
@@ -0,0 +1,5 @@
+/node_modules
+/coverage
+*.log
+.DS_Store
+.env
diff --git a/packages/deepl-mark/.npmignore b/packages/deepl-mark/.npmignore
new file mode 100644
index 00000000..4c9addac
--- /dev/null
+++ b/packages/deepl-mark/.npmignore
@@ -0,0 +1,4 @@
+./docs
+./scripts
+./tests
+./incoming
\ No newline at end of file
diff --git a/packages/deepl-mark/LICENSE b/packages/deepl-mark/LICENSE
new file mode 100644
index 00000000..5a1ad2d4
--- /dev/null
+++ b/packages/deepl-mark/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Izzuddin Natsir
+
+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.
diff --git a/packages/deepl-mark/README.md b/packages/deepl-mark/README.md
new file mode 100644
index 00000000..38266873
--- /dev/null
+++ b/packages/deepl-mark/README.md
@@ -0,0 +1,119 @@
+# @polymech/deepl-mark
+
+Translate markdown and MDX content using [DeepL](https://www.deepl.com/), powered by `mdast`.
+
+Correctly handles headings, paragraphs, lists, tables (GFM), links, JSX components, frontmatter, and inline formatting — preserving structure while translating only the text.
+
+## Install
+
+```bash
+npm install @polymech/deepl-mark
+```
+
+## Usage
+
+```ts
+import { translate } from '@polymech/deepl-mark';
+
+const markdown = '# Hello World\n\nThis is a paragraph.';
+const result = await translate(markdown, 'en', 'de');
+
+console.log(result);
+// # Hallo Welt
+//
+// Dies ist ein Absatz.
+```
+
+### Authentication
+
+Provide your DeepL API key via **options** or **environment variable**:
+
+```ts
+// Option 1: pass directly
+await translate(md, 'en', 'de', { apiKey: 'your-deepl-key' });
+
+// Option 2: environment variable
+// Set DEEPL_AUTH_KEY=your-deepl-key
+await translate(md, 'en', 'de');
+```
+
+### Options
+
+The optional 4th argument accepts a `TranslateOptions` object:
+
+```ts
+await translate(content, 'en', 'de', {
+ // DeepL API key (falls back to DEEPL_AUTH_KEY env var)
+ apiKey: '...',
+
+ // DeepL translation options (tagHandling, splitSentences, formality, glossaryId, etc.)
+ deeplOptions: {
+ formality: 'more',
+ glossaryId: '...',
+ },
+
+ // Frontmatter fields to include/exclude
+ frontmatterFields: {
+ include: ['title', 'description'],
+ exclude: ['slug'],
+ },
+
+ // Markdown node types to include/exclude (defaults: exclude 'code')
+ markdownNodes: {
+ exclude: ['code'],
+ },
+
+ // HTML elements to include/exclude
+ htmlElements: {
+ exclude: ['pre', 'code'],
+ },
+
+ // JSX components to include/exclude (with attribute-level control)
+ jsxComponents: {
+ include: {
+ Card: { children: true, attributes: ['header'] },
+ },
+ },
+});
+```
+
+#### DeepL defaults
+
+The following DeepL options are applied by default and can be overridden via `deeplOptions`:
+
+| Option | Default |
+|------------------|----------------|
+| `tagHandling` | `'html'` |
+| `splitSentences` | `'nonewlines'` |
+
+### Supported content
+
+- **Markdown** (`.md`) — headings, paragraphs, lists, blockquotes, tables (GFM), links, images
+- **MDX** (`.mdx`) — JSX components and expressions
+- **Frontmatter** — YAML frontmatter fields
+- **HTML** — inline HTML elements and attributes
+
+## API
+
+### `translate(content, sourceLang, targetLang, options?)`
+
+| Parameter | Type | Description |
+|--------------|------------------------|-----------------------------------------------|
+| `content` | `string` | Markdown or MDX string to translate |
+| `sourceLang` | `SourceLanguageCode` | Source language (e.g. `'en'`, `'de'`, `'fr'`) |
+| `targetLang` | `TargetLanguageCode` | Target language (e.g. `'de'`, `'en-US'`) |
+| `options` | `TranslateOptions` | Optional config (see above) |
+
+Returns `Promise` — the translated markdown.
+
+## Scripts
+
+```bash
+npm test # run all tests
+npm run test:tables # run table translation e2e test
+npm run build # build for distribution
+```
+
+## License
+
+MIT
diff --git a/packages/deepl-mark/build.js b/packages/deepl-mark/build.js
new file mode 100644
index 00000000..bd7d0027
--- /dev/null
+++ b/packages/deepl-mark/build.js
@@ -0,0 +1,44 @@
+import { transform } from 'esbuild';
+import { readdir, readFile, writeFile, mkdir } from 'node:fs/promises';
+import { join, dirname, relative } from 'node:path';
+
+const SRC = 'src';
+const DIST = 'dist';
+
+async function getFiles(dir) {
+ const entries = await readdir(dir, { withFileTypes: true });
+ const files = [];
+ for (const entry of entries) {
+ const full = join(dir, entry.name);
+ if (entry.isDirectory()) {
+ if (entry.name === '__test__' || entry.name === 'types') continue;
+ files.push(...(await getFiles(full)));
+ } else if (entry.name.endsWith('.ts')) {
+ files.push(full);
+ }
+ }
+ return files;
+}
+
+async function main() {
+ const files = await getFiles(SRC);
+
+ for (const file of files) {
+ const input = await readFile(file, 'utf-8');
+ const { code } = await transform(input, {
+ format: 'esm',
+ loader: 'ts',
+ target: 'es2021'
+ });
+
+ const rel = relative(SRC, file).replace(/\.ts$/, '.js');
+ const outPath = join(DIST, rel);
+
+ await mkdir(dirname(outPath), { recursive: true });
+ await writeFile(outPath, code);
+ }
+
+ console.log(`Built ${files.length} files to ${DIST}/`);
+}
+
+main();
diff --git a/packages/deepl-mark/dist/ast/estree.d.ts b/packages/deepl-mark/dist/ast/estree.d.ts
new file mode 100644
index 00000000..fe314c20
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/estree.d.ts
@@ -0,0 +1,115 @@
+import type { BaseNode as EsBaseNode, Identifier as EsIdentifier, Program as EsProgram, SwitchCase as EsSwitchCase, CatchClause as EsCatchClause, VariableDeclarator as EsVariableDeclarator, ExpressionStatement as EsExpressionStatement, BlockStatement as EsBlockStatement, EmptyStatement as EsEmptyStatement, DebuggerStatement as EsDebuggerStatement, WithStatement as EsWithStatement, ReturnStatement as EsReturnStatement, LabeledStatement as EsLabeledStatement, BreakStatement as EsBreakStatement, ContinueStatement as EsContinueStatement, IfStatement as EsIfStatement, SwitchStatement as EsSwitchStatement, ThrowStatement as EsThrowStatement, TryStatement as EsTryStatement, WhileStatement as EsWhileStatement, DoWhileStatement as EsDoWhileStatement, ForStatement as EsForStatement, ForInStatement as EsForInStatement, ForOfStatement as EsForOfStatement, ClassDeclaration as EsClassDeclaration, FunctionDeclaration as EsFunctionDeclaration, VariableDeclaration as EsVariableDeclaration, ModuleDeclaration as EsModuleDeclaration, ImportDeclaration as EsImportDeclaration, ExportDefaultDeclaration as EsExportDefaultDeclaration, ExportNamedDeclaration as EsExportNamedDeclaration, ExportAllDeclaration as EsExportAllDeclaration, ThisExpression as EsThisExpression, ArrayExpression as EsArrayExpression, ObjectExpression as EsObjectExpression, FunctionExpression as EsFunctionExpression, ArrowFunctionExpression as EsArrowFunctionExpression, YieldExpression as EsYieldExpression, UnaryExpression as EsUnaryExpression, UpdateExpression as EsUpdateExpression, BinaryExpression as EsBinaryExpression, AssignmentExpression as EsAssignmentExpression, LogicalExpression as EsLogicalExpression, MemberExpression as EsMemberExpression, ConditionalExpression as EsConditionalExpression, CallExpression as EsCallExpression, NewExpression as EsNewExpression, SequenceExpression as EsSequenceExpression, TaggedTemplateExpression as EsTaggedTemplateExpression, ClassExpression as EsClassExpression, AwaitExpression as EsAwaitExpression, ImportExpression as EsImportExpression, ChainExpression as EsChainExpression, SimpleLiteral as EsSimpleLiteral, RegExpLiteral as EsRegExpLiteral, BigIntLiteral as EsBigIntLiteral, TemplateLiteral as EsTemplateLiteral, PrivateIdentifier as EsPrivateIdentifier, Property as EsProperty, MetaProperty as EsMetaProperty, PropertyDefinition as EsPropertyDefinition, AssignmentProperty as EsAssignmentProperty, Super as EsSuper, TemplateElement as EsTemplateElement, SpreadElement as EsSpreadElement, ObjectPattern as EsObjectPattern, ArrayPattern as EsArrayPattern, RestElement as EsRestElement, AssignmentPattern as EsAssignmentPattern, Class as EsClass, ClassBody as EsClassBody, StaticBlock as EsStaticBlock, MethodDefinition as EsMethodDefinition, ModuleSpecifier as EsModuleSpecifier, ImportSpecifier as EsImportSpecifier, ImportNamespaceSpecifier as EsImportNamespaceSpecifier, ImportDefaultSpecifier as EsImportDefaultSpecifier, ExportSpecifier as EsExportSpecifier } from 'estree';
+import type { JSXAttribute as EsJsxAttribute, JSXClosingElement as EsJsxClosingElement, JSXClosingFragment as EsJsxClosingFragment, JSXElement as EsJsxElement, JSXEmptyExpression as EsJsxEmptyExpression, JSXExpressionContainer as EsJsxExpressionContainer, JSXFragment as EsJsxFragment, JSXIdentifier as EsJsxIdentifier, JSXMemberExpression as EsJsxMemberExpression, JSXNamespacedName as EsJsxNamespacedName, JSXOpeningElement as EsJsxOpeningElement, JSXOpeningFragment as EsJsxOpeningFragment, JSXSpreadAttribute as EsJsxSpreadAttribute, JSXSpreadChild as EsJsxSpreadChild, JSXText as EsJsxText } from 'estree-jsx';
+export declare function esNodeIs(node: EsNode, type: T): node is EsNodeMap[T];
+export declare function resolveEstreePropertyPath(node: EsProperty, parents: EsNode[], attributeName: string): string | undefined;
+/**
+ * ============================================================
+ */
+export type { EsBaseNode, EsIdentifier, EsProgram, EsSwitchCase, EsCatchClause, EsVariableDeclarator, EsExpressionStatement, EsBlockStatement, EsEmptyStatement, EsDebuggerStatement, EsWithStatement, EsReturnStatement, EsLabeledStatement, EsBreakStatement, EsContinueStatement, EsIfStatement, EsSwitchStatement, EsThrowStatement, EsTryStatement, EsWhileStatement, EsDoWhileStatement, EsForStatement, EsForInStatement, EsForOfStatement, EsClassDeclaration, EsFunctionDeclaration, EsVariableDeclaration, EsModuleDeclaration, EsImportDeclaration, EsExportDefaultDeclaration, EsExportNamedDeclaration, EsExportAllDeclaration, EsThisExpression, EsArrayExpression, EsObjectExpression, EsFunctionExpression, EsArrowFunctionExpression, EsYieldExpression, EsUnaryExpression, EsUpdateExpression, EsBinaryExpression, EsAssignmentExpression, EsLogicalExpression, EsMemberExpression, EsConditionalExpression, EsCallExpression, EsNewExpression, EsSequenceExpression, EsTaggedTemplateExpression, EsClassExpression, EsAwaitExpression, EsImportExpression, EsChainExpression, EsSimpleLiteral, EsRegExpLiteral, EsBigIntLiteral, EsTemplateLiteral, EsPrivateIdentifier, EsProperty, EsMetaProperty, EsPropertyDefinition, EsAssignmentProperty, EsSuper, EsTemplateElement, EsSpreadElement, EsObjectPattern, EsArrayPattern, EsRestElement, EsAssignmentPattern, EsClass, EsClassBody, EsStaticBlock, EsMethodDefinition, EsModuleSpecifier, EsImportSpecifier, EsImportNamespaceSpecifier, EsImportDefaultSpecifier, EsExportSpecifier };
+export type { EsJsxAttribute, EsJsxClosingElement, EsJsxClosingFragment, EsJsxElement, EsJsxEmptyExpression, EsJsxExpressionContainer, EsJsxFragment, EsJsxIdentifier, EsJsxMemberExpression, EsJsxNamespacedName, EsJsxOpeningElement, EsJsxOpeningFragment, EsJsxSpreadAttribute, EsJsxSpreadChild, EsJsxText };
+export type EsNode = EsNodeMap[keyof EsNodeMap];
+export type EsNodeMap = EsExpressionMap & EsLiteralMap & EsFunctionMap & EsPatternMap & EsStatementMap & EsJsxMap & {
+ CatchClause: EsCatchClause;
+ Class: EsClass;
+ ClassBody: EsClassBody;
+ MethodDefinition: EsMethodDefinition;
+ ModuleDeclaration: EsModuleDeclaration;
+ ModuleSpecifier: EsModuleSpecifier;
+ PrivateIdentifier: EsPrivateIdentifier;
+ Program: EsProgram;
+ Property: EsProperty;
+ PropertyDefinition: EsPropertyDefinition;
+ SpreadElement: EsSpreadElement;
+ Super: EsSuper;
+ SwitchCase: EsSwitchCase;
+ TemplateElement: EsTemplateElement;
+ VariableDeclarator: EsVariableDeclarator;
+};
+export type EsExpressionMap = EsLiteralMap & {
+ ArrayExpression: EsArrayExpression;
+ ArrowFunctionExpression: EsArrowFunctionExpression;
+ AssignmentExpression: EsAssignmentExpression;
+ AwaitExpression: EsAwaitExpression;
+ BinaryExpression: EsBinaryExpression;
+ CallExpression: EsCallExpression;
+ ChainExpression: EsChainExpression;
+ ClassExpression: EsClassExpression;
+ ConditionalExpression: EsConditionalExpression;
+ FunctionExpression: EsFunctionExpression;
+ Identifier: EsIdentifier;
+ ImportExpression: EsImportExpression;
+ LogicalExpression: EsLogicalExpression;
+ MemberExpression: EsMemberExpression;
+ MetaProperty: EsMetaProperty;
+ NewExpression: EsNewExpression;
+ ObjectExpression: EsObjectExpression;
+ SequenceExpression: EsSequenceExpression;
+ TaggedTemplateExpression: EsTaggedTemplateExpression;
+ TemplateLiteral: EsTemplateLiteral;
+ ThisExpression: EsThisExpression;
+ UnaryExpression: EsUnaryExpression;
+ UpdateExpression: EsUpdateExpression;
+ YieldExpression: EsYieldExpression;
+};
+export interface EsLiteralMap {
+ Literal: EsSimpleLiteral | EsRegExpLiteral | EsBigIntLiteral;
+ SimpleLiteral: EsSimpleLiteral;
+ RegExpLiteral: EsRegExpLiteral;
+ BigIntLiteral: EsBigIntLiteral;
+}
+export interface EsFunctionMap {
+ FunctionDeclaration: EsFunctionDeclaration;
+ FunctionExpression: EsFunctionExpression;
+ ArrowFunctionExpression: EsArrowFunctionExpression;
+}
+export interface EsPatternMap {
+ Identifier: EsIdentifier;
+ ObjectPattern: EsObjectPattern;
+ ArrayPattern: EsArrayPattern;
+ RestElement: EsRestElement;
+ AssignmentPattern: EsAssignmentPattern;
+ MemberExpression: EsMemberExpression;
+}
+export type EsStatementMap = EsDeclarationMap & {
+ ExpressionStatement: EsExpressionStatement;
+ BlockStatement: EsBlockStatement;
+ StaticBlock: EsStaticBlock;
+ EmptyStatement: EsEmptyStatement;
+ DebuggerStatement: EsDebuggerStatement;
+ WithStatement: EsWithStatement;
+ ReturnStatement: EsReturnStatement;
+ LabeledStatement: EsLabeledStatement;
+ BreakStatement: EsBreakStatement;
+ ContinueStatement: EsContinueStatement;
+ IfStatement: EsIfStatement;
+ SwitchStatement: EsSwitchStatement;
+ ThrowStatement: EsThrowStatement;
+ TryStatement: EsTryStatement;
+ WhileStatement: EsWhileStatement;
+ DoWhileStatement: EsDoWhileStatement;
+ ForStatement: EsForStatement;
+ ForInStatement: EsForInStatement;
+ ForOfStatement: EsForOfStatement;
+};
+export interface EsDeclarationMap {
+ FunctionDeclaration: EsFunctionDeclaration;
+ VariableDeclaration: EsVariableDeclaration;
+ ClassDeclaration: EsClassDeclaration;
+}
+export interface EsJsxMap {
+ JSXAttribute: EsJsxAttribute;
+ JSXClosingElement: EsJsxClosingElement;
+ JSXClosingFragment: EsJsxClosingFragment;
+ JSXElement: EsJsxElement;
+ JSXEmptyExpression: EsJsxEmptyExpression;
+ JSXExpressionContainer: EsJsxExpressionContainer;
+ JSXFragment: EsJsxFragment;
+ JSXIdentifier: EsJsxIdentifier;
+ JSXMemberExpression: EsJsxMemberExpression;
+ JSXNamespacedName: EsJsxNamespacedName;
+ JSXOpeningElement: EsJsxOpeningElement;
+ JSXOpeningFragment: EsJsxOpeningFragment;
+ JSXSpreadAttribute: EsJsxSpreadAttribute;
+ JSXSpreadChild: EsJsxSpreadChild;
+ JSXText: EsJsxText;
+}
diff --git a/packages/deepl-mark/dist/ast/estree.js b/packages/deepl-mark/dist/ast/estree.js
new file mode 100644
index 00000000..39eb8b14
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/estree.js
@@ -0,0 +1,24 @@
+function esNodeIs(node, type) {
+ return node ? node.type === type : false;
+}
+function resolveEstreePropertyPath(node, parents, attributeName) {
+ if (!esNodeIs(parents[2], "ArrayExpression") && !esNodeIs(parents[2], "ObjectExpression")) return;
+ if (!esNodeIs(node.key, "Identifier")) return;
+ const names = [node.key.name];
+ for (let i = parents.length - 1; i > 1; i--) {
+ const parent = parents[i];
+ if (esNodeIs(parent, "ArrayExpression") || esNodeIs(parent, "ObjectExpression")) continue;
+ if (esNodeIs(parent, "Property")) {
+ if (!esNodeIs(parent.key, "Identifier")) return;
+ names.push(parent.key.name);
+ continue;
+ }
+ return;
+ }
+ names.push(attributeName);
+ return names.reverse().join(".");
+}
+export {
+ esNodeIs,
+ resolveEstreePropertyPath
+};
diff --git a/packages/deepl-mark/dist/ast/eswalk.d.ts b/packages/deepl-mark/dist/ast/eswalk.d.ts
new file mode 100644
index 00000000..470b3da8
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/eswalk.d.ts
@@ -0,0 +1,18 @@
+import { EsNode, EsNodeMap, EsProgram } from './estree.js';
+export declare const DEFAULT_ESWALKERS: EsWalkers;
+export declare function eswalk(ast: EsProgram, visitors: EsVisitors, walkers?: EsWalkers): void;
+export interface EsProcessor {
+ (node: EsNode | null, parents: EsNode[]): void;
+}
+export interface EsVisitor {
+ (node: EsNodeMap[NodeType], parents: EsNode[]): boolean | void;
+}
+export type EsVisitors = {
+ [NodeType in keyof EsNodeMap]?: EsVisitor;
+};
+export interface EsWalker {
+ (node: EsNodeMap[NodeType], parents: EsNode[], process: EsProcessor): void;
+}
+export type EsWalkers = {
+ [NodeType in keyof Partial]: EsWalker;
+};
diff --git a/packages/deepl-mark/dist/ast/eswalk.js b/packages/deepl-mark/dist/ast/eswalk.js
new file mode 100644
index 00000000..638f6d7b
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/eswalk.js
@@ -0,0 +1,75 @@
+import { isRegExp } from "node:util/types";
+import { esNodeIs } from "./estree.js";
+const DEFAULT_ESWALKERS = {
+ Program(node, parents, process) {
+ parents.push(node);
+ for (const statement of node.body) {
+ process(statement, parents);
+ }
+ parents.pop();
+ },
+ ExpressionStatement(node, parents, process) {
+ parents.push(node);
+ process(node.expression, parents);
+ parents.pop();
+ },
+ ArrayExpression(node, parents, process) {
+ parents.push(node);
+ for (const element of node.elements) {
+ process(element, parents);
+ }
+ parents.pop();
+ },
+ ObjectExpression(node, parents, process) {
+ parents.push(node);
+ for (const property of node.properties) {
+ process(property, parents);
+ }
+ parents.pop();
+ },
+ Property(node, parents, process) {
+ parents.push(node);
+ process(node.key, parents);
+ process(node.value, parents);
+ parents.pop();
+ },
+ JSXElement(node, parents, process) {
+ parents.push(node);
+ for (const child of node.children) {
+ process(child, parents);
+ }
+ for (const attribute of node.openingElement.attributes) {
+ process(attribute, parents);
+ }
+ parents.pop();
+ },
+ JSXAttribute(node, parents, process) {
+ parents.push(node);
+ if (node.value) {
+ process(node.value, parents);
+ }
+ parents.pop();
+ }
+};
+function eswalk(ast, visitors, walkers = DEFAULT_ESWALKERS) {
+ const process = (node, parents) => {
+ if (!node) return;
+ let type = node.type;
+ if (esNodeIs(node, "Literal")) {
+ type = typeof node.value === "bigint" ? "BigIntLiteral" : isRegExp(node.value) ? "RegExpLiteral" : "SimpleLiteral";
+ }
+ const visit = visitors[type];
+ const walk = walkers[type];
+ let keepWalking = true;
+ if (visit !== void 0) {
+ const signal = visit(node, parents);
+ keepWalking = signal === false ? false : true;
+ }
+ if (keepWalking && walk) walk(node, parents, process);
+ };
+ process(ast, []);
+}
+export {
+ DEFAULT_ESWALKERS,
+ eswalk
+};
diff --git a/packages/deepl-mark/dist/ast/mdast.d.ts b/packages/deepl-mark/dist/ast/mdast.d.ts
new file mode 100644
index 00000000..5c8f32ce
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/mdast.d.ts
@@ -0,0 +1,24 @@
+import type { Root as MdRoot, Blockquote as MdBlockquote, Break as MdBreak, Code as MdCode, Definition as MdDefinition, Delete as MdDelete, Emphasis as MdEmphasis, Footnote as MdFootnote, FootnoteDefinition as MdFootnoteDefinition, FootnoteReference as MdFootnoteReference, HTML as MdHTML, Heading as MdHeading, Image as MdImage, ImageReference as MdImageReference, InlineCode as MdInlineCode, Link as MdLink, LinkReference as MdLinkReference, List as MdList, ListItem as MdListItem, Paragraph as MdParagraph, Strong as MdStrong, Table as MdTable, TableCell as MdTableCell, TableRow as MdTableRow, Text as MdText, ThematicBreak as MdThematicBreak, YAML as MdYaml } from 'mdast';
+import type { MdxFlowExpression, MdxJsxAttribute, MdxJsxAttributeValueExpression, MdxJsxExpressionAttribute, MdxJsxFlowElement, MdxJsxTextElement, MdxTextExpression, MdxjsEsm } from 'mdast-util-mdx';
+import type { UnNode } from './unist.js';
+declare module 'mdast' {
+ interface PhrasingContentMap extends StaticPhrasingContentMap {
+ mdxJsxFlowElement: MdxJsxFlowElement;
+ mdxJsxTextElement: MdxJsxTextElement;
+ mdxFlowExpression: MdxFlowExpression;
+ mdxTextExpression: MdxTextExpression;
+ }
+}
+export declare function mdNodeIs(node: UnNode | undefined, type: T): node is T extends MdRoot['type'] ? MdRoot : T extends MdBlockquote['type'] ? MdBlockquote : T extends MdBreak['type'] ? MdBreak : T extends MdCode['type'] ? MdCode : T extends MdDefinition['type'] ? MdDefinition : T extends MdDelete['type'] ? MdDelete : T extends MdEmphasis['type'] ? MdEmphasis : T extends MdFootnote['type'] ? MdFootnote : T extends MdFootnoteDefinition['type'] ? MdFootnoteDefinition : T extends MdFootnoteReference['type'] ? MdFootnoteReference : T extends MdHTML['type'] ? MdHTML : T extends MdHeading['type'] ? MdHeading : T extends MdImage['type'] ? MdImage : T extends MdImageReference['type'] ? MdImageReference : T extends MdInlineCode['type'] ? MdInlineCode : T extends MdLink['type'] ? MdLink : T extends MdLinkReference['type'] ? MdLinkReference : T extends MdList['type'] ? MdList : T extends MdListItem['type'] ? MdListItem : T extends MdParagraph['type'] ? MdParagraph : T extends MdStrong['type'] ? MdStrong : T extends MdTable['type'] ? MdTable : T extends MdTableCell['type'] ? MdTableCell : T extends MdTableRow['type'] ? MdTableRow : T extends MdText['type'] ? MdText : T extends MdThematicBreak['type'] ? MdThematicBreak : T extends MdYaml ? MdYaml : T extends MdxFlowExpression['type'] ? MdxFlowExpression : T extends MdxJsxAttribute['type'] ? MdxJsxAttribute : T extends MdxJsxAttributeValueExpression['type'] ? MdxJsxAttributeValueExpression : T extends MdxJsxExpressionAttribute['type'] ? MdxJsxExpressionAttribute : T extends MdxJsxFlowElement['type'] ? MdxJsxFlowElement : T extends MdxJsxTextElement['type'] ? MdxJsxTextElement : T extends MdxTextExpression['type'] ? MdxTextExpression : MdxjsEsm;
+export declare function mdNodeIsJsxElement(node: UnNode): node is MdxJsxFlowElement | MdxJsxTextElement;
+/**
+ * Get MDX flavored `mdast`.
+ */
+export declare function getMdast(markdown: string): MdRoot;
+export declare function getMarkdown(mdast: MdRoot): string;
+/**
+ * ============================================================
+ */
+export type MdNodeType = MdRoot['type'] | MdBlockquote['type'] | MdBreak['type'] | MdCode['type'] | MdDefinition['type'] | MdDelete['type'] | MdEmphasis['type'] | MdFootnote['type'] | MdFootnoteDefinition['type'] | MdFootnoteReference['type'] | MdHTML['type'] | MdHeading['type'] | MdImage['type'] | MdImageReference['type'] | MdInlineCode['type'] | MdLink['type'] | MdLinkReference['type'] | MdList['type'] | MdListItem['type'] | MdParagraph['type'] | MdStrong['type'] | MdTable['type'] | MdTableCell['type'] | MdTableRow['type'] | MdText['type'] | MdThematicBreak['type'] | MdYaml['type'] | MdxFlowExpression['type'] | MdxJsxAttribute['type'] | MdxJsxAttributeValueExpression['type'] | MdxJsxExpressionAttribute['type'] | MdxJsxFlowElement['type'] | MdxJsxTextElement['type'] | MdxTextExpression['type'] | MdxjsEsm['type'];
+export type { MdRoot, MdBlockquote, MdBreak, MdCode, MdDefinition, MdDelete, MdEmphasis, MdFootnote, MdFootnoteDefinition, MdFootnoteReference, MdHTML, MdHeading, MdImage, MdImageReference, MdInlineCode, MdLink, MdLinkReference, MdList, MdListItem, MdParagraph, MdStrong, MdTable, MdTableCell, MdTableRow, MdText, MdThematicBreak, MdYaml };
+export type { MdxFlowExpression, MdxJsxAttribute, MdxJsxAttributeValueExpression, MdxJsxExpressionAttribute, MdxJsxFlowElement, MdxJsxTextElement, MdxTextExpression, MdxjsEsm };
diff --git a/packages/deepl-mark/dist/ast/mdast.js b/packages/deepl-mark/dist/ast/mdast.js
new file mode 100644
index 00000000..29ec7718
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/mdast.js
@@ -0,0 +1,48 @@
+import { fromMarkdown } from "mdast-util-from-markdown";
+import { frontmatterFromMarkdown, frontmatterToMarkdown } from "mdast-util-frontmatter";
+import { gfmTableFromMarkdown, gfmTableToMarkdown } from "mdast-util-gfm-table";
+import { htmlCommentFromMarkdown, htmlCommentToMarkdown } from "../vendor/mdast-util-html-comment.js";
+import { mdxFromMarkdown, mdxToMarkdown } from "mdast-util-mdx";
+import { toMarkdown } from "mdast-util-to-markdown";
+import { frontmatter } from "micromark-extension-frontmatter";
+import { gfmTable } from "micromark-extension-gfm-table";
+import { htmlComment } from "../vendor/micromark-extension-html-comment.js";
+import { mdxjs } from "micromark-extension-mdxjs";
+function mdNodeIs(node, type) {
+ return node ? node.type === type : false;
+}
+function mdNodeIsJsxElement(node) {
+ return mdNodeIs(node, "mdxJsxFlowElement") || mdNodeIs(node, "mdxJsxTextElement");
+}
+function getMdast(markdown) {
+ return fromMarkdown(markdown, {
+ extensions: [frontmatter("yaml"), mdxjs(), gfmTable, htmlComment()],
+ mdastExtensions: [frontmatterFromMarkdown("yaml"), mdxFromMarkdown(), gfmTableFromMarkdown, htmlCommentFromMarkdown()]
+ });
+}
+function getMarkdown(mdast) {
+ return toMarkdown(mdast, {
+ extensions: [frontmatterToMarkdown("yaml"), mdxToMarkdown(), gfmTableToMarkdown(), htmlCommentToMarkdown()],
+ listItemIndent: "one",
+ join: [
+ (__, _, parent) => {
+ if (mdNodeIsJsxElement(parent)) {
+ return 0;
+ }
+ if (mdNodeIs(parent, "list")) {
+ return 0;
+ }
+ if (mdNodeIs(parent, "listItem")) {
+ return 0;
+ }
+ return 1;
+ }
+ ]
+ });
+}
+export {
+ getMarkdown,
+ getMdast,
+ mdNodeIs,
+ mdNodeIsJsxElement
+};
diff --git a/packages/deepl-mark/dist/ast/unist.d.ts b/packages/deepl-mark/dist/ast/unist.d.ts
new file mode 100644
index 00000000..568370b1
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/unist.d.ts
@@ -0,0 +1,13 @@
+import type { Position as UnPosition } from 'unist';
+export declare function unNodeIsParent(node: UnNode): node is UnParent;
+/**
+ * ============================================================
+ */
+export interface UnNode {
+ type: string;
+ position?: UnPosition;
+ data?: unknown;
+}
+export interface UnParent extends UnNode {
+ children: (UnNode | UnParent)[];
+}
diff --git a/packages/deepl-mark/dist/ast/unist.js b/packages/deepl-mark/dist/ast/unist.js
new file mode 100644
index 00000000..a7d081ad
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/unist.js
@@ -0,0 +1,6 @@
+function unNodeIsParent(node) {
+ return "children" in node;
+}
+export {
+ unNodeIsParent
+};
diff --git a/packages/deepl-mark/dist/ast/unwalk.d.ts b/packages/deepl-mark/dist/ast/unwalk.d.ts
new file mode 100644
index 00000000..4b22db9b
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/unwalk.d.ts
@@ -0,0 +1,5 @@
+import { type UnNode, type UnParent } from './unist.js';
+export declare function unwalk(node: UnNode, visit: UnVisitor, filter?: (node: UnNode, parent: UnParent | undefined) => boolean): void;
+export interface UnVisitor {
+ (node: UnNode | UnParent, parent: UnParent | undefined, index: number | undefined): boolean | void;
+}
diff --git a/packages/deepl-mark/dist/ast/unwalk.js b/packages/deepl-mark/dist/ast/unwalk.js
new file mode 100644
index 00000000..0266bc73
--- /dev/null
+++ b/packages/deepl-mark/dist/ast/unwalk.js
@@ -0,0 +1,24 @@
+import { unNodeIsParent } from "./unist.js";
+const NEXT = true;
+const STOP = false;
+function unwalk(node, visit, filter) {
+ let next = true;
+ function step(node2, parent, index) {
+ if (filter && !filter(node2, parent)) return;
+ if (unNodeIsParent(node2)) {
+ for (let i = 0; i < node2.children.length; i++) {
+ if (!next) break;
+ const child = node2.children[i];
+ step(child, node2, i);
+ }
+ node2.children = node2.children.filter((child) => child);
+ }
+ if (!next) return;
+ const signal = visit(node2, parent, index);
+ next = signal === void 0 || NEXT ? NEXT : STOP;
+ }
+ step(node, void 0, void 0);
+}
+export {
+ unwalk
+};
diff --git a/packages/deepl-mark/dist/config.d.ts b/packages/deepl-mark/dist/config.d.ts
new file mode 100644
index 00000000..47779ee3
--- /dev/null
+++ b/packages/deepl-mark/dist/config.d.ts
@@ -0,0 +1,215 @@
+import type { SourceLanguageCode, TargetLanguageCode } from 'deepl-node';
+import type { MdNodeType } from './ast/mdast.js';
+export interface ConfigBase {
+ /**
+ * Source's language code. Based on DeepL supported languages.
+ */
+ sourceLanguage: SourceLanguageCode;
+ /**
+ * Output's languages code. Based on DeepL supported languages.
+ */
+ outputLanguages: TargetLanguageCode[];
+ /**
+ * Sources and ouputs directories pairs. $langcode$ variable
+ * is provided to dynamically define directory.
+ *
+ * e.g. [ ["docs", "i18n/$langcode$/docs"], ["blog", "i18n/$langcode$/blog"] ]
+ */
+ directories: [string, string][];
+}
+export interface Config extends ConfigBase {
+ /**
+ * Override current working directory, defaults to `process.cwd()`.
+ */
+ cwd: string;
+ /**
+ * By default, all .md, .mdx, .json, and .yaml|.yml files inside
+ * source directories will be included.
+ *
+ * Define glob patterns to filter what files to include or exclude.
+ * But, the end result is still restricted by file types (.md, .mdx, .json).
+ */
+ files: {
+ include?: string[];
+ exclude: string[];
+ };
+ /**
+ * Frontmatter fields.
+ */
+ frontmatterFields: {
+ include: string[];
+ exclude: string[];
+ };
+ /**
+ * Markdown node types to include or exclude based on MDAST. Defaults to exclude `code` and `link`.
+ */
+ markdownNodes: {
+ default: boolean;
+ include: MdNodeType[];
+ exclude: MdNodeType[];
+ };
+ /**
+ * HTML elements to include and exlcude, down to the level of attributes
+ * and children. Include all HTML elements text content
+ * and some global attributes such as title and placeholder.
+ */
+ htmlElements: {
+ include: Partial<{
+ [Tag in HtmlTag]: {
+ children: boolean;
+ attributes: string[];
+ };
+ }>;
+ exclude: HtmlTag[];
+ };
+ /**
+ * JSX components to include and exclude, down to the level of attributes
+ * and children. Include all JSX components text children
+ * and exclude all attributes by default.
+ *
+ * Support array, object, and jsx attribute value. For object and array value,
+ * you can specify the access path starting with the attribute name
+ * e.g. `items.description` to translate `items={[{description: "..."}]}.
+ */
+ jsxComponents: {
+ default: boolean;
+ include: {
+ [Name: string]: {
+ children: boolean;
+ attributes: string[];
+ };
+ };
+ exclude: string[];
+ };
+ /**
+ * JSON or YAML file properties to include and exclude.
+ * Exclude all properties by default.
+ */
+ jsonOrYamlProperties: {
+ include: (string | number | symbol)[];
+ exclude: (string | number | symbol)[];
+ };
+}
+export interface UserConfig extends ConfigBase {
+ /**
+ * Override current working directory, defaults to `process.cwd()`.
+ */
+ cwd?: string;
+ /**
+ * By default, all .md, .mdx, .json, and .yaml|.yml files inside
+ * source directories will be included.
+ *
+ * Define glob patterns to filter what files to include or exclude.
+ * But, the end result is still restricted by file types (.md, .mdx, .json).
+ */
+ files?: {
+ include?: string[];
+ exclude?: string[];
+ };
+ /**
+ * Frontmatter fields.
+ */
+ frontmatterFields?: {
+ include?: string[];
+ exclude?: string[];
+ };
+ /**
+ * Markdown node types to include or exclude based on MDAST. Defaults to exclude `code` and `link`.
+ */
+ markdownNodes?: {
+ default?: boolean;
+ include?: MdNodeType[];
+ exclude?: MdNodeType[];
+ };
+ /**
+ * HTML elements to include and exlcude, down to the level of attributes
+ * and children. Include all HTML elements text content
+ * and some global attributes such as title and placeholder.
+ */
+ htmlElements?: {
+ default?: boolean;
+ include?: Partial<{
+ [Tag in HtmlTag]: {
+ children: boolean;
+ attributes: string[];
+ };
+ }>;
+ exclude?: HtmlTag[];
+ };
+ /**
+ * JSX components to include and exclude, down to the level of attributes
+ * and children. Include all JSX components text children
+ * and exclude all attributes by default.
+ *
+ * Support array, object, and jsx attribute value. For object and array value,
+ * you can specify the access path starting with the attribute name
+ * e.g. `items.description` to translate `items={[{description: "..."}]}.
+ */
+ jsxComponents?: {
+ default?: boolean;
+ include?: {
+ [Name: string]: {
+ children: boolean;
+ attributes: string[];
+ };
+ };
+ exclude?: string[];
+ };
+ /**
+ * JSON or YAML file properties to include and exclude.
+ * Exclude all properties by default.
+ */
+ jsonOrYamlProperties?: {
+ include?: string[];
+ exclude?: string[];
+ };
+}
+export type HtmlElementsConfig = {
+ [Tag in HtmlTag]: {
+ children: boolean;
+ attributes: string[];
+ };
+};
+export declare const HTML_ELEMENTS_CONFIG: HtmlElementsConfig;
+export declare const HTML_TAGS: HtmlTag[];
+export declare function isHtmlTag(name: string): name is HtmlTag;
+export declare function resolveConfig({ sourceLanguage, outputLanguages, directories, cwd, files, markdownNodes, frontmatterFields, htmlElements, jsxComponents, jsonOrYamlProperties }: UserConfig): Config;
+export declare function isFrontmatterFieldIncluded({ field, config }: {
+ field: string;
+ config: Config;
+}): boolean;
+export declare function isMarkdownNodeIncluded({ type, config }: {
+ type: MdNodeType;
+ config: Config;
+}): boolean;
+export declare function isHtmlElementIncluded({ tag, config }: {
+ tag: HtmlTag;
+ config: Config;
+}): boolean;
+export declare function isHtmlElementAttributeIncluded({ tag, attribute, config }: {
+ tag: HtmlTag;
+ attribute: string;
+ config: Config;
+}): boolean;
+export declare function isHtmlElementChildrenIncluded({ tag, config }: {
+ tag: HtmlTag;
+ config: Config;
+}): boolean;
+export declare function isJsxComponentIncluded({ name, config }: {
+ name: string;
+ config: Config;
+}): boolean;
+export declare function isJsxComponentAttributeIncluded({ name, attribute, config }: {
+ name: string;
+ attribute: string;
+ config: Config;
+}): boolean;
+export declare function isJsxComponentChildrenIncluded({ name, config }: {
+ name: string;
+ config: Config;
+}): boolean;
+export declare function isJsonOrYamlPropertyIncluded({ property, config }: {
+ config: Config;
+ property: string | number | symbol;
+}): boolean;
+export type HtmlTag = 'a' | 'abbr' | 'address' | 'article' | 'aside' | 'audio' | 'b' | 'bdi' | 'bdo' | 'blockquote' | 'body' | 'button' | 'canvas' | 'caption' | 'cite' | 'col' | 'colgroup' | 'data' | 'datalist' | 'dd' | 'del' | 'details' | 'dfn' | 'dialog' | 'div' | 'dl' | 'dt' | 'em' | 'fieldset' | 'figcaption' | 'figure' | 'footer' | 'form' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'header' | 'html' | 'i' | 'input' | 'ins' | 'label' | 'legend' | 'li' | 'main' | 'mark' | 'meter' | 'nav' | 'ol' | 'optgroup' | 'output' | 'p' | 'progress' | 'q' | 'rp' | 's' | 'samp' | 'section' | 'select' | 'small' | 'span' | 'strong' | 'sub' | 'summary' | 'sup' | 'table' | 'tbody' | 'td' | 'template' | 'text-area' | 'tfoot' | 'th' | 'thead' | 'time' | 'title' | 'tr' | 'track' | 'u' | 'ul' | 'area' | 'base' | 'br' | 'code' | 'embed' | 'head' | 'hr' | 'iframe' | 'img' | 'kbd' | 'link' | 'meta' | 'noscript' | 'object' | 'param' | 'picture' | 'pre' | 'rt' | 'ruby' | 'script' | 'source' | 'style' | 'svg' | 'var' | 'video' | 'qbr';
diff --git a/packages/deepl-mark/dist/config.js b/packages/deepl-mark/dist/config.js
new file mode 100644
index 00000000..799e02b7
--- /dev/null
+++ b/packages/deepl-mark/dist/config.js
@@ -0,0 +1,244 @@
+import { isBoolean } from "./utils.js";
+const HTML_ELEMENTS_CONFIG = getHtmlElementsConfig();
+function getHtmlElementsConfig() {
+ const includeChildren = [
+ "a",
+ "abbr",
+ "address",
+ "article",
+ "aside",
+ "audio",
+ "b",
+ "bdi",
+ "bdo",
+ "blockquote",
+ "body",
+ "button",
+ "canvas",
+ "caption",
+ "cite",
+ "col",
+ "colgroup",
+ "data",
+ "datalist",
+ "dd",
+ "del",
+ "details",
+ "dfn",
+ "dialog",
+ "div",
+ "dl",
+ "dt",
+ "em",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "header",
+ "html",
+ "i",
+ "input",
+ "ins",
+ "label",
+ "legend",
+ "li",
+ "main",
+ "mark",
+ "meter",
+ "nav",
+ "ol",
+ "optgroup",
+ "output",
+ "p",
+ "progress",
+ "q",
+ "rp",
+ "s",
+ "samp",
+ "section",
+ "select",
+ "small",
+ "span",
+ "strong",
+ "sub",
+ "summary",
+ "sup",
+ "table",
+ "tbody",
+ "td",
+ "template",
+ "text-area",
+ "tfoot",
+ "th",
+ "thead",
+ "time",
+ "title",
+ "tr",
+ "track",
+ "u",
+ "ul"
+ ];
+ const excludeChildren = [
+ "area",
+ "base",
+ "br",
+ "code",
+ "embed",
+ "head",
+ "hr",
+ "iframe",
+ "img",
+ "kbd",
+ "link",
+ "meta",
+ "noscript",
+ "object",
+ "param",
+ "picture",
+ "pre",
+ "rt",
+ "ruby",
+ "script",
+ "source",
+ "style",
+ "svg",
+ "var",
+ "video",
+ "qbr"
+ ];
+ const config = {};
+ for (const tag of includeChildren) {
+ config[tag] = {
+ children: true,
+ attributes: ["title"]
+ };
+ }
+ for (const tag of excludeChildren) {
+ config[tag] = {
+ children: false,
+ attributes: ["title"]
+ };
+ }
+ return config;
+}
+const HTML_TAGS = Object.keys(HTML_ELEMENTS_CONFIG);
+function isHtmlTag(name) {
+ return HTML_TAGS.includes(name);
+}
+function resolveConfig({
+ sourceLanguage,
+ outputLanguages,
+ directories,
+ cwd,
+ files,
+ markdownNodes,
+ frontmatterFields,
+ htmlElements,
+ jsxComponents,
+ jsonOrYamlProperties
+}) {
+ return {
+ sourceLanguage,
+ outputLanguages,
+ directories,
+ cwd: cwd ?? "",
+ files: files ? {
+ include: files.include,
+ exclude: files.exclude ?? []
+ } : { exclude: [] },
+ markdownNodes: markdownNodes ? {
+ default: isBoolean(markdownNodes.default) ? markdownNodes.default : true,
+ include: markdownNodes.include ?? [],
+ exclude: markdownNodes.exclude ?? ["code"]
+ } : { default: true, include: [], exclude: ["code"] },
+ frontmatterFields: frontmatterFields ? {
+ include: frontmatterFields.include ?? [],
+ exclude: frontmatterFields.exclude ?? []
+ } : { include: [], exclude: [] },
+ htmlElements: htmlElements ? {
+ include: htmlElements.include ? isBoolean(htmlElements.default) && htmlElements.default || htmlElements.default === void 0 ? { ...HTML_ELEMENTS_CONFIG, ...htmlElements.include } : htmlElements.include : isBoolean(htmlElements.default) && !htmlElements.default ? {} : HTML_ELEMENTS_CONFIG,
+ exclude: htmlElements.exclude ?? []
+ } : { include: HTML_ELEMENTS_CONFIG, exclude: [] },
+ jsxComponents: jsxComponents ? {
+ default: isBoolean(jsxComponents.default) ? jsxComponents.default : true,
+ include: jsxComponents.include ?? {},
+ exclude: jsxComponents.exclude ?? []
+ } : { default: true, include: {}, exclude: [] },
+ jsonOrYamlProperties: jsonOrYamlProperties ? { include: jsonOrYamlProperties.include ?? [], exclude: jsonOrYamlProperties.exclude ?? [] } : { include: [], exclude: [] }
+ };
+}
+function isFrontmatterFieldIncluded({
+ field,
+ config
+}) {
+ return !config.frontmatterFields.exclude.includes(field) && config.frontmatterFields.include.includes(field);
+}
+function isMarkdownNodeIncluded({
+ type,
+ config
+}) {
+ return !config.markdownNodes.exclude.includes(type) && (config.markdownNodes.default || config.markdownNodes.include.includes(type));
+}
+function isHtmlElementIncluded({ tag, config }) {
+ return !config.htmlElements.exclude.includes(tag) && Object.keys(config.htmlElements.include).includes(tag);
+}
+function isHtmlElementAttributeIncluded({
+ tag,
+ attribute,
+ config
+}) {
+ return isHtmlElementIncluded({ tag, config }) && config.htmlElements.include[tag].attributes.includes(attribute);
+}
+function isHtmlElementChildrenIncluded({
+ tag,
+ config
+}) {
+ return isHtmlElementIncluded({ tag, config }) && config.htmlElements.include[tag].children;
+}
+function isJsxComponentIncluded({
+ name,
+ config
+}) {
+ return !config.jsxComponents.exclude.includes(name) && (config.jsxComponents.default || Object.keys(config.jsxComponents.include).includes(name));
+}
+function isJsxComponentAttributeIncluded({
+ name,
+ attribute,
+ config
+}) {
+ return !config.jsxComponents.exclude.includes(name) && Object.keys(config.jsxComponents.include).includes(name) && config.jsxComponents.include[name].attributes.includes(attribute);
+}
+function isJsxComponentChildrenIncluded({
+ name,
+ config
+}) {
+ return !config.jsxComponents.exclude.includes(name) && (Object.keys(config.jsxComponents.include).includes(name) && config.jsxComponents.include[name].children || !Object.keys(config.jsxComponents.include).includes(name) && config.jsxComponents.default);
+}
+function isJsonOrYamlPropertyIncluded({
+ property,
+ config
+}) {
+ return !config.jsonOrYamlProperties.exclude.includes(property) && config.jsonOrYamlProperties.include.includes(property);
+}
+export {
+ HTML_ELEMENTS_CONFIG,
+ HTML_TAGS,
+ isFrontmatterFieldIncluded,
+ isHtmlElementAttributeIncluded,
+ isHtmlElementChildrenIncluded,
+ isHtmlElementIncluded,
+ isHtmlTag,
+ isJsonOrYamlPropertyIncluded,
+ isJsxComponentAttributeIncluded,
+ isJsxComponentChildrenIncluded,
+ isJsxComponentIncluded,
+ isMarkdownNodeIncluded,
+ resolveConfig
+};
diff --git a/packages/deepl-mark/dist/extract.d.ts b/packages/deepl-mark/dist/extract.d.ts
new file mode 100644
index 00000000..7dd3d234
--- /dev/null
+++ b/packages/deepl-mark/dist/extract.d.ts
@@ -0,0 +1,11 @@
+import type { UnNode } from './ast/unist.js';
+import { type Config } from './config.js';
+export declare function extractMdastStrings({ mdast, config }: {
+ mdast: UnNode;
+ config: Config;
+}): string[];
+export declare function extractJsonOrYamlStrings({ source, type, config }: {
+ source: string;
+ type?: 'json' | 'yaml';
+ config: Config;
+}): string[];
diff --git a/packages/deepl-mark/dist/extract.js b/packages/deepl-mark/dist/extract.js
new file mode 100644
index 00000000..83f2f87c
--- /dev/null
+++ b/packages/deepl-mark/dist/extract.js
@@ -0,0 +1,196 @@
+import { parse as parseYaml } from "yaml";
+import {
+ esNodeIs,
+ resolveEstreePropertyPath
+} from "./ast/estree.js";
+import { eswalk } from "./ast/eswalk.js";
+import { mdNodeIs, mdNodeIsJsxElement } from "./ast/mdast.js";
+import { unwalk } from "./ast/unwalk.js";
+import {
+ isHtmlTag,
+ isFrontmatterFieldIncluded,
+ isHtmlElementIncluded,
+ isHtmlElementAttributeIncluded,
+ isJsonOrYamlPropertyIncluded,
+ isJsxComponentIncluded,
+ isJsxComponentAttributeIncluded,
+ isMarkdownNodeIncluded,
+ isHtmlElementChildrenIncluded,
+ isJsxComponentChildrenIncluded
+} from "./config.js";
+import { isArray, isEmptyArray, isEmptyString, isObject, isString } from "./utils.js";
+function extractMdastStrings({
+ mdast,
+ config
+}) {
+ const strings = [];
+ unwalk(
+ mdast,
+ (node, __, _) => {
+ if (mdNodeIs(node, "text")) {
+ pushTidyString({ array: strings, string: node.value });
+ return;
+ }
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, "mdxJsxAttribute")) continue;
+ if (!isHtmlElementAttributeIncluded({ tag: node.name, attribute: attribute.name, config }))
+ continue;
+ if (isString(attribute.value)) {
+ strings.push(attribute.value.trim());
+ } else if (attribute.value?.data?.estree) {
+ const estree = attribute.value.data.estree;
+ eswalk(estree, {
+ SimpleLiteral(esnode, _2) {
+ if (isString(esnode.value))
+ pushTidyString({ array: strings, string: esnode.value });
+ }
+ });
+ }
+ }
+ } else {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, "mdxJsxAttribute")) continue;
+ const componentName = node.name;
+ const isAttributeIncluded = isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: attribute.name,
+ config
+ });
+ if (isString(attribute.value)) {
+ if (!isAttributeIncluded) continue;
+ strings.push(attribute.value.trim());
+ } else if (attribute.value?.data?.estree) {
+ if (!config.jsxComponents.include[componentName] || !config.jsxComponents.include[componentName].attributes.some(
+ (attrName) => attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ ))
+ continue;
+ const estree = attribute.value.data.estree;
+ eswalk(estree, {
+ SimpleLiteral(esnode, _2) {
+ if (isString(esnode.value))
+ pushTidyString({ array: strings, string: esnode.value });
+ if (esnode.value === "aye") console.log("passed");
+ },
+ JSXElement(esnode, _2) {
+ const name = esnode.openingElement.name.name;
+ if (isHtmlTag(name)) {
+ if (!isHtmlElementIncluded({ tag: name, config }) || !isHtmlElementChildrenIncluded({ tag: name, config }))
+ return false;
+ } else if (!isJsxComponentIncluded({ name, config }) || !isJsxComponentChildrenIncluded({ name, config }))
+ return false;
+ },
+ JSXAttribute(esnode, parents) {
+ const name = typeof esnode.name.name === "string" ? esnode.name.name : esnode.name.name.name;
+ const parentName = parents[parents.length - 1].openingElement.name.name;
+ if (isHtmlTag(parentName)) {
+ if (!isHtmlElementAttributeIncluded({ tag: parentName, attribute: name, config }))
+ return false;
+ } else if (!config.jsxComponents.include[name] || !config.jsxComponents.include[name].attributes.some(
+ (attrName) => attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ )) {
+ return false;
+ }
+ },
+ JSXText(esnode, _2) {
+ pushTidyString({ array: strings, string: esnode.value });
+ },
+ Property(esnode, parents) {
+ if (!esNodeIs(esnode, "Identifier")) return false;
+ const propertyPath = resolveEstreePropertyPath(esnode, parents, attribute.name);
+ if (!propertyPath || !isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: propertyPath,
+ config
+ }))
+ return false;
+ }
+ });
+ }
+ }
+ }
+ }
+ if (mdNodeIs(node, "yaml")) {
+ if (isEmptyArray(config.frontmatterFields.include)) return;
+ if (isEmptyString(node.value)) return;
+ const object = parseYaml(node.value);
+ for (const field in object) {
+ if (!isFrontmatterFieldIncluded({ field, config })) continue;
+ const value = object[field];
+ if (isString(value)) {
+ strings.push(value);
+ continue;
+ }
+ if (isArray(value)) {
+ for (const item of value) {
+ if (!isString(item)) continue;
+ strings.push(item);
+ }
+ }
+ }
+ return;
+ }
+ },
+ (node, parent) => {
+ if (!isMarkdownNodeIncluded({ type: node.type, config })) return false;
+ if (parent && mdNodeIsJsxElement(parent) && parent.name) {
+ if (isHtmlTag(parent.name)) {
+ if (!isHtmlElementChildrenIncluded({ tag: parent.name, config })) return false;
+ } else {
+ if (!isJsxComponentChildrenIncluded({ name: parent.name, config })) return false;
+ }
+ return true;
+ }
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ if (!isHtmlElementIncluded({ tag: node.name, config })) return false;
+ } else {
+ if (!isJsxComponentIncluded({ name: node.name, config })) return false;
+ }
+ return true;
+ }
+ return true;
+ }
+ );
+ return strings;
+}
+function extractJsonOrYamlStrings({
+ source,
+ type = "json",
+ config
+}) {
+ const strings = [];
+ if (isEmptyArray(config.jsonOrYamlProperties.include)) return strings;
+ const parsed = type === "json" ? JSON.parse(source) : parseYaml(source);
+ process(parsed);
+ function process(value, property) {
+ if (typeof value === "string") {
+ if (property && isJsonOrYamlPropertyIncluded({ property, config })) strings.push(value);
+ return;
+ }
+ if (isArray(value)) {
+ for (const item of value) {
+ process(item);
+ }
+ return;
+ }
+ if (isObject(value)) {
+ for (const property2 in value) {
+ const item = value[property2];
+ process(item, property2);
+ }
+ return;
+ }
+ }
+ return strings;
+}
+function pushTidyString({ array, string }) {
+ if (!/^\s*$/.test(string)) {
+ array.push(string.replace(/(^\n|\r|\t|\v)+\s*/, "").replace(/\s+$/, " "));
+ }
+}
+export {
+ extractJsonOrYamlStrings,
+ extractMdastStrings
+};
diff --git a/packages/deepl-mark/dist/format.d.ts b/packages/deepl-mark/dist/format.d.ts
new file mode 100644
index 00000000..73449111
--- /dev/null
+++ b/packages/deepl-mark/dist/format.d.ts
@@ -0,0 +1 @@
+export declare function format(markdown: string): Promise;
diff --git a/packages/deepl-mark/dist/format.js b/packages/deepl-mark/dist/format.js
new file mode 100644
index 00000000..8c34bc83
--- /dev/null
+++ b/packages/deepl-mark/dist/format.js
@@ -0,0 +1,33 @@
+import prettier from "prettier";
+import { getMarkdown, getMdast, mdNodeIs } from "./ast/mdast.js";
+import { unwalk } from "./ast/unwalk.js";
+async function format(markdown) {
+ const mdast = getMdast(
+ await prettier.format(markdown, {
+ parser: "mdx",
+ printWidth: Infinity,
+ proseWrap: "never",
+ useTabs: true
+ })
+ );
+ unwalk(
+ mdast,
+ (node, parent, index) => {
+ if (mdNodeIs(node, "mdxFlowExpression") && expressionIsEmpty(node.value)) {
+ parent.children[index] = void 0;
+ }
+ },
+ (node, parent) => {
+ delete node.position;
+ return mdNodeIs(parent, "root");
+ }
+ );
+ return getMarkdown(mdast);
+}
+function expressionIsEmpty(text) {
+ const regex = /^('|")\s*('|")$/;
+ return regex.test(text);
+}
+export {
+ format
+};
diff --git a/packages/deepl-mark/dist/index.d.ts b/packages/deepl-mark/dist/index.d.ts
new file mode 100644
index 00000000..b1277ee7
--- /dev/null
+++ b/packages/deepl-mark/dist/index.d.ts
@@ -0,0 +1,32 @@
+import type { SourceLanguageCode, TargetLanguageCode, TranslateTextOptions } from 'deepl-node';
+import type { UserConfig } from './config.js';
+/**
+ * Options to control which parts of the markdown are translated.
+ */
+export type TranslateOptions = Omit & {
+ /** DeepL API key. Falls back to `DEEPL_AUTH_KEY` env var if not provided. */
+ apiKey?: string;
+ /** DeepL translation options (tagHandling, splitSentences, formality, glossaryId, etc.) */
+ deeplOptions?: TranslateTextOptions;
+};
+/**
+ * Translate markdown/MDX content from one language to another using DeepL.
+ *
+ * Requires `DEEPL_AUTH_KEY` environment variable to be set.
+ *
+ * @param content - Markdown or MDX string to translate
+ * @param sourceLang - Source language code (e.g. 'en', 'de', 'fr')
+ * @param targetLang - Target language code (e.g. 'de', 'en-US', 'fr')
+ * @param options - Optional config to control extraction (frontmatter, jsx, html, etc.)
+ * @returns Translated markdown string
+ *
+ * @example
+ * ```ts
+ * import { translate } from 'deepmark';
+ *
+ * const result = await translate('# Hello World', 'en', 'de');
+ * console.log(result); // '# Hallo Welt'
+ * ```
+ */
+export declare function translate(content: string, sourceLang: SourceLanguageCode, targetLang: TargetLanguageCode, options?: TranslateOptions): Promise;
+export type { SourceLanguageCode, TargetLanguageCode, TranslateTextOptions } from 'deepl-node';
diff --git a/packages/deepl-mark/dist/index.js b/packages/deepl-mark/dist/index.js
new file mode 100644
index 00000000..9f933f02
--- /dev/null
+++ b/packages/deepl-mark/dist/index.js
@@ -0,0 +1,25 @@
+import { getMarkdown, getMdast } from "./ast/mdast.js";
+import { resolveConfig } from "./config.js";
+import { extractMdastStrings } from "./extract.js";
+import { format } from "./format.js";
+import { replaceMdastStrings } from "./replace.js";
+import { translateStrings } from "./translate.js";
+async function translate(content, sourceLang, targetLang, options) {
+ const { apiKey, deeplOptions, ...configOptions } = options ?? {};
+ const config = resolveConfig({
+ sourceLanguage: sourceLang,
+ outputLanguages: [targetLang],
+ directories: [["", ""]],
+ ...configOptions
+ });
+ const formatted = await format(content);
+ const mdast = getMdast(formatted);
+ const strings = extractMdastStrings({ mdast, config });
+ if (strings.length === 0) return content;
+ const translated = await translateStrings(strings, sourceLang, targetLang, apiKey, deeplOptions);
+ const result = replaceMdastStrings({ mdast, strings: translated, config });
+ return getMarkdown(result);
+}
+export {
+ translate
+};
diff --git a/packages/deepl-mark/dist/lint.d.ts b/packages/deepl-mark/dist/lint.d.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/packages/deepl-mark/dist/lint.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/packages/deepl-mark/dist/lint.js b/packages/deepl-mark/dist/lint.js
new file mode 100644
index 00000000..e69de29b
diff --git a/packages/deepl-mark/dist/replace.d.ts b/packages/deepl-mark/dist/replace.d.ts
new file mode 100644
index 00000000..f664e40e
--- /dev/null
+++ b/packages/deepl-mark/dist/replace.d.ts
@@ -0,0 +1,13 @@
+import type { MdRoot } from './ast/mdast.js';
+import { type Config } from './config.js';
+export declare function replaceMdastStrings({ mdast, config, strings }: {
+ mdast: MdRoot;
+ strings: string[];
+ config: Config;
+}): MdRoot;
+export declare function replaceJsonOrYamlStrings({ source, type, strings, config }: {
+ source: string;
+ type?: 'json' | 'yaml';
+ strings: string[];
+ config: Config;
+}): string;
diff --git a/packages/deepl-mark/dist/replace.js b/packages/deepl-mark/dist/replace.js
new file mode 100644
index 00000000..eb41d750
--- /dev/null
+++ b/packages/deepl-mark/dist/replace.js
@@ -0,0 +1,205 @@
+import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
+import {
+ esNodeIs,
+ resolveEstreePropertyPath
+} from "./ast/estree.js";
+import { eswalk } from "./ast/eswalk.js";
+import { mdNodeIs, mdNodeIsJsxElement } from "./ast/mdast.js";
+import { unwalk } from "./ast/unwalk.js";
+import {
+ isHtmlTag,
+ isFrontmatterFieldIncluded,
+ isHtmlElementIncluded,
+ isHtmlElementAttributeIncluded,
+ isJsonOrYamlPropertyIncluded,
+ isJsxComponentIncluded,
+ isJsxComponentAttributeIncluded,
+ isMarkdownNodeIncluded,
+ isHtmlElementChildrenIncluded,
+ isJsxComponentChildrenIncluded
+} from "./config.js";
+import { isArray, isEmptyArray, isEmptyString, isObject, isString } from "./utils.js";
+function replaceMdastStrings({
+ mdast,
+ config,
+ strings
+}) {
+ strings = strings.reverse();
+ unwalk(
+ mdast,
+ (node, __, _) => {
+ if (mdNodeIs(node, "text")) {
+ node.value = strings.pop();
+ return;
+ }
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, "mdxJsxAttribute")) continue;
+ if (!isHtmlElementAttributeIncluded({ tag: node.name, attribute: attribute.name, config }))
+ continue;
+ if (isString(attribute.value)) {
+ attribute.value = strings.pop();
+ } else if (attribute.value?.data?.estree) {
+ const estree = attribute.value.data.estree;
+ eswalk(estree, {
+ SimpleLiteral(esnode, _2) {
+ if (isString(esnode.value)) esnode.value = strings.pop();
+ }
+ });
+ }
+ }
+ } else {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, "mdxJsxAttribute")) continue;
+ const componentName = node.name;
+ const isAttributeIncluded = isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: attribute.name,
+ config
+ });
+ if (isString(attribute.value)) {
+ if (!isAttributeIncluded) continue;
+ attribute.value = strings.pop();
+ } else if (attribute.value?.data?.estree) {
+ if (!config.jsxComponents.include[componentName] || !config.jsxComponents.include[componentName].attributes.some(
+ (attrName) => attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ ))
+ continue;
+ const estree = attribute.value.data.estree;
+ eswalk(estree, {
+ SimpleLiteral(esnode, _2) {
+ if (isString(esnode.value)) esnode.value = strings.pop();
+ },
+ JSXElement(esnode, _2) {
+ const name = esnode.openingElement.name.name;
+ if (isHtmlTag(name)) {
+ if (!isHtmlElementIncluded({ tag: name, config }) || !isHtmlElementChildrenIncluded({ tag: name, config }))
+ return false;
+ } else if (!isJsxComponentIncluded({ name, config }) || !isJsxComponentChildrenIncluded({ name, config }))
+ return false;
+ },
+ JSXAttribute(esnode, parents) {
+ const name = typeof esnode.name.name === "string" ? esnode.name.name : esnode.name.name.name;
+ const parentName = parents[parents.length - 1].openingElement.name.name;
+ if (isHtmlTag(parentName)) {
+ if (!isHtmlElementAttributeIncluded({ tag: parentName, attribute: name, config }))
+ return false;
+ } else if (!config.jsxComponents.include[name] || !config.jsxComponents.include[name].attributes.some(
+ (attrName) => attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ )) {
+ return false;
+ }
+ },
+ JSXText(esnode, _2) {
+ esnode.value = strings.pop();
+ },
+ Property(esnode, parents) {
+ if (!esNodeIs(esnode, "Identifier")) return false;
+ const propertyPath = resolveEstreePropertyPath(esnode, parents, attribute.name);
+ if (!propertyPath || !isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: propertyPath,
+ config
+ }))
+ return false;
+ }
+ });
+ }
+ }
+ }
+ }
+ if (mdNodeIs(node, "yaml")) {
+ if (isEmptyArray(config.frontmatterFields.include)) return;
+ if (isEmptyString(node.value)) return;
+ const object = parseYaml(node.value);
+ for (const field in object) {
+ if (!isFrontmatterFieldIncluded({ field, config })) continue;
+ const value = object[field];
+ if (isString(value)) {
+ object[field] = strings.pop();
+ continue;
+ }
+ if (isArray(value)) {
+ for (const [index, item] of value.entries()) {
+ if (!isString(item)) continue;
+ value[index] = strings.pop();
+ }
+ }
+ }
+ return;
+ }
+ },
+ (node, parent) => {
+ if (!isMarkdownNodeIncluded({ type: node.type, config })) return false;
+ if (parent && mdNodeIsJsxElement(parent) && parent.name) {
+ if (isHtmlTag(parent.name)) {
+ if (!isHtmlElementChildrenIncluded({ tag: parent.name, config })) return false;
+ } else {
+ if (!isJsxComponentChildrenIncluded({ name: parent.name, config })) return false;
+ }
+ return true;
+ }
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ if (!isHtmlElementIncluded({ tag: node.name, config })) return false;
+ } else {
+ if (!isJsxComponentIncluded({ name: node.name, config })) return false;
+ }
+ return true;
+ }
+ return true;
+ }
+ );
+ return mdast;
+}
+function replaceJsonOrYamlStrings({
+ source,
+ type = "json",
+ strings,
+ config
+}) {
+ if (isEmptyArray(config.jsonOrYamlProperties.include)) return source;
+ strings = strings.reverse();
+ const parsed = type === "json" ? JSON.parse(source) : parseYaml(source);
+ process({ value: parsed });
+ function process({
+ value,
+ parent,
+ property,
+ index
+ }) {
+ if (isArray(value)) {
+ for (const [index2, item] of value.entries()) {
+ process({ value: item, parent: value, property, index: index2 });
+ }
+ return;
+ }
+ if (isObject(value)) {
+ for (const property2 in value) {
+ const item = value[property2];
+ process({ value: item, parent: value, property: property2 });
+ }
+ return;
+ }
+ if (typeof value === "string") {
+ if (property && isJsonOrYamlPropertyIncluded({ property, config })) {
+ if (isArray(parent) && index) {
+ parent[index] = strings.pop();
+ return;
+ }
+ if (isObject(parent)) {
+ parent[property] = strings.pop();
+ return;
+ }
+ }
+ return;
+ }
+ }
+ if (type === "json") return JSON.stringify(parsed);
+ return stringifyYaml(parsed);
+}
+export {
+ replaceJsonOrYamlStrings,
+ replaceMdastStrings
+};
diff --git a/packages/deepl-mark/dist/translate.d.ts b/packages/deepl-mark/dist/translate.d.ts
new file mode 100644
index 00000000..fa43d581
--- /dev/null
+++ b/packages/deepl-mark/dist/translate.d.ts
@@ -0,0 +1,6 @@
+import type { SourceLanguageCode, TargetLanguageCode, TranslateTextOptions } from 'deepl-node';
+/**
+ * Translate an array of strings from sourceLang to targetLang using DeepL.
+ * Batches requests and retries on rate-limit (429) or server (5xx) errors.
+ */
+export declare function translateStrings(strings: string[], sourceLang: SourceLanguageCode, targetLang: TargetLanguageCode, apiKey?: string, deeplOptions?: TranslateTextOptions, batchSize?: number): Promise;
diff --git a/packages/deepl-mark/dist/translate.js b/packages/deepl-mark/dist/translate.js
new file mode 100644
index 00000000..cbff58f1
--- /dev/null
+++ b/packages/deepl-mark/dist/translate.js
@@ -0,0 +1,41 @@
+import { Translator } from "deepl-node";
+const DEFAULT_BATCH_SIZE = 50;
+const MAX_RETRIES = 3;
+async function translateStrings(strings, sourceLang, targetLang, apiKey, deeplOptions, batchSize = DEFAULT_BATCH_SIZE) {
+ if (strings.length === 0) return [];
+ const key = apiKey ?? process.env.DEEPL_AUTH_KEY;
+ if (!key) throw new Error("DeepL API key must be provided via options.apiKey or DEEPL_AUTH_KEY environment variable");
+ const deepl = new Translator(key);
+ const translations = new Array(strings.length).fill("");
+ const textOptions = {
+ tagHandling: "html",
+ splitSentences: "nonewlines",
+ ...deeplOptions
+ };
+ for (let i = 0; i < strings.length; i += batchSize) {
+ const batch = strings.slice(i, i + batchSize);
+ const results = await retry(
+ () => deepl.translateText(batch, sourceLang, targetLang, textOptions)
+ );
+ for (let j = 0; j < batch.length; j++) {
+ translations[i + j] = results[j].text;
+ }
+ }
+ return translations;
+}
+async function retry(fn, retries = MAX_RETRIES) {
+ for (let attempt = 0; ; attempt++) {
+ try {
+ return await fn();
+ } catch (err) {
+ const status = err?.statusCode ?? err?.status;
+ const retryable = status === 429 || status === 456 || status >= 500 && status < 600;
+ if (!retryable || attempt >= retries) throw err;
+ const delay = Math.min(1e3 * 2 ** attempt, 1e4);
+ await new Promise((r) => setTimeout(r, delay));
+ }
+ }
+}
+export {
+ translateStrings
+};
diff --git a/packages/deepl-mark/dist/utils.d.ts b/packages/deepl-mark/dist/utils.d.ts
new file mode 100644
index 00000000..5df7aa2d
--- /dev/null
+++ b/packages/deepl-mark/dist/utils.d.ts
@@ -0,0 +1,7 @@
+export declare function isArray(value: unknown): value is any[];
+export declare function isBoolean(value: unknown): value is boolean;
+export declare function isEmptyArray(array: any[]): boolean;
+export declare function isEmptyObject(object: Object): boolean;
+export declare function isEmptyString(string: string): boolean;
+export declare function isObject(value: unknown): value is Record;
+export declare function isString(value: unknown): value is string;
diff --git a/packages/deepl-mark/dist/utils.js b/packages/deepl-mark/dist/utils.js
new file mode 100644
index 00000000..9b4035e6
--- /dev/null
+++ b/packages/deepl-mark/dist/utils.js
@@ -0,0 +1,30 @@
+function isArray(value) {
+ return Array.isArray(value);
+}
+function isBoolean(value) {
+ return typeof value === "boolean";
+}
+function isEmptyArray(array) {
+ return array.length === 0;
+}
+function isEmptyObject(object) {
+ return Object.keys(object).length === 0;
+}
+function isEmptyString(string) {
+ return string.length === 0;
+}
+function isObject(value) {
+ return isArray(value) ? false : typeof value == "object" ? true : false;
+}
+function isString(value) {
+ return typeof value === "string";
+}
+export {
+ isArray,
+ isBoolean,
+ isEmptyArray,
+ isEmptyObject,
+ isEmptyString,
+ isObject,
+ isString
+};
diff --git a/packages/deepl-mark/dist/vendor/mdast-util-html-comment.d.ts b/packages/deepl-mark/dist/vendor/mdast-util-html-comment.d.ts
new file mode 100644
index 00000000..aedb0bc5
--- /dev/null
+++ b/packages/deepl-mark/dist/vendor/mdast-util-html-comment.d.ts
@@ -0,0 +1,4 @@
+import type { Extension } from 'mdast-util-from-markdown';
+import type { Options } from 'mdast-util-to-markdown';
+export declare function htmlCommentFromMarkdown(): Extension;
+export declare function htmlCommentToMarkdown(): Options;
diff --git a/packages/deepl-mark/dist/vendor/mdast-util-html-comment.js b/packages/deepl-mark/dist/vendor/mdast-util-html-comment.js
new file mode 100644
index 00000000..12cadc85
--- /dev/null
+++ b/packages/deepl-mark/dist/vendor/mdast-util-html-comment.js
@@ -0,0 +1,37 @@
+function htmlCommentFromMarkdown() {
+ return {
+ canContainEols: ["htmlComment"],
+ enter: {
+ htmlComment() {
+ this.buffer();
+ }
+ },
+ exit: {
+ htmlComment(token) {
+ const string = this.resume();
+ this.enter(
+ {
+ // @ts-ignore
+ type: "htmlComment",
+ value: string.slice(0, -3)
+ },
+ token
+ );
+ this.exit(token);
+ }
+ }
+ };
+}
+function htmlCommentToMarkdown() {
+ return {
+ handlers: {
+ htmlComment(node) {
+ return ``;
+ }
+ }
+ };
+}
+export {
+ htmlCommentFromMarkdown,
+ htmlCommentToMarkdown
+};
diff --git a/packages/deepl-mark/dist/vendor/micromark-extension-html-comment.d.ts b/packages/deepl-mark/dist/vendor/micromark-extension-html-comment.d.ts
new file mode 100644
index 00000000..77fb0cb5
--- /dev/null
+++ b/packages/deepl-mark/dist/vendor/micromark-extension-html-comment.d.ts
@@ -0,0 +1,3 @@
+import type { Extension, HtmlExtension } from 'micromark-util-types';
+export declare function htmlComment(): Extension;
+export declare function htmlCommentToHtml(): HtmlExtension;
diff --git a/packages/deepl-mark/dist/vendor/micromark-extension-html-comment.js b/packages/deepl-mark/dist/vendor/micromark-extension-html-comment.js
new file mode 100644
index 00000000..75788665
--- /dev/null
+++ b/packages/deepl-mark/dist/vendor/micromark-extension-html-comment.js
@@ -0,0 +1,107 @@
+import { factorySpace } from "micromark-factory-space";
+import { markdownLineEnding } from "micromark-util-character";
+import { codes } from "micromark-util-symbol/codes.js";
+import { types } from "micromark-util-symbol/types.js";
+function htmlComment() {
+ return {
+ flow: {
+ [codes.lessThan]: { tokenize, concrete: true }
+ },
+ text: {
+ [codes.lessThan]: { tokenize }
+ }
+ };
+}
+function htmlCommentToHtml() {
+ return {
+ enter: {
+ htmlComment() {
+ this.buffer();
+ }
+ },
+ exit: {
+ htmlComment() {
+ this.resume();
+ }
+ }
+ };
+}
+const tokenize = (effects, ok, nok) => {
+ let value = "";
+ return start;
+ function start(code) {
+ effects.enter("htmlComment");
+ effects.enter("htmlCommentMarker");
+ effects.consume(code);
+ value += "<";
+ return open;
+ }
+ function open(code) {
+ if (value === "<" && code === codes.exclamationMark) {
+ effects.consume(code);
+ value += "!";
+ return open;
+ }
+ if (code === codes.dash) {
+ if (value === "= 6 && value.slice(-2) === "--") {
+ effects.consume(code);
+ effects.exit(types.data);
+ effects.exit("htmlCommentString");
+ effects.exit("htmlComment");
+ value += ">";
+ return ok;
+ }
+ return nok(code);
+ }
+};
+export {
+ htmlComment,
+ htmlCommentToHtml
+};
diff --git a/packages/deepl-mark/experiments/test-fix.mjs b/packages/deepl-mark/experiments/test-fix.mjs
new file mode 100644
index 00000000..3cefe6ba
--- /dev/null
+++ b/packages/deepl-mark/experiments/test-fix.mjs
@@ -0,0 +1,38 @@
+import prettier from 'prettier';
+import { fromMarkdown } from 'mdast-util-from-markdown';
+import { toMarkdown } from 'mdast-util-to-markdown';
+
+const md = `The panel includes the following settings:
+
+* ON/OFF Toggle: A main switch.
+* Min Heating Time (1-60s): Minimum duration.
+* Mode: Selects the sequential heating algorithm:
+ * 0 - All: Cycles through all devices with time-based control.
+ * 1 - SP: Cycles through devices in groups.
+ * 2 - SP Any: Heats any devices that need heating.
+* Post-Heatup Mode: Mode to switch to after initial heatup phase.
+* Current Status: Display field showing the current state.`;
+
+const prettified = await prettier.format(md, {
+ parser: 'mdx',
+ printWidth: Infinity,
+ proseWrap: 'never',
+ useTabs: true
+});
+
+const tree = fromMarkdown(prettified);
+
+// FIX: also handle listItem parent in the join rule
+const result = toMarkdown(tree, {
+ listItemIndent: 'one',
+ join: [
+ (__, _, parent) => {
+ if (parent?.type === 'list') return 0;
+ if (parent?.type === 'listItem') return 0;
+ return 1;
+ }
+ ]
+});
+
+console.log('=== FIXED output ===');
+console.log(result);
diff --git a/packages/deepl-mark/experiments/test-prettier-list.mjs b/packages/deepl-mark/experiments/test-prettier-list.mjs
new file mode 100644
index 00000000..75a8ada2
--- /dev/null
+++ b/packages/deepl-mark/experiments/test-prettier-list.mjs
@@ -0,0 +1,51 @@
+import prettier from 'prettier';
+import { fromMarkdown } from 'mdast-util-from-markdown';
+import { toMarkdown } from 'mdast-util-to-markdown';
+
+const md = `The panel includes the following settings:
+
+* ON/OFF Toggle: A main switch.
+* Min Heating Time (1-60s): Minimum duration.
+* Mode: Selects the sequential heating algorithm:
+ * 0 - All: Cycles through all devices with time-based control.
+ * 1 - SP: Cycles through devices in groups.
+ * 2 - SP Any: Heats any devices that need heating.
+* Post-Heatup Mode: Mode to switch to after initial heatup phase.
+* Current Status: Display field showing the current state.`;
+
+console.log('=== Input ===');
+console.log(md);
+
+const prettified = await prettier.format(md, {
+ parser: 'mdx',
+ printWidth: Infinity,
+ proseWrap: 'never',
+ useTabs: true
+});
+
+console.log('\n=== After Prettier ===');
+console.log(JSON.stringify(prettified));
+console.log(prettified);
+
+const tree = fromMarkdown(prettified);
+const list = tree.children[1]; // after the paragraph
+
+console.log('=== AST Analysis of list ===');
+console.log('list spread:', list.spread);
+for (const [i, item] of list.children.entries()) {
+ console.log(`item[${i}] spread:`, item.spread, 'children:', item.children.length, item.children.map(c => c.type));
+}
+
+// Now serialize with the join rule:
+const result = toMarkdown(tree, {
+ listItemIndent: 'one',
+ join: [
+ (__, _, parent) => {
+ if (parent?.type === 'list') return 0;
+ return 1;
+ }
+ ]
+});
+
+console.log('\n=== Serialized output ===');
+console.log(result);
diff --git a/packages/deepl-mark/experiments/test-spread.mjs b/packages/deepl-mark/experiments/test-spread.mjs
new file mode 100644
index 00000000..08160378
--- /dev/null
+++ b/packages/deepl-mark/experiments/test-spread.mjs
@@ -0,0 +1,50 @@
+import { fromMarkdown } from 'mdast-util-from-markdown';
+import { toMarkdown } from 'mdast-util-to-markdown';
+
+const md = `* Mode: Selects the algorithm:
+ * 0 - All: Cycles through all devices.
+ * 1 - SP: Cycles through devices in groups.
+* Post-Mode: blah`;
+
+const tree = fromMarkdown(md);
+const list = tree.children[0];
+
+console.log('=== AST Analysis ===');
+console.log('list spread:', list.spread);
+for (const [i, item] of list.children.entries()) {
+ console.log(`item[${i}] spread:`, item.spread, 'children count:', item.children.length, 'children types:', item.children.map(c => c.type));
+}
+
+console.log('\n=== Default toMarkdown ===');
+console.log(JSON.stringify(toMarkdown(tree)));
+
+console.log('\n=== With join rule ===');
+const result = toMarkdown(tree, {
+ listItemIndent: 'one',
+ join: [
+ (__, _, parent) => {
+ if (parent?.type === 'list') return 0;
+ if (parent?.type === 'listItem') return 0;
+ return 1;
+ }
+ ]
+});
+console.log(JSON.stringify(result));
+
+console.log('\n=== With join rule + forced spread=false ===');
+function clearSpread(node) {
+ if (node.spread !== undefined) node.spread = false;
+ if (node.children) node.children.forEach(clearSpread);
+}
+clearSpread(tree);
+const result2 = toMarkdown(tree, {
+ listItemIndent: 'one',
+ join: [
+ (__, _, parent) => {
+ if (parent?.type === 'list') return 0;
+ if (parent?.type === 'listItem') return 0;
+ return 1;
+ }
+ ]
+});
+console.log(JSON.stringify(result2));
diff --git a/packages/deepl-mark/package-lock.json b/packages/deepl-mark/package-lock.json
new file mode 100644
index 00000000..fbd42bc7
--- /dev/null
+++ b/packages/deepl-mark/package-lock.json
@@ -0,0 +1,4335 @@
+{
+ "name": "@polymech/deepl-mark",
+ "version": "0.3.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@polymech/deepl-mark",
+ "version": "0.3.0",
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.8.2",
+ "acorn-jsx": "^5.3.2",
+ "astring": "^1.8.4",
+ "deepl-node": "^1.24.0",
+ "mdast-util-from-markdown": "^1.3.0",
+ "mdast-util-frontmatter": "^1.0.1",
+ "mdast-util-gfm-table": "^1.0.7",
+ "mdast-util-mdx": "^2.0.1",
+ "mdast-util-to-markdown": "^1.5.0",
+ "micromark-extension-frontmatter": "^1.0.0",
+ "micromark-extension-gfm-table": "^1.0.7",
+ "micromark-extension-mdxjs": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.1.0",
+ "micromark-util-symbol": "^1.0.1",
+ "micromark-util-types": "^1.0.2",
+ "prettier": "^2.8.3",
+ "yaml": "^2.2.1"
+ },
+ "devDependencies": {
+ "@types/estree": "^1.0.0",
+ "@types/mdast": "^3.0.10",
+ "@types/node": "^25.3.3",
+ "@types/prettier": "^2.7.2",
+ "@types/unist": "^2.0.6",
+ "esbuild": "^0.25.0",
+ "typescript": "^5.9.3",
+ "vitest": "^3.0.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
+ "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
+ "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
+ "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
+ "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
+ "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
+ "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
+ "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
+ "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
+ "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
+ "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
+ "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
+ "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
+ "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
+ "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
+ "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
+ "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
+ "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
+ "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
+ "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
+ "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz",
+ "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz",
+ "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz",
+ "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz",
+ "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz",
+ "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz",
+ "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz",
+ "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz",
+ "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz",
+ "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz",
+ "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz",
+ "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz",
+ "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz",
+ "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz",
+ "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz",
+ "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz",
+ "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz",
+ "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz",
+ "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz",
+ "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz",
+ "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz",
+ "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz",
+ "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz",
+ "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz",
+ "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz",
+ "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@types/acorn": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz",
+ "integrity": "sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "*"
+ }
+ },
+ "node_modules/@types/chai": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/deep-eql": "*",
+ "assertion-error": "^2.0.1"
+ }
+ },
+ "node_modules/@types/debug": {
+ "version": "4.1.12",
+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz",
+ "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/ms": "*"
+ }
+ },
+ "node_modules/@types/deep-eql": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
+ "license": "MIT"
+ },
+ "node_modules/@types/estree-jsx": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz",
+ "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "*"
+ }
+ },
+ "node_modules/@types/hast": {
+ "version": "2.3.10",
+ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz",
+ "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2"
+ }
+ },
+ "node_modules/@types/mdast": {
+ "version": "3.0.15",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz",
+ "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2"
+ }
+ },
+ "node_modules/@types/ms": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
+ "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "25.3.3",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.3.tgz",
+ "integrity": "sha512-DpzbrH7wIcBaJibpKo9nnSQL0MTRdnWttGyE5haGwK86xgMOkFLp7vEyfQPGLOJh5wNYiJ3V9PmUMDhV9u8kkQ==",
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~7.18.0"
+ }
+ },
+ "node_modules/@types/prettier": {
+ "version": "2.7.3",
+ "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz",
+ "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/unist": {
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
+ "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",
+ "license": "MIT"
+ },
+ "node_modules/@vitest/expect": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz",
+ "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/spy": "3.2.4",
+ "@vitest/utils": "3.2.4",
+ "chai": "^5.2.0",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/pretty-format": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz",
+ "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/runner": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz",
+ "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/utils": "3.2.4",
+ "pathe": "^2.0.3",
+ "strip-literal": "^3.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/snapshot": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz",
+ "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.4",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/spy": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz",
+ "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyspy": "^4.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/utils": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz",
+ "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.4",
+ "loupe": "^3.1.4",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
+ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
+ "license": "MIT",
+ "peer": true,
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/adm-zip": {
+ "version": "0.5.16",
+ "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz",
+ "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0"
+ }
+ },
+ "node_modules/assertion-error": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/astring": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz",
+ "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==",
+ "license": "MIT",
+ "bin": {
+ "astring": "bin/astring"
+ }
+ },
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+ "license": "MIT"
+ },
+ "node_modules/axios": {
+ "version": "1.13.6",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
+ "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
+ "license": "MIT",
+ "dependencies": {
+ "follow-redirects": "^1.15.11",
+ "form-data": "^4.0.5",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/axios/node_modules/form-data": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
+ "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
+ "license": "MIT",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "hasown": "^2.0.2",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/ccount": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",
+ "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/chai": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
+ "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "assertion-error": "^2.0.1",
+ "check-error": "^2.1.1",
+ "deep-eql": "^5.0.1",
+ "loupe": "^3.1.0",
+ "pathval": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/character-entities": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",
+ "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/character-entities-html4": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz",
+ "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/character-entities-legacy": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",
+ "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/character-reference-invalid": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz",
+ "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/check-error": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
+ "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
+ }
+ },
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "license": "MIT",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/decode-named-character-reference": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz",
+ "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==",
+ "license": "MIT",
+ "dependencies": {
+ "character-entities": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/deep-eql": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+ "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/deepl-node": {
+ "version": "1.24.0",
+ "resolved": "https://registry.npmjs.org/deepl-node/-/deepl-node-1.24.0.tgz",
+ "integrity": "sha512-vZ9jUpzJRvFamgVOfm1LDy3YYJ7k8FhxtAX9whR92EFshLIP9JlYS0HFwXL5yYsfqzXdb/wssGRSWvR48t7nSg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": ">=12.0",
+ "adm-zip": "^0.5.16",
+ "axios": "^1.7.4",
+ "form-data": "^3.0.0",
+ "loglevel": ">=1.6.2",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": ">=12.0"
+ }
+ },
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/diff": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz",
+ "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
+ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-set-tostringtag": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.6",
+ "has-tostringtag": "^1.0.2",
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
+ "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.12",
+ "@esbuild/android-arm": "0.25.12",
+ "@esbuild/android-arm64": "0.25.12",
+ "@esbuild/android-x64": "0.25.12",
+ "@esbuild/darwin-arm64": "0.25.12",
+ "@esbuild/darwin-x64": "0.25.12",
+ "@esbuild/freebsd-arm64": "0.25.12",
+ "@esbuild/freebsd-x64": "0.25.12",
+ "@esbuild/linux-arm": "0.25.12",
+ "@esbuild/linux-arm64": "0.25.12",
+ "@esbuild/linux-ia32": "0.25.12",
+ "@esbuild/linux-loong64": "0.25.12",
+ "@esbuild/linux-mips64el": "0.25.12",
+ "@esbuild/linux-ppc64": "0.25.12",
+ "@esbuild/linux-riscv64": "0.25.12",
+ "@esbuild/linux-s390x": "0.25.12",
+ "@esbuild/linux-x64": "0.25.12",
+ "@esbuild/netbsd-arm64": "0.25.12",
+ "@esbuild/netbsd-x64": "0.25.12",
+ "@esbuild/openbsd-arm64": "0.25.12",
+ "@esbuild/openbsd-x64": "0.25.12",
+ "@esbuild/openharmony-arm64": "0.25.12",
+ "@esbuild/sunos-x64": "0.25.12",
+ "@esbuild/win32-arm64": "0.25.12",
+ "@esbuild/win32-ia32": "0.25.12",
+ "@esbuild/win32-x64": "0.25.12"
+ }
+ },
+ "node_modules/estree-util-is-identifier-name": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-2.1.0.tgz",
+ "integrity": "sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/estree-util-visit": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-1.2.1.tgz",
+ "integrity": "sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree-jsx": "^1.0.0",
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/expect-type": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz",
+ "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/fault": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz",
+ "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==",
+ "license": "MIT",
+ "dependencies": {
+ "format": "^0.2.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/follow-redirects": {
+ "version": "1.15.11",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
+ "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/form-data": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.4.tgz",
+ "integrity": "sha512-f0cRzm6dkyVYV3nPoooP8XlccPQukegwhAnpoLcXy+X+A8KfpGOoXwDr9FLZd3wzgLaBGQBE3lY93Zm/i1JvIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "hasown": "^2.0.2",
+ "mime-types": "^2.1.35"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/format": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
+ "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==",
+ "engines": {
+ "node": ">=0.4.x"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-tostringtag": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+ "license": "MIT",
+ "dependencies": {
+ "has-symbols": "^1.0.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/is-alphabetical": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
+ "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/is-alphanumerical": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz",
+ "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==",
+ "license": "MIT",
+ "dependencies": {
+ "is-alphabetical": "^2.0.0",
+ "is-decimal": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/is-decimal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz",
+ "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/is-hexadecimal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz",
+ "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
+ "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/loglevel": {
+ "version": "1.9.2",
+ "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz",
+ "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6.0"
+ },
+ "funding": {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/loglevel"
+ }
+ },
+ "node_modules/longest-streak": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",
+ "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/loupe": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
+ "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.21",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.5"
+ }
+ },
+ "node_modules/markdown-table": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz",
+ "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/mdast-util-from-markdown": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz",
+ "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "mdast-util-to-string": "^3.1.0",
+ "micromark": "^3.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-decode-string": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "unist-util-stringify-position": "^3.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-frontmatter": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-1.0.1.tgz",
+ "integrity": "sha512-JjA2OjxRqAa8wEG8hloD0uTU0kdn8kbtOWpPP94NBkfAlbxn4S8gCGf/9DwFtEeGPXrDcNXdiDjVaRdUFqYokw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0",
+ "micromark-extension-frontmatter": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-gfm-table": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz",
+ "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "markdown-table": "^3.0.0",
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-mdx": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-2.0.1.tgz",
+ "integrity": "sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==",
+ "license": "MIT",
+ "dependencies": {
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-mdx-expression": "^1.0.0",
+ "mdast-util-mdx-jsx": "^2.0.0",
+ "mdast-util-mdxjs-esm": "^1.0.0",
+ "mdast-util-to-markdown": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-mdx-expression": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.2.tgz",
+ "integrity": "sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree-jsx": "^1.0.0",
+ "@types/hast": "^2.0.0",
+ "@types/mdast": "^3.0.0",
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-to-markdown": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-mdx-jsx": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-2.1.4.tgz",
+ "integrity": "sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree-jsx": "^1.0.0",
+ "@types/hast": "^2.0.0",
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "ccount": "^2.0.0",
+ "mdast-util-from-markdown": "^1.1.0",
+ "mdast-util-to-markdown": "^1.3.0",
+ "parse-entities": "^4.0.0",
+ "stringify-entities": "^4.0.0",
+ "unist-util-remove-position": "^4.0.0",
+ "unist-util-stringify-position": "^3.0.0",
+ "vfile-message": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-mdxjs-esm": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-1.3.1.tgz",
+ "integrity": "sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree-jsx": "^1.0.0",
+ "@types/hast": "^2.0.0",
+ "@types/mdast": "^3.0.0",
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-to-markdown": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-phrasing": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz",
+ "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-markdown": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz",
+ "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "longest-streak": "^3.0.0",
+ "mdast-util-phrasing": "^3.0.0",
+ "mdast-util-to-string": "^3.0.0",
+ "micromark-util-decode-string": "^1.0.0",
+ "unist-util-visit": "^4.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-string": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz",
+ "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz",
+ "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@types/debug": "^4.0.0",
+ "debug": "^4.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-core-commonmark": "^1.0.1",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-combine-extensions": "^1.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-encode": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-subtokenize": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.1",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-core-commonmark": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz",
+ "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-factory-destination": "^1.0.0",
+ "micromark-factory-label": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-factory-title": "^1.0.0",
+ "micromark-factory-whitespace": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-classify-character": "^1.0.0",
+ "micromark-util-html-tag-name": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-subtokenize": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.1",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-extension-frontmatter": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-1.1.1.tgz",
+ "integrity": "sha512-m2UH9a7n3W8VAH9JO9y01APpPKmNNNs71P0RbknEmYSaZU5Ghogv38BYO94AI5Xw6OYfxZRdHZZ2nYjs/Z+SZQ==",
+ "license": "MIT",
+ "dependencies": {
+ "fault": "^2.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-table": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz",
+ "integrity": "sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-mdx-expression": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.8.tgz",
+ "integrity": "sha512-zZpeQtc5wfWKdzDsHRBY003H2Smg+PUi2REhqgIhdzAa5xonhP03FcXxqFSerFiNUr5AWmHpaNPQTBVOS4lrXw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0",
+ "micromark-factory-mdx-expression": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-events-to-acorn": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-extension-mdx-jsx": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.5.tgz",
+ "integrity": "sha512-gPH+9ZdmDflbu19Xkb8+gheqEDqkSpdCEubQyxuz/Hn8DOXiXvrXeikOoBA71+e8Pfi0/UYmU3wW3H58kr7akA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/acorn": "^4.0.0",
+ "@types/estree": "^1.0.0",
+ "estree-util-is-identifier-name": "^2.0.0",
+ "micromark-factory-mdx-expression": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0",
+ "vfile-message": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-mdx-md": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-1.0.1.tgz",
+ "integrity": "sha512-7MSuj2S7xjOQXAjjkbjBsHkMtb+mDGVW6uI2dBL9snOBCbZmoNgDAeZ0nSn9j3T42UE/g2xVNMn18PJxZvkBEA==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-mdxjs": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-1.0.1.tgz",
+ "integrity": "sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==",
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.0.0",
+ "acorn-jsx": "^5.0.0",
+ "micromark-extension-mdx-expression": "^1.0.0",
+ "micromark-extension-mdx-jsx": "^1.0.0",
+ "micromark-extension-mdx-md": "^1.0.0",
+ "micromark-extension-mdxjs-esm": "^1.0.0",
+ "micromark-util-combine-extensions": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-mdxjs-esm": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-1.0.5.tgz",
+ "integrity": "sha512-xNRBw4aoURcyz/S69B19WnZAkWJMxHMT5hE36GtDAyhoyn/8TuAeqjFJQlwk+MKQsUD7b3l7kFX+vlfVWgcX1w==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0",
+ "micromark-core-commonmark": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-events-to-acorn": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "unist-util-position-from-estree": "^1.1.0",
+ "uvu": "^0.5.0",
+ "vfile-message": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-factory-destination": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz",
+ "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-factory-label": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz",
+ "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-factory-mdx-expression": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-1.0.9.tgz",
+ "integrity": "sha512-jGIWzSmNfdnkJq05c7b0+Wv0Kfz3NJ3N4cBjnbO4zjXIlxJr+f8lk+5ZmwFvqdAbUy2q6B5rCY//g0QAAaXDWA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-events-to-acorn": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "unist-util-position-from-estree": "^1.0.0",
+ "uvu": "^0.5.0",
+ "vfile-message": "^3.0.0"
+ }
+ },
+ "node_modules/micromark-factory-space": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz",
+ "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-factory-title": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz",
+ "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-factory-whitespace": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz",
+ "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-character": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz",
+ "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-chunked": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz",
+ "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-classify-character": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz",
+ "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-combine-extensions": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz",
+ "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-decode-numeric-character-reference": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz",
+ "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-decode-string": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz",
+ "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz",
+ "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/micromark-util-events-to-acorn": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-1.2.3.tgz",
+ "integrity": "sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@types/acorn": "^4.0.0",
+ "@types/estree": "^1.0.0",
+ "@types/unist": "^2.0.0",
+ "estree-util-visit": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0",
+ "vfile-message": "^3.0.0"
+ }
+ },
+ "node_modules/micromark-util-html-tag-name": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz",
+ "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/micromark-util-normalize-identifier": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz",
+ "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-resolve-all": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz",
+ "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-sanitize-uri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz",
+ "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-encode": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "node_modules/micromark-util-subtokenize": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz",
+ "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "node_modules/micromark-util-symbol": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz",
+ "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/micromark-util-types": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz",
+ "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.11",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/parse-entities": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz",
+ "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "character-entities-legacy": "^3.0.0",
+ "character-reference-invalid": "^2.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "is-alphanumerical": "^2.0.0",
+ "is-decimal": "^2.0.0",
+ "is-hexadecimal": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathval": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
+ "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.16"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.6",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
+ "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.11",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
+ "license": "MIT"
+ },
+ "node_modules/rollup": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz",
+ "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.8"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.59.0",
+ "@rollup/rollup-android-arm64": "4.59.0",
+ "@rollup/rollup-darwin-arm64": "4.59.0",
+ "@rollup/rollup-darwin-x64": "4.59.0",
+ "@rollup/rollup-freebsd-arm64": "4.59.0",
+ "@rollup/rollup-freebsd-x64": "4.59.0",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.59.0",
+ "@rollup/rollup-linux-arm-musleabihf": "4.59.0",
+ "@rollup/rollup-linux-arm64-gnu": "4.59.0",
+ "@rollup/rollup-linux-arm64-musl": "4.59.0",
+ "@rollup/rollup-linux-loong64-gnu": "4.59.0",
+ "@rollup/rollup-linux-loong64-musl": "4.59.0",
+ "@rollup/rollup-linux-ppc64-gnu": "4.59.0",
+ "@rollup/rollup-linux-ppc64-musl": "4.59.0",
+ "@rollup/rollup-linux-riscv64-gnu": "4.59.0",
+ "@rollup/rollup-linux-riscv64-musl": "4.59.0",
+ "@rollup/rollup-linux-s390x-gnu": "4.59.0",
+ "@rollup/rollup-linux-x64-gnu": "4.59.0",
+ "@rollup/rollup-linux-x64-musl": "4.59.0",
+ "@rollup/rollup-openbsd-x64": "4.59.0",
+ "@rollup/rollup-openharmony-arm64": "4.59.0",
+ "@rollup/rollup-win32-arm64-msvc": "4.59.0",
+ "@rollup/rollup-win32-ia32-msvc": "4.59.0",
+ "@rollup/rollup-win32-x64-gnu": "4.59.0",
+ "@rollup/rollup-win32-x64-msvc": "4.59.0",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/sade": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
+ "license": "MIT",
+ "dependencies": {
+ "mri": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/siginfo": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stackback": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/std-env": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
+ "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/stringify-entities": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",
+ "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==",
+ "license": "MIT",
+ "dependencies": {
+ "character-entities-html4": "^2.0.0",
+ "character-entities-legacy": "^3.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/strip-literal": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz",
+ "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "js-tokens": "^9.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/tinybench": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.15",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
+ "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tinypool": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
+ "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ }
+ },
+ "node_modules/tinyrainbow": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz",
+ "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tinyspy": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz",
+ "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "7.18.2",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
+ "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
+ "license": "MIT"
+ },
+ "node_modules/unist-util-is": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz",
+ "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-position-from-estree": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-1.1.2.tgz",
+ "integrity": "sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-remove-position": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-4.0.2.tgz",
+ "integrity": "sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-visit": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-stringify-position": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz",
+ "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-visit": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz",
+ "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-is": "^5.0.0",
+ "unist-util-visit-parents": "^5.1.1"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-visit-parents": {
+ "version": "5.1.3",
+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz",
+ "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/uvu": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz",
+ "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==",
+ "license": "MIT",
+ "dependencies": {
+ "dequal": "^2.0.0",
+ "diff": "^5.0.0",
+ "kleur": "^4.0.3",
+ "sade": "^1.7.3"
+ },
+ "bin": {
+ "uvu": "bin.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/vfile-message": {
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz",
+ "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-stringify-position": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/vite-node": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz",
+ "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.4.1",
+ "es-module-lexer": "^1.7.0",
+ "pathe": "^2.0.3",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
+ "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/android-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
+ "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/android-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
+ "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/android-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
+ "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
+ "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
+ "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
+ "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
+ "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
+ "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
+ "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
+ "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
+ "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
+ "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
+ "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
+ "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/linux-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
+ "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
+ "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
+ "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
+ "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
+ "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/@esbuild/win32-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
+ "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vite-node/node_modules/esbuild": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.3",
+ "@esbuild/android-arm": "0.27.3",
+ "@esbuild/android-arm64": "0.27.3",
+ "@esbuild/android-x64": "0.27.3",
+ "@esbuild/darwin-arm64": "0.27.3",
+ "@esbuild/darwin-x64": "0.27.3",
+ "@esbuild/freebsd-arm64": "0.27.3",
+ "@esbuild/freebsd-x64": "0.27.3",
+ "@esbuild/linux-arm": "0.27.3",
+ "@esbuild/linux-arm64": "0.27.3",
+ "@esbuild/linux-ia32": "0.27.3",
+ "@esbuild/linux-loong64": "0.27.3",
+ "@esbuild/linux-mips64el": "0.27.3",
+ "@esbuild/linux-ppc64": "0.27.3",
+ "@esbuild/linux-riscv64": "0.27.3",
+ "@esbuild/linux-s390x": "0.27.3",
+ "@esbuild/linux-x64": "0.27.3",
+ "@esbuild/netbsd-arm64": "0.27.3",
+ "@esbuild/netbsd-x64": "0.27.3",
+ "@esbuild/openbsd-arm64": "0.27.3",
+ "@esbuild/openbsd-x64": "0.27.3",
+ "@esbuild/openharmony-arm64": "0.27.3",
+ "@esbuild/sunos-x64": "0.27.3",
+ "@esbuild/win32-arm64": "0.27.3",
+ "@esbuild/win32-ia32": "0.27.3",
+ "@esbuild/win32-x64": "0.27.3"
+ }
+ },
+ "node_modules/vite-node/node_modules/vite": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
+ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.27.0",
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3",
+ "postcss": "^8.5.6",
+ "rollup": "^4.43.0",
+ "tinyglobby": "^0.2.15"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^20.19.0 || >=22.12.0",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "lightningcss": "^1.21.0",
+ "sass": "^1.70.0",
+ "sass-embedded": "^1.70.0",
+ "stylus": ">=0.54.8",
+ "sugarss": "^5.0.0",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vitest": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz",
+ "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/expect": "3.2.4",
+ "@vitest/mocker": "3.2.4",
+ "@vitest/pretty-format": "^3.2.4",
+ "@vitest/runner": "3.2.4",
+ "@vitest/snapshot": "3.2.4",
+ "@vitest/spy": "3.2.4",
+ "@vitest/utils": "3.2.4",
+ "chai": "^5.2.0",
+ "debug": "^4.4.1",
+ "expect-type": "^1.2.1",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3",
+ "picomatch": "^4.0.2",
+ "std-env": "^3.9.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.14",
+ "tinypool": "^1.1.1",
+ "tinyrainbow": "^2.0.0",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
+ "vite-node": "3.2.4",
+ "why-is-node-running": "^2.3.0"
+ },
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@types/debug": "^4.1.12",
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "@vitest/browser": "3.2.4",
+ "@vitest/ui": "3.2.4",
+ "happy-dom": "*",
+ "jsdom": "*"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@types/debug": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
+ },
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
+ "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/android-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
+ "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/android-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
+ "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/android-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
+ "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
+ "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
+ "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
+ "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
+ "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
+ "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
+ "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
+ "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
+ "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
+ "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
+ "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
+ "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/linux-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
+ "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
+ "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
+ "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
+ "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
+ "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@esbuild/win32-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
+ "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/vitest/node_modules/@vitest/mocker": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz",
+ "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "3.2.4",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.17"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vitest/node_modules/esbuild": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.3",
+ "@esbuild/android-arm": "0.27.3",
+ "@esbuild/android-arm64": "0.27.3",
+ "@esbuild/android-x64": "0.27.3",
+ "@esbuild/darwin-arm64": "0.27.3",
+ "@esbuild/darwin-x64": "0.27.3",
+ "@esbuild/freebsd-arm64": "0.27.3",
+ "@esbuild/freebsd-x64": "0.27.3",
+ "@esbuild/linux-arm": "0.27.3",
+ "@esbuild/linux-arm64": "0.27.3",
+ "@esbuild/linux-ia32": "0.27.3",
+ "@esbuild/linux-loong64": "0.27.3",
+ "@esbuild/linux-mips64el": "0.27.3",
+ "@esbuild/linux-ppc64": "0.27.3",
+ "@esbuild/linux-riscv64": "0.27.3",
+ "@esbuild/linux-s390x": "0.27.3",
+ "@esbuild/linux-x64": "0.27.3",
+ "@esbuild/netbsd-arm64": "0.27.3",
+ "@esbuild/netbsd-x64": "0.27.3",
+ "@esbuild/openbsd-arm64": "0.27.3",
+ "@esbuild/openbsd-x64": "0.27.3",
+ "@esbuild/openharmony-arm64": "0.27.3",
+ "@esbuild/sunos-x64": "0.27.3",
+ "@esbuild/win32-arm64": "0.27.3",
+ "@esbuild/win32-ia32": "0.27.3",
+ "@esbuild/win32-x64": "0.27.3"
+ }
+ },
+ "node_modules/vitest/node_modules/vite": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
+ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "esbuild": "^0.27.0",
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3",
+ "postcss": "^8.5.6",
+ "rollup": "^4.43.0",
+ "tinyglobby": "^0.2.15"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^20.19.0 || >=22.12.0",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "lightningcss": "^1.21.0",
+ "sass": "^1.70.0",
+ "sass-embedded": "^1.70.0",
+ "stylus": ">=0.54.8",
+ "sugarss": "^5.0.0",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/why-is-node-running": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "siginfo": "^2.0.0",
+ "stackback": "0.0.2"
+ },
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yaml": {
+ "version": "2.8.2",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
+ "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
+ "license": "ISC",
+ "peer": true,
+ "bin": {
+ "yaml": "bin.mjs"
+ },
+ "engines": {
+ "node": ">= 14.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/eemeli"
+ }
+ },
+ "node_modules/zwitch": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
+ "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ }
+ }
+}
diff --git a/packages/deepl-mark/package.json b/packages/deepl-mark/package.json
new file mode 100644
index 00000000..b48bfa69
--- /dev/null
+++ b/packages/deepl-mark/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "@polymech/deepl-mark",
+ "description": "Translate markdown files correctly with `mdast` and DeepL.",
+ "version": "0.3.0",
+ "license": "MIT",
+ "author": "Izzuddin Natsir | Polymech",
+ "type": "module",
+ "files": [
+ "dist/*"
+ ],
+ "main": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js"
+ }
+ },
+ "scripts": {
+ "build": "tsc && node build.js",
+ "dev": "tsc -w & node --watch build.js",
+ "test": "vitest run --reporter verbose",
+ "test:watch": "vitest watch --reporter verbose",
+ "test:tables": "vitest run src/__test__/e2e.test.ts --reporter verbose"
+ },
+ "dependencies": {
+ "acorn": "^8.8.2",
+ "acorn-jsx": "^5.3.2",
+ "astring": "^1.8.4",
+ "deepl-node": "^1.24.0",
+ "mdast-util-from-markdown": "^1.3.0",
+ "mdast-util-frontmatter": "^1.0.1",
+ "mdast-util-gfm-table": "^1.0.7",
+ "mdast-util-mdx": "^2.0.1",
+ "mdast-util-to-markdown": "^1.5.0",
+ "micromark-extension-frontmatter": "^1.0.0",
+ "micromark-extension-gfm-table": "^1.0.7",
+ "micromark-extension-mdxjs": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.1.0",
+ "micromark-util-symbol": "^1.0.1",
+ "micromark-util-types": "^1.0.2",
+ "prettier": "^2.8.3",
+ "yaml": "^2.2.1"
+ },
+ "devDependencies": {
+ "@types/node": "^25.3.3",
+ "@types/estree": "^1.0.0",
+ "@types/mdast": "^3.0.10",
+ "@types/prettier": "^2.7.2",
+ "@types/unist": "^2.0.6",
+ "esbuild": "^0.25.0",
+ "typescript": "^5.9.3",
+ "vitest": "^3.0.0"
+ }
+}
\ No newline at end of file
diff --git a/packages/deepl-mark/src/__test__/__samples__/config/base.mjs b/packages/deepl-mark/src/__test__/__samples__/config/base.mjs
new file mode 100644
index 00000000..95b5b491
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/config/base.mjs
@@ -0,0 +1,11 @@
+/** @type {import("../../../config").UserConfig} */
+export default {
+ sourceLanguage: 'en',
+ outputLanguages: ['zh', 'ja'],
+ directories: [
+ ['i18n/$langcode$', 'i18n/$langcode$'],
+ ['docs', 'i18n/$langcode$/docs'],
+ ['blog', 'i18n/$langcode$/blog']
+ ],
+ cwd: '../../example'
+};
diff --git a/packages/deepl-mark/src/__test__/__samples__/config/hybrid.mjs b/packages/deepl-mark/src/__test__/__samples__/config/hybrid.mjs
new file mode 100644
index 00000000..44ff554b
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/config/hybrid.mjs
@@ -0,0 +1,12 @@
+import base from './base.mjs';
+
+/** @type {import("../../../config").UserConfig} */
+export default {
+ ...base,
+ files: {
+ include: ['docs/intro.md', 'docs/tutorial-basics/markdown-features.mdx', 'i18n/en/code.json']
+ },
+ jsonOrYamlProperties: {
+ include: ['message', 'description']
+ }
+};
diff --git a/packages/deepl-mark/src/__test__/__samples__/config/offline.mjs b/packages/deepl-mark/src/__test__/__samples__/config/offline.mjs
new file mode 100644
index 00000000..d824a898
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/config/offline.mjs
@@ -0,0 +1,9 @@
+import base from './base.mjs';
+
+/** @type {import("../../../config").UserConfig} */
+export default {
+ ...base,
+ jsonOrYamlProperties: {
+ include: ['message', 'description']
+ }
+};
diff --git a/packages/deepl-mark/src/__test__/__samples__/config/online.mjs b/packages/deepl-mark/src/__test__/__samples__/config/online.mjs
new file mode 100644
index 00000000..145890de
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/config/online.mjs
@@ -0,0 +1,12 @@
+import base from './base.mjs';
+
+/** @type {import("../../../config").UserConfig} */
+export default {
+ ...base,
+ files: {
+ include: ['docs/tutorial-basics/markdown-features.mdx', 'i18n/en/code.json']
+ },
+ jsonOrYamlProperties: {
+ include: ['message', 'description']
+ }
+};
diff --git a/packages/deepl-mark/src/__test__/__samples__/frontmatter/empty.md b/packages/deepl-mark/src/__test__/__samples__/frontmatter/empty.md
new file mode 100644
index 00000000..a845151c
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/frontmatter/empty.md
@@ -0,0 +1,2 @@
+---
+---
diff --git a/packages/deepl-mark/src/__test__/__samples__/frontmatter/index.md b/packages/deepl-mark/src/__test__/__samples__/frontmatter/index.md
new file mode 100644
index 00000000..096a5586
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/frontmatter/index.md
@@ -0,0 +1,6 @@
+---
+author: Izzuddin Natsir
+title: A Short Title
+tags: [tagone, tagtwo]
+description: A short description.
+---
diff --git a/packages/deepl-mark/src/__test__/__samples__/json/navbar.json b/packages/deepl-mark/src/__test__/__samples__/json/navbar.json
new file mode 100644
index 00000000..a430cded
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/json/navbar.json
@@ -0,0 +1,18 @@
+{
+ "title": {
+ "message": "My Site",
+ "description": "The title in the navbar"
+ },
+ "item.label.Tutorial": {
+ "message": "Tutorial",
+ "description": "Navbar item with label Tutorial"
+ },
+ "item.label.Blog": {
+ "message": "Blog",
+ "description": "Navbar item with label Blog"
+ },
+ "item.label.GitHub": {
+ "message": "GitHub",
+ "description": "Navbar item with label GitHub"
+ }
+}
diff --git a/packages/deepl-mark/src/__test__/__samples__/jsx/code-and-pre.mdx b/packages/deepl-mark/src/__test__/__samples__/jsx/code-and-pre.mdx
new file mode 100644
index 00000000..06a78590
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/jsx/code-and-pre.mdx
@@ -0,0 +1,5 @@
+
+ This is a text.
+ function
+
preformatted
+
diff --git a/packages/deepl-mark/src/__test__/__samples__/jsx/jsx-in-prop.mdx b/packages/deepl-mark/src/__test__/__samples__/jsx/jsx-in-prop.mdx
new file mode 100644
index 00000000..88902fc4
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/jsx/jsx-in-prop.mdx
@@ -0,0 +1,14 @@
+This is a text inside a jsx prop.}>
+ This is a text inside a custom component.
+
+
+
+ This is the text of jsx item one. This the nested text of jsx item one.
+ ,
+
+ This is the text of jsx item two. This the nested text of jsx item two.
+
+ ]}
+>
diff --git a/packages/deepl-mark/src/__test__/__samples__/jsx/nested.mdx b/packages/deepl-mark/src/__test__/__samples__/jsx/nested.mdx
new file mode 100644
index 00000000..1d26b026
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/jsx/nested.mdx
@@ -0,0 +1,4 @@
+
+ This is a paragraph.This is a span.
+ This is a text inside a custom component.
+
diff --git a/packages/deepl-mark/src/__test__/__samples__/yaml/authors.yml b/packages/deepl-mark/src/__test__/__samples__/yaml/authors.yml
new file mode 100644
index 00000000..bcb29915
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__samples__/yaml/authors.yml
@@ -0,0 +1,17 @@
+endi:
+ name: Endilie Yacop Sucipto
+ title: Maintainer of Docusaurus
+ url: https://github.com/endiliey
+ image_url: https://github.com/endiliey.png
+
+yangshun:
+ name: Yangshun Tay
+ title: Front End Engineer @ Facebook
+ url: https://github.com/yangshun
+ image_url: https://github.com/yangshun.png
+
+slorber:
+ name: Sébastien Lorber
+ title: Docusaurus maintainer
+ url: https://sebastienlorber.com
+ image_url: https://github.com/slorber.png
diff --git a/packages/deepl-mark/src/__test__/__snapshots__/extract.test.ts.snap b/packages/deepl-mark/src/__test__/__snapshots__/extract.test.ts.snap
new file mode 100644
index 00000000..1b2a934b
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/__snapshots__/extract.test.ts.snap
@@ -0,0 +1,52 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`extract frontmatter field string values > filter frontmatter fields based on configuration 1`] = `
+[
+ "A Short Title",
+ "tagone",
+ "tagtwo",
+]
+`;
+
+exports[`extract jsx children and attribute string values > ignore some HTML elements by default 1`] = `
+[
+ "This is a text. ",
+]
+`;
+
+exports[`extract jsx children and attribute string values > recursively extract strings from html elements and jsx components inside attributes 1`] = `
+[
+ "This is a text inside a custom component.",
+ "This is a text inside a jsx prop.",
+ "This is the text of jsx item one. ",
+ "This the nested text of jsx item one.",
+ "A short title inside title attribute inside HTML element inside an attribute.",
+ "This is the text of jsx item two. ",
+ "This the nested text of jsx item two.",
+]
+`;
+
+exports[`extract jsx children and attribute string values > recursively extract strings from nested jsx components 1`] = `
+[
+ "This is a paragraph.",
+ "This is a span.",
+ "This is a text inside a custom component.",
+]
+`;
+
+exports[`extract strings from JSON based on configuration > filter properties based on the config 1`] = `
+[
+ "The title in the navbar",
+ "Navbar item with label Tutorial",
+ "Navbar item with label Blog",
+ "Navbar item with label GitHub",
+]
+`;
+
+exports[`extract strings from yaml based on configuration > filter properties based on the config 1`] = `
+[
+ "Maintainer of Docusaurus",
+ "Front End Engineer @ Facebook",
+ "Docusaurus maintainer",
+]
+`;
diff --git a/packages/deepl-mark/src/__test__/config.test.ts b/packages/deepl-mark/src/__test__/config.test.ts
new file mode 100644
index 00000000..db806ab7
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/config.test.ts
@@ -0,0 +1,62 @@
+import { describe } from 'vitest';
+import type { Config, UserConfig } from '../config';
+import {
+ isFrontmatterFieldIncluded,
+ isHtmlElementIncluded,
+ isHtmlElementAttributeIncluded,
+ isJsonOrYamlPropertyIncluded,
+ isJsxComponentIncluded,
+ isJsxComponentAttributeIncluded,
+ isMarkdownNodeIncluded,
+ resolveConfig
+} from '../config';
+
+const baseConfig: UserConfig = {
+ sourceLanguage: 'en',
+ outputLanguages: ['zh'],
+ directories: [['', '']]
+};
+
+describe('default configurations', (test) => {
+ const config: Config = resolveConfig(baseConfig);
+
+ test('frontmatter fields', ({ expect }) => {
+ expect(isFrontmatterFieldIncluded({ field: 'title', config })).toBe(false);
+ expect(isFrontmatterFieldIncluded({ field: 'description', config })).toBe(false);
+ });
+
+ test('markdown nodes', ({ expect }) => {
+ expect(isMarkdownNodeIncluded({ type: 'code', config })).toBe(false);
+ expect(isMarkdownNodeIncluded({ type: 'blockquote', config })).toBe(true);
+ expect(isMarkdownNodeIncluded({ type: 'heading', config })).toBe(true);
+ });
+
+ test('html elements', ({ expect }) => {
+ expect(isHtmlElementIncluded({ tag: 'a', config })).toBe(true);
+ expect(isHtmlElementIncluded({ tag: 'div', config })).toBe(true);
+ });
+
+ test('html element attributes', ({ expect }) => {
+ expect(isHtmlElementAttributeIncluded({ tag: 'div', attribute: 'title', config })).toBe(true);
+ expect(isHtmlElementAttributeIncluded({ tag: 'div', attribute: 'id', config })).toBe(false);
+ });
+
+ test('jsx components', ({ expect }) => {
+ expect(isJsxComponentIncluded({ name: 'Card', config })).toBe(true);
+ expect(isJsxComponentIncluded({ name: 'Warning', config })).toBe(true);
+ });
+
+ test('jsx component attributes', ({ expect }) => {
+ expect(isJsxComponentAttributeIncluded({ name: 'Card', attribute: 'icon', config })).toBe(
+ false
+ );
+ expect(isJsxComponentAttributeIncluded({ name: 'Warning', attribute: 'title', config })).toBe(
+ false
+ );
+ });
+
+ test('json or yaml properties', ({ expect }) => {
+ expect(isJsonOrYamlPropertyIncluded({ property: 'author', config })).toBe(false);
+ expect(isJsonOrYamlPropertyIncluded({ property: 'title', config })).toBe(false);
+ });
+});
diff --git a/packages/deepl-mark/src/__test__/e2e.test.ts b/packages/deepl-mark/src/__test__/e2e.test.ts
new file mode 100644
index 00000000..3a644573
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/e2e.test.ts
@@ -0,0 +1,23 @@
+import { readFile, writeFile } from 'node:fs/promises';
+import np from 'node:path';
+import { describe, test, expect } from 'vitest';
+import { translate } from '../index';
+
+const samplesDir = np.resolve('src/__test__');
+
+describe('e2e', () => {
+ test(
+ 'MarkdownTables',
+ async () => {
+ const source = await readFile(np.join(samplesDir, 'table.md'), 'utf-8');
+ const result = await translate(source, 'en', 'de');
+
+ const outPath = np.join(samplesDir, 'table.de.md');
+ await writeFile(outPath, result, 'utf-8');
+
+ const written = await readFile(outPath, 'utf-8');
+ expect(written).toBe(result);
+ },
+ { timeout: 30_000 }
+ );
+});
diff --git a/packages/deepl-mark/src/__test__/extract.test.ts b/packages/deepl-mark/src/__test__/extract.test.ts
new file mode 100644
index 00000000..1d1882a8
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/extract.test.ts
@@ -0,0 +1,152 @@
+import { readFile } from 'node:fs/promises';
+import np from 'node:path';
+import { describe } from 'vitest';
+import { getMdast } from '../ast/mdast';
+import { Config, resolveConfig, UserConfig } from '../config';
+import { extractJsonOrYamlStrings, extractMdastStrings } from '../extract';
+import { format } from '../format';
+
+const baseConfig: UserConfig = {
+ sourceLanguage: 'en',
+ outputLanguages: ['zh'],
+ directories: [['', '']],
+ cwd: 'src/__test__/__samples__'
+};
+
+async function extract(
+ path: string,
+ config: Config,
+ from: 'markdown' | 'json' | 'yaml' = 'markdown'
+) {
+ const resolvedPath = np.resolve(config.cwd, path);
+ const source = await readFile(resolvedPath, { encoding: 'utf-8' });
+
+ if (from === 'markdown')
+ return extractMdastStrings({ mdast: getMdast(await format(source)), config });
+
+ return extractJsonOrYamlStrings({ source, type: from, config });
+}
+
+describe('extract frontmatter field string values', (test) => {
+ test('ignore empty frontmatter', async ({ expect }) => {
+ const strings = await extract('frontmatter/empty.md', resolveConfig(baseConfig));
+
+ expect(strings.length).toBe(0);
+ });
+
+ test('filter frontmatter fields based on configuration', async ({ expect }) => {
+ const strings = await extract(
+ 'frontmatter/index.md',
+ resolveConfig({
+ ...baseConfig,
+ frontmatterFields: {
+ include: ['title', 'tags', 'description'],
+ exclude: ['description']
+ }
+ })
+ );
+
+ expect(strings).toMatchSnapshot();
+ });
+});
+
+describe('extract jsx children and attribute string values', (test) => {
+ test('recursively extract strings from nested jsx components', async ({ expect }) => {
+ const strings = await extract(
+ 'jsx/nested.mdx',
+ resolveConfig({
+ ...baseConfig,
+ jsxComponents: {
+ include: {
+ Block: { children: true, attributes: [] }
+ }
+ }
+ })
+ );
+
+ expect(strings).toMatchSnapshot();
+ });
+
+ test('recursively extract strings from html elements and jsx components inside attributes', async ({
+ expect
+ }) => {
+ const strings = await extract(
+ 'jsx/jsx-in-prop.mdx',
+ resolveConfig({
+ ...baseConfig,
+ jsxComponents: {
+ include: {
+ Card: {
+ children: true,
+ attributes: ['header']
+ },
+ List: {
+ children: false,
+ attributes: ['items']
+ }
+ }
+ }
+ })
+ );
+
+ expect(strings).toMatchSnapshot();
+ });
+
+ test('ignore some HTML elements by default', async ({ expect }) => {
+ const strings = await extract('jsx/code-and-pre.mdx', resolveConfig(baseConfig));
+
+ expect(strings).toMatchSnapshot();
+ });
+});
+
+describe('extract strings from JSON based on configuration', (test) => {
+ test('do not extract any string if no property name is included in the config', async ({
+ expect
+ }) => {
+ const strings = await extract('json/navbar.json', resolveConfig(baseConfig), 'json');
+
+ expect(strings.length).toBe(0);
+ });
+
+ test('filter properties based on the config', async ({ expect }) => {
+ const strings = await extract(
+ 'json/navbar.json',
+ resolveConfig({
+ ...baseConfig,
+ jsonOrYamlProperties: {
+ include: ['message', 'description'],
+ exclude: ['message']
+ }
+ }),
+ 'json'
+ );
+
+ expect(strings).toMatchSnapshot();
+ });
+});
+
+describe('extract strings from yaml based on configuration', (test) => {
+ test('do not extract any string if no property name is included in the config', async ({
+ expect
+ }) => {
+ const strings = await extract('yaml/authors.yml', resolveConfig(baseConfig), 'yaml');
+
+ expect(strings.length).toBe(0);
+ });
+
+ test('filter properties based on the config', async ({ expect }) => {
+ const strings = await extract(
+ 'yaml/authors.yml',
+ resolveConfig({
+ ...baseConfig,
+ jsonOrYamlProperties: {
+ include: ['name', 'title'],
+ exclude: ['name']
+ }
+ }),
+ 'yaml'
+ );
+
+ expect(strings).toMatchSnapshot();
+ });
+});
diff --git a/packages/deepl-mark/src/__test__/table.de.md b/packages/deepl-mark/src/__test__/table.de.md
new file mode 100644
index 00000000..d34928af
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/table.de.md
@@ -0,0 +1,14 @@
+| Name | Kassandra - EDC |
+| --------------------- | -------------------------------------------------------- |
+| Druck | 20T - Hydraulischer Wagenheber mit pneumatischem Antrieb |
+| Presse - Plattengröße | 1150mm \& 1150mm x 2300mm verzahnt |
+| Presse - Platten | 2-3 |
+| Optionen | 2 aktive Kühlplatten \| 3 Heizplatten |
+| Blattgröße | 60cm / 5-60mm dick |
+| Elektrizität | 380V |
+| Strom | 22kW |
+| Gewicht | 710 kg |
+| Größe | 1350 × 1350 × 1400 mm |
+| Status | Ausgereift |
+| Version | V1.0 (Revision A) |
+| Lizenz | [CERN OHL v2](https://ohwr.org/cern_ohl_s_v2.txt) |
diff --git a/packages/deepl-mark/src/__test__/table.md b/packages/deepl-mark/src/__test__/table.md
new file mode 100644
index 00000000..04d87225
--- /dev/null
+++ b/packages/deepl-mark/src/__test__/table.md
@@ -0,0 +1,15 @@
+| Name | Cassandra – EDC |
+|------|------------------|
+| Pressure | 20T – Hydraulic Jack with Pneumatic Drive |
+| Press – Plate Size | 1150mm & 1150mm x 2300mm interlocked |
+| Press – Plates | 2–3 |
+| Options | 2 Active Cooling Plates \| 3 Heating Plates |
+| Sheet Size | 60cm / 5–60mm thick |
+| Electricity | 380V |
+| Power | 22kW |
+| Weight | 710 Kg |
+| Size | 1350 × 1350 × 1400 mm |
+| Status | Mature |
+| Version | V1.0 (Revision A) |
+| License | [CERN OHL v2](https://ohwr.org/cern_ohl_s_v2.txt) |
+
diff --git a/packages/deepl-mark/src/ast/estree.ts b/packages/deepl-mark/src/ast/estree.ts
new file mode 100644
index 00000000..5acf1b4c
--- /dev/null
+++ b/packages/deepl-mark/src/ast/estree.ts
@@ -0,0 +1,352 @@
+import type {
+ BaseNode as EsBaseNode,
+ Identifier as EsIdentifier,
+ Program as EsProgram,
+ SwitchCase as EsSwitchCase,
+ CatchClause as EsCatchClause,
+ VariableDeclarator as EsVariableDeclarator,
+ ExpressionStatement as EsExpressionStatement,
+ BlockStatement as EsBlockStatement,
+ EmptyStatement as EsEmptyStatement,
+ DebuggerStatement as EsDebuggerStatement,
+ WithStatement as EsWithStatement,
+ ReturnStatement as EsReturnStatement,
+ LabeledStatement as EsLabeledStatement,
+ BreakStatement as EsBreakStatement,
+ ContinueStatement as EsContinueStatement,
+ IfStatement as EsIfStatement,
+ SwitchStatement as EsSwitchStatement,
+ ThrowStatement as EsThrowStatement,
+ TryStatement as EsTryStatement,
+ WhileStatement as EsWhileStatement,
+ DoWhileStatement as EsDoWhileStatement,
+ ForStatement as EsForStatement,
+ ForInStatement as EsForInStatement,
+ ForOfStatement as EsForOfStatement,
+ ClassDeclaration as EsClassDeclaration,
+ FunctionDeclaration as EsFunctionDeclaration,
+ VariableDeclaration as EsVariableDeclaration,
+ ModuleDeclaration as EsModuleDeclaration,
+ ImportDeclaration as EsImportDeclaration,
+ ExportDefaultDeclaration as EsExportDefaultDeclaration,
+ ExportNamedDeclaration as EsExportNamedDeclaration,
+ ExportAllDeclaration as EsExportAllDeclaration,
+ ThisExpression as EsThisExpression,
+ ArrayExpression as EsArrayExpression,
+ ObjectExpression as EsObjectExpression,
+ FunctionExpression as EsFunctionExpression,
+ ArrowFunctionExpression as EsArrowFunctionExpression,
+ YieldExpression as EsYieldExpression,
+ UnaryExpression as EsUnaryExpression,
+ UpdateExpression as EsUpdateExpression,
+ BinaryExpression as EsBinaryExpression,
+ AssignmentExpression as EsAssignmentExpression,
+ LogicalExpression as EsLogicalExpression,
+ MemberExpression as EsMemberExpression,
+ ConditionalExpression as EsConditionalExpression,
+ CallExpression as EsCallExpression,
+ NewExpression as EsNewExpression,
+ SequenceExpression as EsSequenceExpression,
+ TaggedTemplateExpression as EsTaggedTemplateExpression,
+ ClassExpression as EsClassExpression,
+ AwaitExpression as EsAwaitExpression,
+ ImportExpression as EsImportExpression,
+ ChainExpression as EsChainExpression,
+ SimpleLiteral as EsSimpleLiteral,
+ RegExpLiteral as EsRegExpLiteral,
+ BigIntLiteral as EsBigIntLiteral,
+ TemplateLiteral as EsTemplateLiteral,
+ PrivateIdentifier as EsPrivateIdentifier,
+ Property as EsProperty,
+ MetaProperty as EsMetaProperty,
+ PropertyDefinition as EsPropertyDefinition,
+ AssignmentProperty as EsAssignmentProperty,
+ Super as EsSuper,
+ TemplateElement as EsTemplateElement,
+ SpreadElement as EsSpreadElement,
+ ObjectPattern as EsObjectPattern,
+ ArrayPattern as EsArrayPattern,
+ RestElement as EsRestElement,
+ AssignmentPattern as EsAssignmentPattern,
+ Class as EsClass,
+ ClassBody as EsClassBody,
+ StaticBlock as EsStaticBlock,
+ MethodDefinition as EsMethodDefinition,
+ ModuleSpecifier as EsModuleSpecifier,
+ ImportSpecifier as EsImportSpecifier,
+ ImportNamespaceSpecifier as EsImportNamespaceSpecifier,
+ ImportDefaultSpecifier as EsImportDefaultSpecifier,
+ ExportSpecifier as EsExportSpecifier
+} from 'estree';
+
+import type {
+ JSXAttribute as EsJsxAttribute,
+ JSXClosingElement as EsJsxClosingElement,
+ JSXClosingFragment as EsJsxClosingFragment,
+ JSXElement as EsJsxElement,
+ JSXEmptyExpression as EsJsxEmptyExpression,
+ JSXExpressionContainer as EsJsxExpressionContainer,
+ JSXFragment as EsJsxFragment,
+ JSXIdentifier as EsJsxIdentifier,
+ JSXMemberExpression as EsJsxMemberExpression,
+ JSXNamespacedName as EsJsxNamespacedName,
+ JSXOpeningElement as EsJsxOpeningElement,
+ JSXOpeningFragment as EsJsxOpeningFragment,
+ JSXSpreadAttribute as EsJsxSpreadAttribute,
+ JSXSpreadChild as EsJsxSpreadChild,
+ JSXText as EsJsxText
+} from 'estree-jsx';
+
+export function esNodeIs(node: EsNode, type: T): node is EsNodeMap[T] {
+ return node ? node.type === type : false;
+}
+
+export function resolveEstreePropertyPath(
+ node: EsProperty,
+ parents: EsNode[],
+ attributeName: string
+): string | undefined {
+ if (!esNodeIs(parents[2], 'ArrayExpression') && !esNodeIs(parents[2], 'ObjectExpression')) return;
+ if (!esNodeIs(node.key, 'Identifier')) return;
+
+ const names = [node.key.name];
+
+ for (let i = parents.length - 1; i > 1; i--) {
+ const parent = parents[i];
+ if (esNodeIs(parent, 'ArrayExpression') || esNodeIs(parent, 'ObjectExpression')) continue;
+ if (esNodeIs(parent, 'Property')) {
+ if (!esNodeIs(parent.key, 'Identifier')) return;
+ names.push(parent.key.name);
+ continue;
+ }
+
+ return;
+ }
+
+ names.push(attributeName);
+
+ return names.reverse().join('.');
+}
+
+/**
+ * ============================================================
+ */
+
+export type {
+ EsBaseNode,
+ EsIdentifier,
+ EsProgram,
+ EsSwitchCase,
+ EsCatchClause,
+ EsVariableDeclarator,
+ EsExpressionStatement,
+ EsBlockStatement,
+ EsEmptyStatement,
+ EsDebuggerStatement,
+ EsWithStatement,
+ EsReturnStatement,
+ EsLabeledStatement,
+ EsBreakStatement,
+ EsContinueStatement,
+ EsIfStatement,
+ EsSwitchStatement,
+ EsThrowStatement,
+ EsTryStatement,
+ EsWhileStatement,
+ EsDoWhileStatement,
+ EsForStatement,
+ EsForInStatement,
+ EsForOfStatement,
+ EsClassDeclaration,
+ EsFunctionDeclaration,
+ EsVariableDeclaration,
+ EsModuleDeclaration,
+ EsImportDeclaration,
+ EsExportDefaultDeclaration,
+ EsExportNamedDeclaration,
+ EsExportAllDeclaration,
+ EsThisExpression,
+ EsArrayExpression,
+ EsObjectExpression,
+ EsFunctionExpression,
+ EsArrowFunctionExpression,
+ EsYieldExpression,
+ EsUnaryExpression,
+ EsUpdateExpression,
+ EsBinaryExpression,
+ EsAssignmentExpression,
+ EsLogicalExpression,
+ EsMemberExpression,
+ EsConditionalExpression,
+ EsCallExpression,
+ EsNewExpression,
+ EsSequenceExpression,
+ EsTaggedTemplateExpression,
+ EsClassExpression,
+ EsAwaitExpression,
+ EsImportExpression,
+ EsChainExpression,
+ EsSimpleLiteral,
+ EsRegExpLiteral,
+ EsBigIntLiteral,
+ EsTemplateLiteral,
+ EsPrivateIdentifier,
+ EsProperty,
+ EsMetaProperty,
+ EsPropertyDefinition,
+ EsAssignmentProperty,
+ EsSuper,
+ EsTemplateElement,
+ EsSpreadElement,
+ EsObjectPattern,
+ EsArrayPattern,
+ EsRestElement,
+ EsAssignmentPattern,
+ EsClass,
+ EsClassBody,
+ EsStaticBlock,
+ EsMethodDefinition,
+ EsModuleSpecifier,
+ EsImportSpecifier,
+ EsImportNamespaceSpecifier,
+ EsImportDefaultSpecifier,
+ EsExportSpecifier
+};
+
+export type {
+ EsJsxAttribute,
+ EsJsxClosingElement,
+ EsJsxClosingFragment,
+ EsJsxElement,
+ EsJsxEmptyExpression,
+ EsJsxExpressionContainer,
+ EsJsxFragment,
+ EsJsxIdentifier,
+ EsJsxMemberExpression,
+ EsJsxNamespacedName,
+ EsJsxOpeningElement,
+ EsJsxOpeningFragment,
+ EsJsxSpreadAttribute,
+ EsJsxSpreadChild,
+ EsJsxText
+};
+
+export type EsNode = EsNodeMap[keyof EsNodeMap];
+
+export type EsNodeMap = EsExpressionMap &
+ EsLiteralMap &
+ EsFunctionMap &
+ EsPatternMap &
+ EsStatementMap &
+ EsJsxMap & {
+ CatchClause: EsCatchClause;
+ Class: EsClass;
+ ClassBody: EsClassBody;
+ MethodDefinition: EsMethodDefinition;
+ ModuleDeclaration: EsModuleDeclaration;
+ ModuleSpecifier: EsModuleSpecifier;
+ PrivateIdentifier: EsPrivateIdentifier;
+ Program: EsProgram;
+ Property: EsProperty;
+ PropertyDefinition: EsPropertyDefinition;
+ SpreadElement: EsSpreadElement;
+ Super: EsSuper;
+ SwitchCase: EsSwitchCase;
+ TemplateElement: EsTemplateElement;
+ VariableDeclarator: EsVariableDeclarator;
+ };
+
+export type EsExpressionMap = EsLiteralMap & {
+ ArrayExpression: EsArrayExpression;
+ ArrowFunctionExpression: EsArrowFunctionExpression;
+ AssignmentExpression: EsAssignmentExpression;
+ AwaitExpression: EsAwaitExpression;
+ BinaryExpression: EsBinaryExpression;
+ CallExpression: EsCallExpression;
+ ChainExpression: EsChainExpression;
+ ClassExpression: EsClassExpression;
+ ConditionalExpression: EsConditionalExpression;
+ FunctionExpression: EsFunctionExpression;
+ Identifier: EsIdentifier;
+ ImportExpression: EsImportExpression;
+ LogicalExpression: EsLogicalExpression;
+ MemberExpression: EsMemberExpression;
+ MetaProperty: EsMetaProperty;
+ NewExpression: EsNewExpression;
+ ObjectExpression: EsObjectExpression;
+ SequenceExpression: EsSequenceExpression;
+ TaggedTemplateExpression: EsTaggedTemplateExpression;
+ TemplateLiteral: EsTemplateLiteral;
+ ThisExpression: EsThisExpression;
+ UnaryExpression: EsUnaryExpression;
+ UpdateExpression: EsUpdateExpression;
+ YieldExpression: EsYieldExpression;
+};
+
+export interface EsLiteralMap {
+ Literal: EsSimpleLiteral | EsRegExpLiteral | EsBigIntLiteral;
+ SimpleLiteral: EsSimpleLiteral;
+ RegExpLiteral: EsRegExpLiteral;
+ BigIntLiteral: EsBigIntLiteral;
+}
+
+export interface EsFunctionMap {
+ FunctionDeclaration: EsFunctionDeclaration;
+ FunctionExpression: EsFunctionExpression;
+ ArrowFunctionExpression: EsArrowFunctionExpression;
+}
+
+export interface EsPatternMap {
+ Identifier: EsIdentifier;
+ ObjectPattern: EsObjectPattern;
+ ArrayPattern: EsArrayPattern;
+ RestElement: EsRestElement;
+ AssignmentPattern: EsAssignmentPattern;
+ MemberExpression: EsMemberExpression;
+}
+
+export type EsStatementMap = EsDeclarationMap & {
+ ExpressionStatement: EsExpressionStatement;
+ BlockStatement: EsBlockStatement;
+ StaticBlock: EsStaticBlock;
+ EmptyStatement: EsEmptyStatement;
+ DebuggerStatement: EsDebuggerStatement;
+ WithStatement: EsWithStatement;
+ ReturnStatement: EsReturnStatement;
+ LabeledStatement: EsLabeledStatement;
+ BreakStatement: EsBreakStatement;
+ ContinueStatement: EsContinueStatement;
+ IfStatement: EsIfStatement;
+ SwitchStatement: EsSwitchStatement;
+ ThrowStatement: EsThrowStatement;
+ TryStatement: EsTryStatement;
+ WhileStatement: EsWhileStatement;
+ DoWhileStatement: EsDoWhileStatement;
+ ForStatement: EsForStatement;
+ ForInStatement: EsForInStatement;
+ ForOfStatement: EsForOfStatement;
+};
+
+export interface EsDeclarationMap {
+ FunctionDeclaration: EsFunctionDeclaration;
+ VariableDeclaration: EsVariableDeclaration;
+ ClassDeclaration: EsClassDeclaration;
+}
+
+export interface EsJsxMap {
+ JSXAttribute: EsJsxAttribute;
+ JSXClosingElement: EsJsxClosingElement;
+ JSXClosingFragment: EsJsxClosingFragment;
+ JSXElement: EsJsxElement;
+ JSXEmptyExpression: EsJsxEmptyExpression;
+ JSXExpressionContainer: EsJsxExpressionContainer;
+ JSXFragment: EsJsxFragment;
+ JSXIdentifier: EsJsxIdentifier;
+ JSXMemberExpression: EsJsxMemberExpression;
+ JSXNamespacedName: EsJsxNamespacedName;
+ JSXOpeningElement: EsJsxOpeningElement;
+ JSXOpeningFragment: EsJsxOpeningFragment;
+ JSXSpreadAttribute: EsJsxSpreadAttribute;
+ JSXSpreadChild: EsJsxSpreadChild;
+ JSXText: EsJsxText;
+}
diff --git a/packages/deepl-mark/src/ast/eswalk.ts b/packages/deepl-mark/src/ast/eswalk.ts
new file mode 100644
index 00000000..62c3cff1
--- /dev/null
+++ b/packages/deepl-mark/src/ast/eswalk.ts
@@ -0,0 +1,109 @@
+import { isRegExp } from 'node:util/types';
+import { EsNode, esNodeIs, EsNodeMap, EsProgram } from './estree.js';
+
+export const DEFAULT_ESWALKERS: EsWalkers = {
+ Program(node, parents, process) {
+ parents.push(node);
+ for (const statement of node.body) {
+ process(statement, parents);
+ }
+ parents.pop();
+ },
+ ExpressionStatement(node, parents, process) {
+ parents.push(node);
+ process(node.expression, parents);
+ parents.pop();
+ },
+ ArrayExpression(node, parents, process) {
+ parents.push(node);
+ for (const element of node.elements) {
+ process(element, parents);
+ }
+ parents.pop();
+ },
+ ObjectExpression(node, parents, process) {
+ parents.push(node);
+ for (const property of node.properties) {
+ process(property, parents);
+ }
+ parents.pop();
+ },
+ Property(node, parents, process) {
+ parents.push(node);
+ process(node.key, parents);
+ process(node.value, parents);
+ parents.pop();
+ },
+ JSXElement(node, parents, process) {
+ parents.push(node);
+ for (const child of node.children) {
+ process(child, parents);
+ }
+ for (const attribute of node.openingElement.attributes) {
+ process(attribute, parents);
+ }
+ parents.pop();
+ },
+ JSXAttribute(node, parents, process) {
+ parents.push(node);
+ if (node.value) {
+ process(node.value, parents);
+ }
+ parents.pop();
+ }
+};
+
+export function eswalk(
+ ast: EsProgram,
+ visitors: EsVisitors,
+ walkers: EsWalkers = DEFAULT_ESWALKERS
+) {
+ const process: EsProcessor = (node, parents) => {
+ if (!node) return;
+
+ let type = node.type as keyof EsNodeMap;
+
+ if (esNodeIs(node, 'Literal')) {
+ type =
+ typeof node.value === 'bigint'
+ ? 'BigIntLiteral'
+ : isRegExp(node.value)
+ ? 'RegExpLiteral'
+ : 'SimpleLiteral';
+ }
+
+ const visit = visitors[type] as EsVisitor;
+ const walk = walkers[type] as EsWalker;
+
+ let keepWalking = true;
+
+ if (visit !== undefined) {
+ const signal = visit(node, parents);
+ keepWalking = signal === false ? false : true;
+ }
+
+ if (keepWalking && walk) walk(node, parents, process);
+ };
+
+ process(ast, []);
+}
+
+export interface EsProcessor {
+ (node: EsNode | null, parents: EsNode[]): void;
+}
+
+export interface EsVisitor {
+ (node: EsNodeMap[NodeType], parents: EsNode[]): boolean | void;
+}
+
+export type EsVisitors = {
+ [NodeType in keyof EsNodeMap]?: EsVisitor;
+};
+
+export interface EsWalker {
+ (node: EsNodeMap[NodeType], parents: EsNode[], process: EsProcessor): void;
+}
+
+export type EsWalkers = {
+ [NodeType in keyof Partial]: EsWalker;
+};
diff --git a/packages/deepl-mark/src/ast/mdast.ts b/packages/deepl-mark/src/ast/mdast.ts
new file mode 100644
index 00000000..6a2178cf
--- /dev/null
+++ b/packages/deepl-mark/src/ast/mdast.ts
@@ -0,0 +1,257 @@
+import type {
+ Root as MdRoot,
+ Blockquote as MdBlockquote,
+ Break as MdBreak,
+ Code as MdCode,
+ Definition as MdDefinition,
+ Delete as MdDelete,
+ Emphasis as MdEmphasis,
+ Footnote as MdFootnote,
+ FootnoteDefinition as MdFootnoteDefinition,
+ FootnoteReference as MdFootnoteReference,
+ HTML as MdHTML,
+ Heading as MdHeading,
+ Image as MdImage,
+ ImageReference as MdImageReference,
+ InlineCode as MdInlineCode,
+ Link as MdLink,
+ LinkReference as MdLinkReference,
+ List as MdList,
+ ListItem as MdListItem,
+ Paragraph as MdParagraph,
+ Strong as MdStrong,
+ Table as MdTable,
+ TableCell as MdTableCell,
+ TableRow as MdTableRow,
+ Text as MdText,
+ ThematicBreak as MdThematicBreak,
+ YAML as MdYaml
+} from 'mdast';
+
+import type {
+ MdxFlowExpression,
+ MdxJsxAttribute,
+ MdxJsxAttributeValueExpression,
+ MdxJsxExpressionAttribute,
+ MdxJsxFlowElement,
+ MdxJsxTextElement,
+ MdxTextExpression,
+ MdxjsEsm
+} from 'mdast-util-mdx';
+
+import type { UnNode } from './unist.js';
+
+import { fromMarkdown } from 'mdast-util-from-markdown';
+import { frontmatterFromMarkdown, frontmatterToMarkdown } from 'mdast-util-frontmatter';
+import { gfmTableFromMarkdown, gfmTableToMarkdown } from 'mdast-util-gfm-table';
+import { htmlCommentFromMarkdown, htmlCommentToMarkdown } from '../vendor/mdast-util-html-comment.js';
+import { mdxFromMarkdown, mdxToMarkdown } from 'mdast-util-mdx';
+import { toMarkdown } from 'mdast-util-to-markdown';
+import { frontmatter } from 'micromark-extension-frontmatter';
+import { gfmTable } from 'micromark-extension-gfm-table';
+import { htmlComment } from '../vendor/micromark-extension-html-comment.js';
+import { mdxjs } from 'micromark-extension-mdxjs';
+
+declare module 'mdast' {
+ export interface PhrasingContentMap extends StaticPhrasingContentMap {
+ mdxJsxFlowElement: MdxJsxFlowElement;
+ mdxJsxTextElement: MdxJsxTextElement;
+ mdxFlowExpression: MdxFlowExpression;
+ mdxTextExpression: MdxTextExpression;
+ }
+}
+
+export function mdNodeIs(
+ node: UnNode | undefined,
+ type: T
+): node is T extends MdRoot['type']
+? MdRoot
+: T extends MdBlockquote['type']
+? MdBlockquote
+: T extends MdBreak['type']
+? MdBreak
+: T extends MdCode['type']
+? MdCode
+: T extends MdDefinition['type']
+? MdDefinition
+: T extends MdDelete['type']
+? MdDelete
+: T extends MdEmphasis['type']
+? MdEmphasis
+: T extends MdFootnote['type']
+? MdFootnote
+: T extends MdFootnoteDefinition['type']
+? MdFootnoteDefinition
+: T extends MdFootnoteReference['type']
+? MdFootnoteReference
+: T extends MdHTML['type']
+? MdHTML
+: T extends MdHeading['type']
+? MdHeading
+: T extends MdImage['type']
+? MdImage
+: T extends MdImageReference['type']
+? MdImageReference
+: T extends MdInlineCode['type']
+? MdInlineCode
+: T extends MdLink['type']
+? MdLink
+: T extends MdLinkReference['type']
+? MdLinkReference
+: T extends MdList['type']
+? MdList
+: T extends MdListItem['type']
+? MdListItem
+: T extends MdParagraph['type']
+? MdParagraph
+: T extends MdStrong['type']
+? MdStrong
+: T extends MdTable['type']
+? MdTable
+: T extends MdTableCell['type']
+? MdTableCell
+: T extends MdTableRow['type']
+? MdTableRow
+: T extends MdText['type']
+? MdText
+: T extends MdThematicBreak['type']
+? MdThematicBreak
+: T extends MdYaml
+? MdYaml
+: T extends MdxFlowExpression['type']
+? MdxFlowExpression
+: T extends MdxJsxAttribute['type']
+? MdxJsxAttribute
+: T extends MdxJsxAttributeValueExpression['type']
+? MdxJsxAttributeValueExpression
+: T extends MdxJsxExpressionAttribute['type']
+? MdxJsxExpressionAttribute
+: T extends MdxJsxFlowElement['type']
+? MdxJsxFlowElement
+: T extends MdxJsxTextElement['type']
+? MdxJsxTextElement
+: T extends MdxTextExpression['type']
+? MdxTextExpression
+: MdxjsEsm {
+ return node ? node.type === type : false;
+}
+
+export function mdNodeIsJsxElement(node: UnNode): node is MdxJsxFlowElement | MdxJsxTextElement {
+ return mdNodeIs(node, 'mdxJsxFlowElement') || mdNodeIs(node, 'mdxJsxTextElement');
+}
+
+/**
+ * Get MDX flavored `mdast`.
+ */
+export function getMdast(markdown: string): MdRoot {
+ return fromMarkdown(markdown, {
+ extensions: [frontmatter('yaml'), mdxjs(), gfmTable, htmlComment()],
+ mdastExtensions: [frontmatterFromMarkdown('yaml'), mdxFromMarkdown(), gfmTableFromMarkdown, htmlCommentFromMarkdown()]
+ });
+}
+
+export function getMarkdown(mdast: MdRoot): string {
+ return toMarkdown(mdast, {
+ extensions: [frontmatterToMarkdown('yaml'), mdxToMarkdown(), gfmTableToMarkdown(), htmlCommentToMarkdown()],
+ listItemIndent: 'one',
+ join: [
+ (__, _, parent) => {
+ if (mdNodeIsJsxElement(parent)) {
+ return 0;
+ }
+
+ // Keep list items tight (no blank lines between them)
+ if (mdNodeIs(parent, 'list')) {
+ return 0;
+ }
+ // Keep content within a list item tight (e.g. paragraph + nested sub-list)
+ if (mdNodeIs(parent, 'listItem')) {
+ return 0;
+ }
+ return 1;
+ }
+ ]
+ });
+}
+
+/**
+ * ============================================================
+ */
+
+export type MdNodeType =
+ | MdRoot['type']
+ | MdBlockquote['type']
+ | MdBreak['type']
+ | MdCode['type']
+ | MdDefinition['type']
+ | MdDelete['type']
+ | MdEmphasis['type']
+ | MdFootnote['type']
+ | MdFootnoteDefinition['type']
+ | MdFootnoteReference['type']
+ | MdHTML['type']
+ | MdHeading['type']
+ | MdImage['type']
+ | MdImageReference['type']
+ | MdInlineCode['type']
+ | MdLink['type']
+ | MdLinkReference['type']
+ | MdList['type']
+ | MdListItem['type']
+ | MdParagraph['type']
+ | MdStrong['type']
+ | MdTable['type']
+ | MdTableCell['type']
+ | MdTableRow['type']
+ | MdText['type']
+ | MdThematicBreak['type']
+ | MdYaml['type']
+ | MdxFlowExpression['type']
+ | MdxJsxAttribute['type']
+ | MdxJsxAttributeValueExpression['type']
+ | MdxJsxExpressionAttribute['type']
+ | MdxJsxFlowElement['type']
+ | MdxJsxTextElement['type']
+ | MdxTextExpression['type']
+ | MdxjsEsm['type'];
+
+export type {
+ MdRoot,
+ MdBlockquote,
+ MdBreak,
+ MdCode,
+ MdDefinition,
+ MdDelete,
+ MdEmphasis,
+ MdFootnote,
+ MdFootnoteDefinition,
+ MdFootnoteReference,
+ MdHTML,
+ MdHeading,
+ MdImage,
+ MdImageReference,
+ MdInlineCode,
+ MdLink,
+ MdLinkReference,
+ MdList,
+ MdListItem,
+ MdParagraph,
+ MdStrong,
+ MdTable,
+ MdTableCell,
+ MdTableRow,
+ MdText,
+ MdThematicBreak,
+ MdYaml
+};
+
+export type {
+ MdxFlowExpression,
+ MdxJsxAttribute,
+ MdxJsxAttributeValueExpression,
+ MdxJsxExpressionAttribute,
+ MdxJsxFlowElement,
+ MdxJsxTextElement,
+ MdxTextExpression,
+ MdxjsEsm
+};
diff --git a/packages/deepl-mark/src/ast/unist.ts b/packages/deepl-mark/src/ast/unist.ts
new file mode 100644
index 00000000..b578e00b
--- /dev/null
+++ b/packages/deepl-mark/src/ast/unist.ts
@@ -0,0 +1,19 @@
+import type { Position as UnPosition } from 'unist';
+
+export function unNodeIsParent(node: UnNode): node is UnParent {
+ return 'children' in node;
+}
+
+/**
+ * ============================================================
+ */
+
+export interface UnNode {
+ type: string;
+ position?: UnPosition;
+ data?: unknown;
+}
+
+export interface UnParent extends UnNode {
+ children: (UnNode | UnParent)[];
+}
diff --git a/packages/deepl-mark/src/ast/unwalk.ts b/packages/deepl-mark/src/ast/unwalk.ts
new file mode 100644
index 00000000..57cfbf22
--- /dev/null
+++ b/packages/deepl-mark/src/ast/unwalk.ts
@@ -0,0 +1,40 @@
+import { type UnNode, type UnParent, unNodeIsParent } from './unist.js';
+
+const NEXT = true;
+const STOP = false;
+
+export function unwalk(
+ node: UnNode,
+ visit: UnVisitor,
+ filter?: (node: UnNode, parent: UnParent | undefined) => boolean
+) {
+ let next = true;
+
+ function step(node: UnNode, parent: UnParent | undefined, index: number | undefined) {
+ if (filter && !filter(node, parent)) return;
+
+ if (unNodeIsParent(node)) {
+ for (let i = 0; i < node.children.length; i++) {
+ if (!next) break;
+
+ const child = node.children[i];
+ step(child, node, i);
+ }
+
+ node.children = node.children.filter((child) => child);
+ }
+
+ if (!next) return;
+
+ const signal = visit(node, parent, index);
+ next = signal === undefined || NEXT ? NEXT : STOP;
+ }
+
+ step(node, undefined, undefined);
+}
+
+export interface UnVisitor {
+ (node: UnNode | UnParent, parent: UnParent | undefined, index: number | undefined):
+ | boolean
+ | void;
+}
diff --git a/packages/deepl-mark/src/config.ts b/packages/deepl-mark/src/config.ts
new file mode 100644
index 00000000..6c10bbe1
--- /dev/null
+++ b/packages/deepl-mark/src/config.ts
@@ -0,0 +1,586 @@
+import type { SourceLanguageCode, TargetLanguageCode } from 'deepl-node';
+import type { MdNodeType } from './ast/mdast.js';
+import { isBoolean } from './utils.js';
+
+export interface ConfigBase {
+ /**
+ * Source's language code. Based on DeepL supported languages.
+ */
+ sourceLanguage: SourceLanguageCode;
+ /**
+ * Output's languages code. Based on DeepL supported languages.
+ */
+ outputLanguages: TargetLanguageCode[];
+ /**
+ * Sources and ouputs directories pairs. $langcode$ variable
+ * is provided to dynamically define directory.
+ *
+ * e.g. [ ["docs", "i18n/$langcode$/docs"], ["blog", "i18n/$langcode$/blog"] ]
+ */
+ directories: [string, string][];
+}
+
+export interface Config extends ConfigBase {
+ /**
+ * Override current working directory, defaults to `process.cwd()`.
+ */
+ cwd: string;
+ /**
+ * By default, all .md, .mdx, .json, and .yaml|.yml files inside
+ * source directories will be included.
+ *
+ * Define glob patterns to filter what files to include or exclude.
+ * But, the end result is still restricted by file types (.md, .mdx, .json).
+ */
+ files: {
+ include?: string[];
+ exclude: string[];
+ };
+ /**
+ * Frontmatter fields.
+ */
+ frontmatterFields: {
+ include: string[];
+ exclude: string[];
+ };
+ /**
+ * Markdown node types to include or exclude based on MDAST. Defaults to exclude `code` and `link`.
+ */
+ markdownNodes: {
+ default: boolean;
+ include: MdNodeType[];
+ exclude: MdNodeType[];
+ };
+ /**
+ * HTML elements to include and exlcude, down to the level of attributes
+ * and children. Include all HTML elements text content
+ * and some global attributes such as title and placeholder.
+ */
+ htmlElements: {
+ include: Partial<{ [Tag in HtmlTag]: { children: boolean; attributes: string[] } }>;
+ exclude: HtmlTag[];
+ };
+ /**
+ * JSX components to include and exclude, down to the level of attributes
+ * and children. Include all JSX components text children
+ * and exclude all attributes by default.
+ *
+ * Support array, object, and jsx attribute value. For object and array value,
+ * you can specify the access path starting with the attribute name
+ * e.g. `items.description` to translate `items={[{description: "..."}]}.
+ */
+ jsxComponents: {
+ default: boolean;
+ include: { [Name: string]: { children: boolean; attributes: string[] } };
+ exclude: string[];
+ };
+ /**
+ * JSON or YAML file properties to include and exclude.
+ * Exclude all properties by default.
+ */
+ jsonOrYamlProperties: {
+ include: (string | number | symbol)[];
+ exclude: (string | number | symbol)[];
+ };
+}
+
+export interface UserConfig extends ConfigBase {
+ /**
+ * Override current working directory, defaults to `process.cwd()`.
+ */
+ cwd?: string;
+ /**
+ * By default, all .md, .mdx, .json, and .yaml|.yml files inside
+ * source directories will be included.
+ *
+ * Define glob patterns to filter what files to include or exclude.
+ * But, the end result is still restricted by file types (.md, .mdx, .json).
+ */
+ files?: {
+ include?: string[];
+ exclude?: string[];
+ };
+ /**
+ * Frontmatter fields.
+ */
+ frontmatterFields?: {
+ include?: string[];
+ exclude?: string[];
+ };
+ /**
+ * Markdown node types to include or exclude based on MDAST. Defaults to exclude `code` and `link`.
+ */
+ markdownNodes?: {
+ default?: boolean;
+ include?: MdNodeType[];
+ exclude?: MdNodeType[];
+ };
+ /**
+ * HTML elements to include and exlcude, down to the level of attributes
+ * and children. Include all HTML elements text content
+ * and some global attributes such as title and placeholder.
+ */
+ htmlElements?: {
+ default?: boolean;
+ include?: Partial<{ [Tag in HtmlTag]: { children: boolean; attributes: string[] } }>;
+ exclude?: HtmlTag[];
+ };
+ /**
+ * JSX components to include and exclude, down to the level of attributes
+ * and children. Include all JSX components text children
+ * and exclude all attributes by default.
+ *
+ * Support array, object, and jsx attribute value. For object and array value,
+ * you can specify the access path starting with the attribute name
+ * e.g. `items.description` to translate `items={[{description: "..."}]}.
+ */
+ jsxComponents?: {
+ default?: boolean;
+ include?: { [Name: string]: { children: boolean; attributes: string[] } };
+ exclude?: string[];
+ };
+ /**
+ * JSON or YAML file properties to include and exclude.
+ * Exclude all properties by default.
+ */
+ jsonOrYamlProperties?: {
+ include?: string[];
+ exclude?: string[];
+ };
+}
+
+
+
+export type HtmlElementsConfig = { [Tag in HtmlTag]: { children: boolean; attributes: string[] } };
+
+export const HTML_ELEMENTS_CONFIG: HtmlElementsConfig = getHtmlElementsConfig();
+
+function getHtmlElementsConfig(): HtmlElementsConfig {
+ const includeChildren: HtmlTag[] = [
+ 'a',
+ 'abbr',
+ 'address',
+ 'article',
+ 'aside',
+ 'audio',
+ 'b',
+ 'bdi',
+ 'bdo',
+ 'blockquote',
+ 'body',
+ 'button',
+ 'canvas',
+ 'caption',
+ 'cite',
+ 'col',
+ 'colgroup',
+ 'data',
+ 'datalist',
+ 'dd',
+ 'del',
+ 'details',
+ 'dfn',
+ 'dialog',
+ 'div',
+ 'dl',
+ 'dt',
+ 'em',
+ 'fieldset',
+ 'figcaption',
+ 'figure',
+ 'footer',
+ 'form',
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'header',
+ 'html',
+ 'i',
+ 'input',
+ 'ins',
+ 'label',
+ 'legend',
+ 'li',
+ 'main',
+ 'mark',
+ 'meter',
+ 'nav',
+ 'ol',
+ 'optgroup',
+ 'output',
+ 'p',
+ 'progress',
+ 'q',
+ 'rp',
+ 's',
+ 'samp',
+ 'section',
+ 'select',
+ 'small',
+ 'span',
+ 'strong',
+ 'sub',
+ 'summary',
+ 'sup',
+ 'table',
+ 'tbody',
+ 'td',
+ 'template',
+ 'text-area',
+ 'tfoot',
+ 'th',
+ 'thead',
+ 'time',
+ 'title',
+ 'tr',
+ 'track',
+ 'u',
+ 'ul'
+ ];
+
+ const excludeChildren: HtmlTag[] = [
+ 'area',
+ 'base',
+ 'br',
+ 'code',
+ 'embed',
+ 'head',
+ 'hr',
+ 'iframe',
+ 'img',
+ 'kbd',
+ 'link',
+ 'meta',
+ 'noscript',
+ 'object',
+ 'param',
+ 'picture',
+ 'pre',
+ 'rt',
+ 'ruby',
+ 'script',
+ 'source',
+ 'style',
+ 'svg',
+ 'var',
+ 'video',
+ 'qbr'
+ ];
+
+ const config: Partial = {};
+
+ for (const tag of includeChildren) {
+ config[tag] = {
+ children: true,
+ attributes: ['title']
+ };
+ }
+
+ for (const tag of excludeChildren) {
+ config[tag] = {
+ children: false,
+ attributes: ['title']
+ };
+ }
+
+ return config as HtmlElementsConfig;
+}
+
+export const HTML_TAGS = Object.keys(HTML_ELEMENTS_CONFIG) as HtmlTag[];
+
+export function isHtmlTag(name: string): name is HtmlTag {
+ return HTML_TAGS.includes(name as HtmlTag);
+}
+
+export function resolveConfig({
+ sourceLanguage,
+ outputLanguages,
+ directories,
+ cwd,
+ files,
+ markdownNodes,
+ frontmatterFields,
+ htmlElements,
+ jsxComponents,
+ jsonOrYamlProperties
+}: UserConfig): Config {
+ return {
+ sourceLanguage,
+ outputLanguages,
+ directories,
+ cwd: cwd ?? '',
+ files: files
+ ? {
+ include: files.include,
+ exclude: files.exclude ?? []
+ }
+ : { exclude: [] },
+ markdownNodes: markdownNodes
+ ? {
+ default: isBoolean(markdownNodes.default) ? markdownNodes.default : true,
+ include: markdownNodes.include ?? [],
+ exclude: markdownNodes.exclude ?? ['code']
+ }
+ : { default: true, include: [], exclude: ['code'] },
+ frontmatterFields: frontmatterFields
+ ? {
+ include: frontmatterFields.include ?? [],
+ exclude: frontmatterFields.exclude ?? []
+ }
+ : { include: [], exclude: [] },
+
+ htmlElements: htmlElements
+ ? {
+ include: htmlElements.include
+ ? (isBoolean(htmlElements.default) && htmlElements.default) ||
+ htmlElements.default === undefined
+ ? { ...HTML_ELEMENTS_CONFIG, ...htmlElements.include }
+ : htmlElements.include
+ : isBoolean(htmlElements.default) && !htmlElements.default
+ ? {}
+ : HTML_ELEMENTS_CONFIG,
+ exclude: htmlElements.exclude ?? []
+ }
+ : { include: HTML_ELEMENTS_CONFIG, exclude: [] },
+ jsxComponents: jsxComponents
+ ? {
+ default: isBoolean(jsxComponents.default) ? jsxComponents.default : true,
+ include: jsxComponents.include ?? {},
+ exclude: jsxComponents.exclude ?? []
+ }
+ : { default: true, include: {}, exclude: [] },
+ jsonOrYamlProperties: jsonOrYamlProperties
+ ? { include: jsonOrYamlProperties.include ?? [], exclude: jsonOrYamlProperties.exclude ?? [] }
+ : { include: [], exclude: [] }
+ };
+}
+
+
+
+export function isFrontmatterFieldIncluded({
+ field,
+ config
+}: {
+ field: string;
+ config: Config;
+}): boolean {
+ return (
+ !config.frontmatterFields.exclude.includes(field) &&
+ config.frontmatterFields.include.includes(field)
+ );
+}
+
+export function isMarkdownNodeIncluded({
+ type,
+ config
+}: {
+ type: MdNodeType;
+ config: Config;
+}): boolean {
+ return (
+ !config.markdownNodes.exclude.includes(type) &&
+ (config.markdownNodes.default || config.markdownNodes.include.includes(type))
+ );
+}
+
+export function isHtmlElementIncluded({ tag, config }: { tag: HtmlTag; config: Config }): boolean {
+ return (
+ !config.htmlElements.exclude.includes(tag) &&
+ Object.keys(config.htmlElements.include).includes(tag)
+ );
+}
+
+export function isHtmlElementAttributeIncluded({
+ tag,
+ attribute,
+ config
+}: {
+ tag: HtmlTag;
+ attribute: string;
+ config: Config;
+}): boolean {
+ return (
+ isHtmlElementIncluded({ tag, config }) &&
+ config.htmlElements.include[tag]!.attributes.includes(attribute)
+ );
+}
+
+export function isHtmlElementChildrenIncluded({
+ tag,
+ config
+}: {
+ tag: HtmlTag;
+ config: Config;
+}): boolean {
+ return isHtmlElementIncluded({ tag, config }) && config.htmlElements.include[tag]!.children;
+}
+
+export function isJsxComponentIncluded({
+ name,
+ config
+}: {
+ name: string;
+ config: Config;
+}): boolean {
+ return (
+ !config.jsxComponents.exclude.includes(name) &&
+ (config.jsxComponents.default || Object.keys(config.jsxComponents.include).includes(name))
+ );
+}
+
+export function isJsxComponentAttributeIncluded({
+ name,
+ attribute,
+ config
+}: {
+ name: string;
+ attribute: string;
+ config: Config;
+}): boolean {
+ return (
+ !config.jsxComponents.exclude.includes(name) &&
+ Object.keys(config.jsxComponents.include).includes(name) &&
+ config.jsxComponents.include[name].attributes.includes(attribute)
+ );
+}
+
+export function isJsxComponentChildrenIncluded({
+ name,
+ config
+}: {
+ name: string;
+ config: Config;
+}): boolean {
+ return (
+ !config.jsxComponents.exclude.includes(name) &&
+ ((Object.keys(config.jsxComponents.include).includes(name) &&
+ config.jsxComponents.include[name].children) ||
+ (!Object.keys(config.jsxComponents.include).includes(name) && config.jsxComponents.default))
+ );
+}
+
+export function isJsonOrYamlPropertyIncluded({
+ property,
+ config
+}: {
+ config: Config;
+ property: string | number | symbol;
+}): boolean {
+ return (
+ !config.jsonOrYamlProperties.exclude.includes(property) &&
+ config.jsonOrYamlProperties.include.includes(property)
+ );
+}
+
+export type HtmlTag =
+ | 'a'
+ | 'abbr'
+ | 'address'
+ | 'article'
+ | 'aside'
+ | 'audio'
+ | 'b'
+ | 'bdi'
+ | 'bdo'
+ | 'blockquote'
+ | 'body'
+ | 'button'
+ | 'canvas'
+ | 'caption'
+ | 'cite'
+ | 'col'
+ | 'colgroup'
+ | 'data'
+ | 'datalist'
+ | 'dd'
+ | 'del'
+ | 'details'
+ | 'dfn'
+ | 'dialog'
+ | 'div'
+ | 'dl'
+ | 'dt'
+ | 'em'
+ | 'fieldset'
+ | 'figcaption'
+ | 'figure'
+ | 'footer'
+ | 'form'
+ | 'h1'
+ | 'h2'
+ | 'h3'
+ | 'h4'
+ | 'h5'
+ | 'h6'
+ | 'header'
+ | 'html'
+ | 'i'
+ | 'input'
+ | 'ins'
+ | 'label'
+ | 'legend'
+ | 'li'
+ | 'main'
+ | 'mark'
+ | 'meter'
+ | 'nav'
+ | 'ol'
+ | 'optgroup'
+ | 'output'
+ | 'p'
+ | 'progress'
+ | 'q'
+ | 'rp'
+ | 's'
+ | 'samp'
+ | 'section'
+ | 'select'
+ | 'small'
+ | 'span'
+ | 'strong'
+ | 'sub'
+ | 'summary'
+ | 'sup'
+ | 'table'
+ | 'tbody'
+ | 'td'
+ | 'template'
+ | 'text-area'
+ | 'tfoot'
+ | 'th'
+ | 'thead'
+ | 'time'
+ | 'title'
+ | 'tr'
+ | 'track'
+ | 'u'
+ | 'ul'
+ | 'area'
+ | 'base'
+ | 'br'
+ | 'code'
+ | 'embed'
+ | 'head'
+ | 'hr'
+ | 'iframe'
+ | 'img'
+ | 'kbd'
+ | 'link'
+ | 'meta'
+ | 'noscript'
+ | 'object'
+ | 'param'
+ | 'picture'
+ | 'pre'
+ | 'rt'
+ | 'ruby'
+ | 'script'
+ | 'source'
+ | 'style'
+ | 'svg'
+ | 'var'
+ | 'video'
+ | 'qbr';
diff --git a/packages/deepl-mark/src/extract.ts b/packages/deepl-mark/src/extract.ts
new file mode 100644
index 00000000..d856b60d
--- /dev/null
+++ b/packages/deepl-mark/src/extract.ts
@@ -0,0 +1,267 @@
+import { parse as parseYaml } from 'yaml';
+import {
+ EsJsxElement,
+ EsJsxIdentifier,
+ esNodeIs,
+ resolveEstreePropertyPath
+} from './ast/estree.js';
+import { eswalk } from './ast/eswalk.js';
+import { mdNodeIs, mdNodeIsJsxElement, MdNodeType } from './ast/mdast.js';
+import type { UnNode } from './ast/unist.js';
+import { unwalk } from './ast/unwalk.js';
+import {
+ type Config,
+ isHtmlTag,
+ isFrontmatterFieldIncluded,
+ isHtmlElementIncluded,
+ isHtmlElementAttributeIncluded,
+ isJsonOrYamlPropertyIncluded,
+ isJsxComponentIncluded,
+ isJsxComponentAttributeIncluded,
+ isMarkdownNodeIncluded,
+ isHtmlElementChildrenIncluded,
+ isJsxComponentChildrenIncluded
+} from './config.js';
+import { isArray, isEmptyArray, isEmptyString, isObject, isString } from './utils.js';
+
+export function extractMdastStrings({
+ mdast,
+ config
+}: {
+ mdast: UnNode;
+ config: Config;
+}): string[] {
+ const strings: string[] = [];
+
+ unwalk(
+ mdast,
+ (node, __, _) => {
+ if (mdNodeIs(node, 'text')) {
+ pushTidyString({ array: strings, string: node.value });
+ return;
+ }
+
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, 'mdxJsxAttribute')) continue;
+
+ if (
+ !isHtmlElementAttributeIncluded({ tag: node.name, attribute: attribute.name, config })
+ )
+ continue;
+
+ if (isString(attribute.value)) {
+ strings.push(attribute.value.trim());
+ } else if (attribute.value?.data?.estree) {
+ const estree = attribute.value.data.estree;
+
+ eswalk(estree, {
+ SimpleLiteral(esnode, _) {
+ if (isString(esnode.value))
+ pushTidyString({ array: strings, string: esnode.value });
+ }
+ });
+ }
+ }
+ } else {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, 'mdxJsxAttribute')) continue;
+
+ const componentName: string = node.name;
+
+ const isAttributeIncluded = isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: attribute.name,
+ config
+ });
+
+ if (isString(attribute.value)) {
+ if (!isAttributeIncluded) continue;
+
+ strings.push(attribute.value.trim());
+ } else if (attribute.value?.data?.estree) {
+ if (
+ !config.jsxComponents.include[componentName] ||
+ !config.jsxComponents.include[componentName].attributes.some(
+ (attrName) =>
+ attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ )
+ )
+ continue;
+
+ const estree = attribute.value.data.estree;
+
+ eswalk(estree, {
+ SimpleLiteral(esnode, _) {
+ if (isString(esnode.value))
+ pushTidyString({ array: strings, string: esnode.value });
+
+ if (esnode.value === 'aye') console.log('passed');
+ },
+ JSXElement(esnode, _) {
+ const name = (esnode.openingElement.name as EsJsxIdentifier).name;
+
+ if (isHtmlTag(name)) {
+ if (
+ !isHtmlElementIncluded({ tag: name, config }) ||
+ !isHtmlElementChildrenIncluded({ tag: name, config })
+ )
+ return false;
+ } else if (
+ !isJsxComponentIncluded({ name: name, config }) ||
+ !isJsxComponentChildrenIncluded({ name: name, config })
+ )
+ return false;
+ },
+ JSXAttribute(esnode, parents) {
+ const name =
+ typeof esnode.name.name === 'string' ? esnode.name.name : esnode.name.name.name;
+ const parentName = (
+ (parents[parents.length - 1] as EsJsxElement).openingElement
+ .name as EsJsxIdentifier
+ ).name;
+
+ if (isHtmlTag(parentName)) {
+ if (
+ !isHtmlElementAttributeIncluded({ tag: parentName, attribute: name, config })
+ )
+ return false;
+ } else if (
+ !config.jsxComponents.include[name] ||
+ !config.jsxComponents.include[name].attributes.some(
+ (attrName) =>
+ attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ )
+ ) {
+ return false;
+ }
+ },
+ JSXText(esnode, _) {
+ pushTidyString({ array: strings, string: esnode.value });
+ },
+ Property(esnode, parents) {
+ if (!esNodeIs(esnode, 'Identifier')) return false;
+
+ const propertyPath = resolveEstreePropertyPath(esnode, parents, attribute.name);
+
+ if (
+ !propertyPath ||
+ !isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: propertyPath,
+ config
+ })
+ )
+ return false;
+ }
+ });
+ }
+ }
+ }
+ }
+
+ if (mdNodeIs(node, 'yaml')) {
+ if (isEmptyArray(config.frontmatterFields.include)) return;
+ if (isEmptyString(node.value)) return;
+
+ const object: Record = parseYaml(node.value);
+
+ for (const field in object) {
+ if (!isFrontmatterFieldIncluded({ field, config })) continue;
+
+ const value = object[field];
+
+ if (isString(value)) {
+ strings.push(value);
+ continue;
+ }
+
+ if (isArray(value)) {
+ for (const item of value) {
+ if (!isString(item)) continue;
+ strings.push(item);
+ }
+ }
+ }
+
+ return;
+ }
+ },
+ (node, parent) => {
+ if (!isMarkdownNodeIncluded({ type: node.type as MdNodeType, config })) return false;
+
+ if (parent && mdNodeIsJsxElement(parent) && parent.name) {
+ if (isHtmlTag(parent.name)) {
+ if (!isHtmlElementChildrenIncluded({ tag: parent.name, config })) return false;
+ } else {
+ if (!isJsxComponentChildrenIncluded({ name: parent.name, config })) return false;
+ }
+
+ return true;
+ }
+
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ if (!isHtmlElementIncluded({ tag: node.name, config })) return false;
+ } else {
+ if (!isJsxComponentIncluded({ name: node.name, config })) return false;
+ }
+
+ return true;
+ }
+
+ return true;
+ }
+ );
+
+ return strings;
+}
+
+export function extractJsonOrYamlStrings({
+ source,
+ type = 'json',
+ config
+}: {
+ source: string;
+ type?: 'json' | 'yaml';
+ config: Config;
+}): string[] {
+ const strings: string[] = [];
+
+ if (isEmptyArray(config.jsonOrYamlProperties.include)) return strings;
+
+ const parsed = type === 'json' ? JSON.parse(source) : parseYaml(source);
+
+ process(parsed);
+
+ function process(value: unknown, property?: string) {
+ if (typeof value === 'string') {
+ if (property && isJsonOrYamlPropertyIncluded({ property, config })) strings.push(value);
+ return;
+ }
+
+ if (isArray(value)) {
+ for (const item of value) {
+ process(item);
+ }
+ return;
+ }
+
+ if (isObject(value)) {
+ for (const property in value) {
+ const item = (value as Record)[property];
+ process(item, property);
+ }
+ return;
+ }
+ }
+
+ return strings;
+}
+
+function pushTidyString({ array, string }: { array: string[]; string: string }) {
+ if (!/^\s*$/.test(string)) {
+ array.push(string.replace(/(^\n|\r|\t|\v)+\s*/, '').replace(/\s+$/, ' '));
+ }
+}
diff --git a/packages/deepl-mark/src/format.ts b/packages/deepl-mark/src/format.ts
new file mode 100644
index 00000000..edfca687
--- /dev/null
+++ b/packages/deepl-mark/src/format.ts
@@ -0,0 +1,42 @@
+import prettier from 'prettier';
+import { getMarkdown, getMdast, mdNodeIs } from './ast/mdast.js';
+import { unwalk } from './ast/unwalk.js';
+
+export async function format(markdown: string) {
+ /**
+ * `printWidth` is set to Infinity and `proseWrap` is set to never
+ * to avoid unnecessary linebreaks that break translation result
+ */
+ const mdast = getMdast(
+ await prettier.format(markdown, {
+ parser: 'mdx',
+ printWidth: Infinity,
+ proseWrap: 'never',
+ useTabs: true
+ })
+ );
+
+ /**
+ * remove empty surface flow expression nodes that sometimes
+ * are produced by prettier
+ */
+ unwalk(
+ mdast,
+ (node, parent, index) => {
+ if (mdNodeIs(node, 'mdxFlowExpression') && expressionIsEmpty(node.value)) {
+ (parent!.children[index!] as unknown) = undefined;
+ }
+ },
+ (node, parent) => {
+ delete node.position;
+ return mdNodeIs(parent, 'root');
+ }
+ );
+
+ return getMarkdown(mdast);
+}
+
+function expressionIsEmpty(text: string): boolean {
+ const regex = /^('|")\s*('|")$/;
+ return regex.test(text);
+}
diff --git a/packages/deepl-mark/src/index.ts b/packages/deepl-mark/src/index.ts
new file mode 100644
index 00000000..81261f83
--- /dev/null
+++ b/packages/deepl-mark/src/index.ts
@@ -0,0 +1,69 @@
+import type { SourceLanguageCode, TargetLanguageCode, TranslateTextOptions } from 'deepl-node';
+import { getMarkdown, getMdast } from './ast/mdast.js';
+import type { UserConfig } from './config.js';
+import { resolveConfig } from './config.js';
+import { extractMdastStrings } from './extract.js';
+import { format } from './format.js';
+import { replaceMdastStrings } from './replace.js';
+import { translateStrings } from './translate.js';
+
+/**
+ * Options to control which parts of the markdown are translated.
+ */
+export type TranslateOptions = Omit & {
+ /** DeepL API key. Falls back to `DEEPL_AUTH_KEY` env var if not provided. */
+ apiKey?: string;
+ /** DeepL translation options (tagHandling, splitSentences, formality, glossaryId, etc.) */
+ deeplOptions?: TranslateTextOptions;
+};
+
+/**
+ * Translate markdown/MDX content from one language to another using DeepL.
+ *
+ * Requires `DEEPL_AUTH_KEY` environment variable to be set.
+ *
+ * @param content - Markdown or MDX string to translate
+ * @param sourceLang - Source language code (e.g. 'en', 'de', 'fr')
+ * @param targetLang - Target language code (e.g. 'de', 'en-US', 'fr')
+ * @param options - Optional config to control extraction (frontmatter, jsx, html, etc.)
+ * @returns Translated markdown string
+ *
+ * @example
+ * ```ts
+ * import { translate } from 'deepmark';
+ *
+ * const result = await translate('# Hello World', 'en', 'de');
+ * console.log(result); // '# Hallo Welt'
+ * ```
+ */
+export async function translate(
+ content: string,
+ sourceLang: SourceLanguageCode,
+ targetLang: TargetLanguageCode,
+ options?: TranslateOptions
+): Promise {
+ const { apiKey, deeplOptions, ...configOptions } = options ?? {};
+
+ const config = resolveConfig({
+ sourceLanguage: sourceLang,
+ outputLanguages: [targetLang],
+ directories: [['', '']],
+ ...configOptions
+ });
+
+ // Format, parse, extract translatable strings
+ const formatted = await format(content);
+ const mdast = getMdast(formatted);
+ const strings = extractMdastStrings({ mdast, config });
+
+ if (strings.length === 0) return content;
+
+ // Translate via DeepL
+ const translated = await translateStrings(strings, sourceLang, targetLang, apiKey, deeplOptions);
+
+ // Replace strings in the AST and serialize back to markdown
+ const result = replaceMdastStrings({ mdast, strings: translated, config });
+ return getMarkdown(result);
+}
+
+export type { SourceLanguageCode, TargetLanguageCode, TranslateTextOptions } from 'deepl-node';
diff --git a/packages/deepl-mark/src/lint.ts b/packages/deepl-mark/src/lint.ts
new file mode 100644
index 00000000..e69de29b
diff --git a/packages/deepl-mark/src/replace.ts b/packages/deepl-mark/src/replace.ts
new file mode 100644
index 00000000..76a12b30
--- /dev/null
+++ b/packages/deepl-mark/src/replace.ts
@@ -0,0 +1,296 @@
+import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
+import {
+ EsJsxElement,
+ EsJsxIdentifier,
+ esNodeIs,
+ resolveEstreePropertyPath
+} from './ast/estree.js';
+import { eswalk } from './ast/eswalk.js';
+import type { MdNodeType, MdRoot } from './ast/mdast.js';
+import { mdNodeIs, mdNodeIsJsxElement } from './ast/mdast.js';
+import { unwalk } from './ast/unwalk.js';
+import {
+ type Config,
+ isHtmlTag,
+ isFrontmatterFieldIncluded,
+ isHtmlElementIncluded,
+ isHtmlElementAttributeIncluded,
+ isJsonOrYamlPropertyIncluded,
+ isJsxComponentIncluded,
+ isJsxComponentAttributeIncluded,
+ isMarkdownNodeIncluded,
+ isHtmlElementChildrenIncluded,
+ isJsxComponentChildrenIncluded
+} from './config.js';
+import { isArray, isEmptyArray, isEmptyString, isObject, isString } from './utils.js';
+
+export function replaceMdastStrings({
+ mdast,
+ config,
+ strings
+}: {
+ mdast: MdRoot;
+ strings: string[];
+ config: Config;
+}): MdRoot {
+ strings = strings.reverse();
+
+ unwalk(
+ mdast,
+ (node, __, _) => {
+ if (mdNodeIs(node, 'text')) {
+ node.value = strings.pop()!;
+ return;
+ }
+
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, 'mdxJsxAttribute')) continue;
+
+ if (
+ !isHtmlElementAttributeIncluded({ tag: node.name, attribute: attribute.name, config })
+ )
+ continue;
+
+ if (isString(attribute.value)) {
+ attribute.value = strings.pop();
+ } else if (attribute.value?.data?.estree) {
+ const estree = attribute.value.data.estree;
+
+ eswalk(estree, {
+ SimpleLiteral(esnode, _) {
+ if (isString(esnode.value)) esnode.value = strings.pop()!;
+ }
+ });
+ }
+ }
+ } else {
+ for (const attribute of node.attributes) {
+ if (!mdNodeIs(attribute, 'mdxJsxAttribute')) continue;
+
+ const componentName: string = node.name;
+
+ const isAttributeIncluded = isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: attribute.name,
+ config
+ });
+
+ if (isString(attribute.value)) {
+ if (!isAttributeIncluded) continue;
+
+ attribute.value = strings.pop();
+ } else if (attribute.value?.data?.estree) {
+ if (
+ !config.jsxComponents.include[componentName] ||
+ !config.jsxComponents.include[componentName].attributes.some(
+ (attrName) =>
+ attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ )
+ )
+ continue;
+
+ const estree = attribute.value.data.estree;
+
+ eswalk(estree, {
+ SimpleLiteral(esnode, _) {
+ if (isString(esnode.value)) esnode.value = strings.pop()!;
+ },
+ JSXElement(esnode, _) {
+ const name = (esnode.openingElement.name as EsJsxIdentifier).name;
+
+ if (isHtmlTag(name)) {
+ if (
+ !isHtmlElementIncluded({ tag: name, config }) ||
+ !isHtmlElementChildrenIncluded({ tag: name, config })
+ )
+ return false;
+ } else if (
+ !isJsxComponentIncluded({ name: name, config }) ||
+ !isJsxComponentChildrenIncluded({ name: name, config })
+ )
+ return false;
+ },
+ JSXAttribute(esnode, parents) {
+ const name =
+ typeof esnode.name.name === 'string' ? esnode.name.name : esnode.name.name.name;
+ const parentName = (
+ (parents[parents.length - 1] as EsJsxElement).openingElement
+ .name as EsJsxIdentifier
+ ).name;
+
+ if (isHtmlTag(parentName)) {
+ if (
+ !isHtmlElementAttributeIncluded({ tag: parentName, attribute: name, config })
+ )
+ return false;
+ } else if (
+ !config.jsxComponents.include[name] ||
+ !config.jsxComponents.include[name].attributes.some(
+ (attrName) =>
+ attrName === attribute.name || attrName.startsWith(`${attribute.name}.`)
+ )
+ ) {
+ return false;
+ }
+ },
+ JSXText(esnode, _) {
+ esnode.value = strings.pop()!;
+ },
+ Property(esnode, parents) {
+ if (!esNodeIs(esnode, 'Identifier')) return false;
+
+ const propertyPath = resolveEstreePropertyPath(esnode, parents, attribute.name);
+
+ if (
+ !propertyPath ||
+ !isJsxComponentAttributeIncluded({
+ name: componentName,
+ attribute: propertyPath,
+ config
+ })
+ )
+ return false;
+ }
+ });
+ }
+ }
+ }
+ }
+
+ if (mdNodeIs(node, 'yaml')) {
+ if (isEmptyArray(config.frontmatterFields.include)) return;
+ if (isEmptyString(node.value)) return;
+
+ const object: Record = parseYaml(node.value);
+
+ for (const field in object) {
+ if (!isFrontmatterFieldIncluded({ field, config })) continue;
+
+ const value = object[field];
+
+ if (isString(value)) {
+ object[field] = strings.pop();
+ continue;
+ }
+
+ if (isArray(value)) {
+ for (const [index, item] of value.entries()) {
+ if (!isString(item)) continue;
+ value[index] = strings.pop();
+ }
+ }
+ }
+
+ return;
+ }
+ },
+ (node, parent) => {
+ if (!isMarkdownNodeIncluded({ type: node.type as MdNodeType, config })) return false;
+
+ if (parent && mdNodeIsJsxElement(parent) && parent.name) {
+ if (isHtmlTag(parent.name)) {
+ if (!isHtmlElementChildrenIncluded({ tag: parent.name, config })) return false;
+ } else {
+ if (!isJsxComponentChildrenIncluded({ name: parent.name, config })) return false;
+ }
+
+ return true;
+ }
+
+ if (mdNodeIsJsxElement(node) && node.name) {
+ if (isHtmlTag(node.name)) {
+ if (!isHtmlElementIncluded({ tag: node.name, config })) return false;
+ } else {
+ if (!isJsxComponentIncluded({ name: node.name, config })) return false;
+ }
+
+ return true;
+ }
+
+ return true;
+ }
+ );
+
+ return mdast;
+}
+
+export function replaceJsonOrYamlStrings({
+ source,
+ type = 'json',
+ strings,
+ config
+}: {
+ source: string;
+ type?: 'json' | 'yaml';
+ strings: string[];
+ config: Config;
+}): string {
+ if (isEmptyArray(config.jsonOrYamlProperties.include)) return source;
+
+ strings = strings.reverse();
+ const parsed = type === 'json' ? JSON.parse(source) : parseYaml(source);
+
+ process({ value: parsed });
+
+ function process(args: { value: unknown; parent?: never; property?: never; index?: never }): void;
+ function process(args: {
+ value: unknown;
+ parent: unknown[];
+ property?: string | number | symbol;
+ index: number;
+ }): void;
+ function process(args: {
+ value: unknown;
+ parent: Record;
+ property: string | number | symbol;
+ index?: never;
+ }): void;
+ function process({
+ value,
+ parent,
+ property,
+ index
+ }: {
+ value: unknown;
+ parent?: unknown[] | Record;
+ property?: string | number | symbol;
+ index?: number;
+ }) {
+ if (isArray(value)) {
+ for (const [index, item] of value.entries()) {
+ process({ value: item, parent: value, property, index });
+ }
+ return;
+ }
+
+ if (isObject(value)) {
+ for (const property in value) {
+ const item = (value as Record)[property];
+ process({ value: item, parent: value, property });
+ }
+ return;
+ }
+
+ if (typeof value === 'string') {
+ if (property && isJsonOrYamlPropertyIncluded({ property, config })) {
+ if (isArray(parent) && index) {
+ parent[index] = strings.pop();
+
+ return;
+ }
+
+ if (isObject(parent)) {
+ parent[property] = strings.pop();
+
+ return;
+ }
+ }
+ return;
+ }
+ }
+
+ if (type === 'json') return JSON.stringify(parsed);
+ return stringifyYaml(parsed);
+}
diff --git a/packages/deepl-mark/src/translate.ts b/packages/deepl-mark/src/translate.ts
new file mode 100644
index 00000000..d222f7f0
--- /dev/null
+++ b/packages/deepl-mark/src/translate.ts
@@ -0,0 +1,62 @@
+import type { SourceLanguageCode, TargetLanguageCode, TranslateTextOptions } from 'deepl-node';
+import { Translator } from 'deepl-node';
+
+const DEFAULT_BATCH_SIZE = 50;
+const MAX_RETRIES = 3;
+
+/**
+ * Translate an array of strings from sourceLang to targetLang using DeepL.
+ * Batches requests and retries on rate-limit (429) or server (5xx) errors.
+ */
+export async function translateStrings(
+ strings: string[],
+ sourceLang: SourceLanguageCode,
+ targetLang: TargetLanguageCode,
+ apiKey?: string,
+ deeplOptions?: TranslateTextOptions,
+ batchSize: number = DEFAULT_BATCH_SIZE
+): Promise {
+ if (strings.length === 0) return [];
+
+ const key = apiKey ?? process.env.DEEPL_AUTH_KEY;
+ if (!key) throw new Error('DeepL API key must be provided via options.apiKey or DEEPL_AUTH_KEY environment variable');
+
+ const deepl = new Translator(key);
+ const translations: string[] = new Array(strings.length).fill('');
+
+ const textOptions: TranslateTextOptions = {
+ tagHandling: 'html',
+ splitSentences: 'nonewlines',
+ ...deeplOptions
+ };
+
+ for (let i = 0; i < strings.length; i += batchSize) {
+ const batch = strings.slice(i, i + batchSize);
+
+ const results = await retry(() =>
+ deepl.translateText(batch, sourceLang, targetLang, textOptions)
+ );
+
+ for (let j = 0; j < batch.length; j++) {
+ translations[i + j] = results[j].text;
+ }
+ }
+
+ return translations;
+}
+
+async function retry(fn: () => Promise, retries = MAX_RETRIES): Promise {
+ for (let attempt = 0; ; attempt++) {
+ try {
+ return await fn();
+ } catch (err: any) {
+ const status = err?.statusCode ?? err?.status;
+ const retryable = status === 429 || status === 456 || (status >= 500 && status < 600);
+
+ if (!retryable || attempt >= retries) throw err;
+
+ const delay = Math.min(1000 * 2 ** attempt, 10_000);
+ await new Promise((r) => setTimeout(r, delay));
+ }
+ }
+}
diff --git a/packages/deepl-mark/src/utils.ts b/packages/deepl-mark/src/utils.ts
new file mode 100644
index 00000000..48908a76
--- /dev/null
+++ b/packages/deepl-mark/src/utils.ts
@@ -0,0 +1,27 @@
+export function isArray(value: unknown): value is any[] {
+ return Array.isArray(value);
+}
+
+export function isBoolean(value: unknown): value is boolean {
+ return typeof value === 'boolean';
+}
+
+export function isEmptyArray(array: any[]): boolean {
+ return array.length === 0;
+}
+
+export function isEmptyObject(object: Object): boolean {
+ return Object.keys(object).length === 0;
+}
+
+export function isEmptyString(string: string): boolean {
+ return string.length === 0;
+}
+
+export function isObject(value: unknown): value is Record {
+ return isArray(value) ? false : typeof value == 'object' ? true : false;
+}
+
+export function isString(value: unknown): value is string {
+ return typeof value === 'string';
+}
diff --git a/packages/deepl-mark/src/vendor/mdast-util-html-comment.ts b/packages/deepl-mark/src/vendor/mdast-util-html-comment.ts
new file mode 100644
index 00000000..dbe45c57
--- /dev/null
+++ b/packages/deepl-mark/src/vendor/mdast-util-html-comment.ts
@@ -0,0 +1,40 @@
+// @ts-nocheck — vendored from mdast-util-html-comment, uses custom handler types
+import type { Extension } from 'mdast-util-from-markdown';
+import type { Options } from 'mdast-util-to-markdown';
+
+export function htmlCommentFromMarkdown(): Extension {
+ return {
+ canContainEols: ['htmlComment'],
+ enter: {
+ htmlComment() {
+ this.buffer();
+ }
+ },
+ exit: {
+ htmlComment(token) {
+ const string = this.resume();
+
+ this.enter(
+ {
+ // @ts-ignore
+ type: 'htmlComment',
+ value: string.slice(0, -3)
+ },
+ token
+ );
+
+ this.exit(token);
+ }
+ }
+ };
+}
+
+export function htmlCommentToMarkdown(): Options {
+ return {
+ handlers: {
+ htmlComment(node) {
+ return ``;
+ }
+ }
+ };
+}
diff --git a/packages/deepl-mark/src/vendor/micromark-extension-html-comment.ts b/packages/deepl-mark/src/vendor/micromark-extension-html-comment.ts
new file mode 100644
index 00000000..d0b25669
--- /dev/null
+++ b/packages/deepl-mark/src/vendor/micromark-extension-html-comment.ts
@@ -0,0 +1,128 @@
+// @ts-nocheck — vendored from micromark-extension-html-comment, uses custom token types
+import { factorySpace } from 'micromark-factory-space';
+import { markdownLineEnding } from 'micromark-util-character';
+import { codes } from 'micromark-util-symbol/codes.js';
+import { types } from 'micromark-util-symbol/types.js';
+import type { Code, Extension, HtmlExtension, State, Tokenizer } from 'micromark-util-types';
+
+export function htmlComment(): Extension {
+ return {
+ flow: {
+ [codes.lessThan]: { tokenize, concrete: true }
+ },
+ text: {
+ [codes.lessThan]: { tokenize }
+ }
+ };
+}
+
+export function htmlCommentToHtml(): HtmlExtension {
+ return {
+ enter: {
+ htmlComment() {
+ this.buffer();
+ }
+ },
+ exit: {
+ htmlComment() {
+ this.resume();
+ }
+ }
+ };
+}
+
+const tokenize: Tokenizer = (effects, ok, nok) => {
+ let value: string = '';
+
+ return start;
+
+ function start(code: Code): State | void {
+ effects.enter('htmlComment');
+ effects.enter('htmlCommentMarker');
+ effects.consume(code);
+ value += '<';
+
+ return open;
+ }
+
+ function open(code: Code): State | void {
+ if (value === '<' && code === codes.exclamationMark) {
+ effects.consume(code);
+ value += '!';
+ return open;
+ }
+
+ if (code === codes.dash) {
+ if (value === '= 6 && value.slice(-2) === '--') {
+ effects.consume(code);
+ effects.exit(types.data);
+ effects.exit('htmlCommentString');
+ effects.exit('htmlComment');
+ value += '>';
+
+ return ok;
+ }
+
+ return nok(code);
+ }
+};
diff --git a/packages/deepl-mark/tsconfig.json b/packages/deepl-mark/tsconfig.json
new file mode 100644
index 00000000..0052f00d
--- /dev/null
+++ b/packages/deepl-mark/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "allowJs": true,
+ "checkJs": true,
+ "forceConsistentCasingInFileNames": true,
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "lib": [
+ "ESNext"
+ ],
+ "noEmit": false,
+ "outDir": "./dist",
+ "rootDir": "src",
+ "skipLibCheck": true,
+ "sourceMap": true,
+ "strict": true,
+ "target": "ESNext"
+ },
+ "include": [
+ "src/**/*.ts"
+ ],
+ "exclude": [
+ "src/__test__/**"
+ ]
+}
\ No newline at end of file
diff --git a/packages/deepl-mark/vite.config.js b/packages/deepl-mark/vite.config.js
new file mode 100644
index 00000000..4121637d
--- /dev/null
+++ b/packages/deepl-mark/vite.config.js
@@ -0,0 +1,23 @@
+import { readFileSync } from 'fs';
+import np from 'path';
+
+const CWD = process.cwd();
+
+// Load .env into process.env for tests
+try {
+ const env = readFileSync(np.resolve(CWD, '.env'), 'utf-8');
+ for (const line of env.split('\n')) {
+ const match = line.match(/^\s*([\w.-]+)\s*=\s*"?([^"]*)"?\s*$/);
+ if (match) process.env[match[1]] ??= match[2];
+ }
+} catch { }
+
+/** @type { import('vite').UserConfig } */
+export default {
+ resolve: {
+ alias: {
+ $types: np.resolve(CWD, './src/types/index.js'),
+ $utils: np.resolve(CWD, './src/utils/index.js')
+ }
+ }
+};
diff --git a/packages/i18n/dist/commands/glossary.js b/packages/i18n/dist/commands/glossary.js
index f36d05f2..7efa11d5 100644
--- a/packages/i18n/dist/commands/glossary.js
+++ b/packages/i18n/dist/commands/glossary.js
@@ -17,7 +17,7 @@ const defaultOptions = (yargs) => {
describe: 'Target file',
}).option('dst', {
describe: 'Path to the output file(s). Glob patters are supported',
- default: '${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'
+ default: '${SRC_DIR}/${SRC_NAME}_${DST_LANG}${SRC_EXT}'
}).option('srcLang', {
describe: 'Source language. Please run `osr-i18n info to see all supported languages`',
default: ''
diff --git a/packages/i18n/dist/commands/translate.js b/packages/i18n/dist/commands/translate.js
index cd1862e4..b06cbd49 100644
--- a/packages/i18n/dist/commands/translate.js
+++ b/packages/i18n/dist/commands/translate.js
@@ -18,7 +18,7 @@ export const options = (yargs) => {
describe: 'Path to the input file(s). Glob patters are supported',
}).option('dst', {
describe: 'Path to the output file(s). Glob patters are supported',
- default: '${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'
+ default: '${SRC_DIR}/${SRC_NAME}_${DST_LANG}${SRC_EXT}'
}).option('formality', {
describe: 'Formality: default|more|less',
default: 'default'
diff --git a/packages/i18n/dist/lib/translate_document.js b/packages/i18n/dist/lib/translate_document.js
index dba25f74..d531e3d7 100644
--- a/packages/i18n/dist/lib/translate_document.js
+++ b/packages/i18n/dist/lib/translate_document.js
@@ -1,5 +1,7 @@
import { upload_document, check_document_status, download_document } from './deepl.js';
import * as fs from 'fs';
+import * as path from 'path';
+import { logger } from '../index.js';
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
export const translateDocument = async (src, dst, options) => {
const api_key = options.config?.deepl?.auth_key || options.api_key;
@@ -10,6 +12,10 @@ export const translateDocument = async (src, dst, options) => {
if (!src) {
throw new Error('Source file missing for document translation.');
}
+ if (options.cache === false && fs.existsSync(dst)) {
+ logger.info(`Destination document ${dst} already exists. Skipping DeepL translation based on cache=false.`);
+ return fs.readFileSync(dst);
+ }
const targetLangMatch = (options.dstLang || '').toUpperCase();
if (!targetLangMatch) {
throw new Error('Target language missing for document translation.');
@@ -28,33 +34,37 @@ export const translateDocument = async (src, dst, options) => {
deepLOptions.formality = options.formality;
}
try {
- console.log(`Uploading document for translation: ${src}`);
+ logger.info(`Uploading document for translation: ${src}`);
const { document_id, document_key } = await upload_document(deepLOptions, src);
let isDone = false;
- let pollInterval = 3000;
+ let pollInterval = 1500;
+ const startTime = Date.now();
+ const timeoutMs = 300000; // 5 minutes
while (!isDone) {
- console.log(`Checking status for document_id: ${document_id}`);
+ if (Date.now() - startTime > timeoutMs) {
+ throw new Error(`Document translation timed out after ${timeoutMs / 60000} minutes.`);
+ }
+ logger.info(`Checking status for document_id: ${document_id}`);
const statusRes = await check_document_status(api_key, document_id, document_key, is_free);
if (statusRes.status === 'done') {
isDone = true;
- console.log(`Translation finished. Billed characters: ${statusRes.billed_characters}`);
+ logger.info(`Translation finished. Billed characters: ${statusRes.billed_characters}`);
}
else if (statusRes.status === 'error') {
throw new Error(`DeepL Document Translation failed: ${statusRes.message}`);
}
else {
- const remaining = statusRes.seconds_remaining || 5;
- const waitTime = Math.max(pollInterval, remaining * 1000);
- console.log(`Status: ${statusRes.status}, waiting ${waitTime / 1000}s...`);
+ const waitTime = Math.round(pollInterval);
+ logger.info(`Status: ${statusRes.status}, waiting ${waitTime / 1000}s...`);
await delay(waitTime);
- // Backoff slightly to ensure we don't spam if seconds_remaining is inaccurate
+ // Backoff slightly to ensure we don't spam
pollInterval = Math.min(pollInterval * 1.5, 10000);
}
}
- console.log(`Downloading translated document...`);
+ logger.info(`Downloading translated document...`);
const fileBuffer = await download_document(api_key, document_id, document_key, is_free);
+ fs.mkdirSync(path.dirname(dst), { recursive: true });
fs.writeFileSync(dst, Buffer.from(fileBuffer));
- console.log(`Saved translated document to ${dst}`);
return fileBuffer;
}
catch (err) {
@@ -62,4 +72,4 @@ export const translateDocument = async (src, dst, options) => {
throw err;
}
};
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlX2RvY3VtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi90cmFuc2xhdGVfZG9jdW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUNILGVBQWUsRUFDZixxQkFBcUIsRUFDckIsaUJBQWlCLEVBRXBCLE1BQU0sWUFBWSxDQUFBO0FBQ25CLE9BQU8sS0FBSyxFQUFFLE1BQU0sSUFBSSxDQUFBO0FBRXhCLE1BQU0sS0FBSyxHQUFHLENBQUMsRUFBVSxFQUFFLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxPQUFPLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUU5RSxNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBRyxLQUFLLEVBQ2xDLEdBQVcsRUFDWCxHQUFXLEVBQ1gsT0FBaUIsRUFDbkIsRUFBRTtJQUNBLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLFFBQVEsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDO0lBQ25FLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLFFBQVEsSUFBSSxLQUFLLENBQUM7SUFFekQsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQ1gsTUFBTSxJQUFJLEtBQUssQ0FBQyw0QkFBNEIsQ0FBQyxDQUFDO0lBQ2xELENBQUM7SUFFRCxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUM7UUFDUCxNQUFNLElBQUksS0FBSyxDQUFDLCtDQUErQyxDQUFDLENBQUM7SUFDckUsQ0FBQztJQUNELE1BQU0sZUFBZSxHQUFHLENBQUMsT0FBTyxDQUFDLE9BQU8sSUFBSSxFQUFFLENBQUMsQ0FBQyxXQUFXLEVBQUUsQ0FBQztJQUM5RCxJQUFJLENBQUMsZUFBZSxFQUFFLENBQUM7UUFDbEIsTUFBTSxJQUFJLEtBQUssQ0FBQyxtREFBbUQsQ0FBQyxDQUFDO0lBQzFFLENBQUM7SUFFRCwwQkFBMEI7SUFDMUIsTUFBTSxZQUFZLEdBQWtCO1FBQ2hDLFFBQVEsRUFBRSxPQUFPO1FBQ2pCLFFBQVEsRUFBRSxPQUFPO1FBQ2pCLFdBQVcsRUFBRSxlQUFzQjtRQUNuQyxJQUFJLEVBQUUsRUFBRTtLQUNYLENBQUM7SUFFRixJQUFJLE9BQU8sQ0FBQyxPQUFPLEVBQUUsQ0FBQztRQUNsQixZQUFZLENBQUMsV0FBVyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFTLENBQUM7SUFDcEUsQ0FBQztJQUNELElBQUksT0FBTyxDQUFDLFNBQVMsSUFBSSxPQUFPLENBQUMsU0FBUyxLQUFLLFNBQVMsRUFBRSxDQUFDO1FBQ3ZELFlBQVksQ0FBQyxTQUFTLEdBQUcsT0FBTyxDQUFDLFNBQWdCLENBQUM7SUFDdEQsQ0FBQztJQUVELElBQUksQ0FBQztRQUNELE9BQU8sQ0FBQyxHQUFHLENBQUMsdUNBQXVDLEdBQUcsRUFBRSxDQUFDLENBQUM7UUFDMUQsTUFBTSxFQUFFLFdBQVcsRUFBRSxZQUFZLEVBQUUsR0FBRyxNQUFNLGVBQWUsQ0FBQyxZQUFZLEVBQUUsR0FBRyxDQUFDLENBQUM7UUFFL0UsSUFBSSxNQUFNLEdBQUcsS0FBSyxDQUFDO1FBQ25CLElBQUksWUFBWSxHQUFHLElBQUksQ0FBQztRQUV4QixPQUFPLENBQUMsTUFBTSxFQUFFLENBQUM7WUFDYixPQUFPLENBQUMsR0FBRyxDQUFDLG9DQUFvQyxXQUFXLEVBQUUsQ0FBQyxDQUFDO1lBQy9ELE1BQU0sU0FBUyxHQUFHLE1BQU0scUJBQXFCLENBQUMsT0FBTyxFQUFFLFdBQVcsRUFBRSxZQUFZLEVBQUUsT0FBTyxDQUFDLENBQUM7WUFFM0YsSUFBSSxTQUFTLENBQUMsTUFBTSxLQUFLLE1BQU0sRUFBRSxDQUFDO2dCQUM5QixNQUFNLEdBQUcsSUFBSSxDQUFDO2dCQUNkLE9BQU8sQ0FBQyxHQUFHLENBQUMsNENBQTRDLFNBQVMsQ0FBQyxpQkFBaUIsRUFBRSxDQUFDLENBQUM7WUFDM0YsQ0FBQztpQkFBTSxJQUFJLFNBQVMsQ0FBQyxNQUFNLEtBQUssT0FBTyxFQUFFLENBQUM7Z0JBQ3RDLE1BQU0sSUFBSSxLQUFLLENBQUMsc0NBQXNDLFNBQVMsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDO1lBQy9FLENBQUM7aUJBQU0sQ0FBQztnQkFDSixNQUFNLFNBQVMsR0FBRyxTQUFTLENBQUMsaUJBQWlCLElBQUksQ0FBQyxDQUFDO2dCQUNuRCxNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLFlBQVksRUFBRSxTQUFTLEdBQUcsSUFBSSxDQUFDLENBQUM7Z0JBQzFELE9BQU8sQ0FBQyxHQUFHLENBQUMsV0FBVyxTQUFTLENBQUMsTUFBTSxhQUFhLFFBQVEsR0FBRyxJQUFJLE1BQU0sQ0FBQyxDQUFDO2dCQUMzRSxNQUFNLEtBQUssQ0FBQyxRQUFRLENBQUMsQ0FBQztnQkFDdEIsOEVBQThFO2dCQUM5RSxZQUFZLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxZQUFZLEdBQUcsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO1lBQ3ZELENBQUM7UUFDTCxDQUFDO1FBRUQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxvQ0FBb0MsQ0FBQyxDQUFDO1FBQ2xELE1BQU0sVUFBVSxHQUFHLE1BQU0saUJBQWlCLENBQUMsT0FBTyxFQUFFLFdBQVcsRUFBRSxZQUFZLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFFeEYsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsTUFBTSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1FBQy9DLE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0NBQWdDLEdBQUcsRUFBRSxDQUFDLENBQUM7UUFFbkQsT0FBTyxVQUFVLENBQUM7SUFFdEIsQ0FBQztJQUFDLE9BQU8sR0FBUSxFQUFFLENBQUM7UUFDaEIsT0FBTyxDQUFDLEtBQUssQ0FBQyxzQ0FBc0MsR0FBRyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBQUM7UUFDbkUsTUFBTSxHQUFHLENBQUM7SUFDZCxDQUFDO0FBQ0wsQ0FBQyxDQUFBIn0=
\ No newline at end of file
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRlX2RvY3VtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi90cmFuc2xhdGVfZG9jdW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUNILGVBQWUsRUFDZixxQkFBcUIsRUFDckIsaUJBQWlCLEVBRXBCLE1BQU0sWUFBWSxDQUFBO0FBQ25CLE9BQU8sS0FBSyxFQUFFLE1BQU0sSUFBSSxDQUFBO0FBQ3hCLE9BQU8sS0FBSyxJQUFJLE1BQU0sTUFBTSxDQUFBO0FBQzVCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxhQUFhLENBQUE7QUFFcEMsTUFBTSxLQUFLLEdBQUcsQ0FBQyxFQUFVLEVBQUUsRUFBRSxDQUFDLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLE9BQU8sRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBRTlFLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLEtBQUssRUFDbEMsR0FBVyxFQUNYLEdBQVcsRUFDWCxPQUFpQixFQUNuQixFQUFFO0lBQ0EsTUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLE1BQU0sRUFBRSxLQUFLLEVBQUUsUUFBUSxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUM7SUFDbkUsTUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLE1BQU0sRUFBRSxLQUFLLEVBQUUsUUFBUSxJQUFJLEtBQUssQ0FBQztJQUV6RCxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDWCxNQUFNLElBQUksS0FBSyxDQUFDLDRCQUE0QixDQUFDLENBQUM7SUFDbEQsQ0FBQztJQUVELElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUNQLE1BQU0sSUFBSSxLQUFLLENBQUMsK0NBQStDLENBQUMsQ0FBQztJQUNyRSxDQUFDO0lBRUQsSUFBSSxPQUFPLENBQUMsS0FBSyxLQUFLLEtBQUssSUFBSSxFQUFFLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUM7UUFDaEQsTUFBTSxDQUFDLElBQUksQ0FBQyx3QkFBd0IsR0FBRyxtRUFBbUUsQ0FBQyxDQUFDO1FBQzVHLE9BQU8sRUFBRSxDQUFDLFlBQVksQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUNoQyxDQUFDO0lBRUQsTUFBTSxlQUFlLEdBQUcsQ0FBQyxPQUFPLENBQUMsT0FBTyxJQUFJLEVBQUUsQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDO0lBQzlELElBQUksQ0FBQyxlQUFlLEVBQUUsQ0FBQztRQUNuQixNQUFNLElBQUksS0FBSyxDQUFDLG1EQUFtRCxDQUFDLENBQUM7SUFDekUsQ0FBQztJQUVELDBCQUEwQjtJQUMxQixNQUFNLFlBQVksR0FBa0I7UUFDaEMsUUFBUSxFQUFFLE9BQU87UUFDakIsUUFBUSxFQUFFLE9BQU87UUFDakIsV0FBVyxFQUFFLGVBQXNCO1FBQ25DLElBQUksRUFBRSxFQUFFO0tBQ1gsQ0FBQztJQUVGLElBQUksT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQ2xCLFlBQVksQ0FBQyxXQUFXLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQVMsQ0FBQztJQUNwRSxDQUFDO0lBQ0QsSUFBSSxPQUFPLENBQUMsU0FBUyxJQUFJLE9BQU8sQ0FBQyxTQUFTLEtBQUssU0FBUyxFQUFFLENBQUM7UUFDdkQsWUFBWSxDQUFDLFNBQVMsR0FBRyxPQUFPLENBQUMsU0FBZ0IsQ0FBQztJQUN0RCxDQUFDO0lBRUQsSUFBSSxDQUFDO1FBQ0QsTUFBTSxDQUFDLElBQUksQ0FBQyx1Q0FBdUMsR0FBRyxFQUFFLENBQUMsQ0FBQztRQUMxRCxNQUFNLEVBQUUsV0FBVyxFQUFFLFlBQVksRUFBRSxHQUFHLE1BQU0sZUFBZSxDQUFDLFlBQVksRUFBRSxHQUFHLENBQUMsQ0FBQztRQUUvRSxJQUFJLE1BQU0sR0FBRyxLQUFLLENBQUM7UUFDbkIsSUFBSSxZQUFZLEdBQUcsSUFBSSxDQUFDO1FBQ3hCLE1BQU0sU0FBUyxHQUFHLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUM3QixNQUFNLFNBQVMsR0FBRyxNQUFNLENBQUMsQ0FBQyxZQUFZO1FBRXRDLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUNiLElBQUksSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLFNBQVMsR0FBRyxTQUFTLEVBQUUsQ0FBQztnQkFDckMsTUFBTSxJQUFJLEtBQUssQ0FBQyx3Q0FBd0MsU0FBUyxHQUFHLEtBQUssV0FBVyxDQUFDLENBQUM7WUFDMUYsQ0FBQztZQUVELE1BQU0sQ0FBQyxJQUFJLENBQUMsb0NBQW9DLFdBQVcsRUFBRSxDQUFDLENBQUM7WUFDL0QsTUFBTSxTQUFTLEdBQUcsTUFBTSxxQkFBcUIsQ0FBQyxPQUFPLEVBQUUsV0FBVyxFQUFFLFlBQVksRUFBRSxPQUFPLENBQUMsQ0FBQztZQUUzRixJQUFJLFNBQVMsQ0FBQyxNQUFNLEtBQUssTUFBTSxFQUFFLENBQUM7Z0JBQzlCLE1BQU0sR0FBRyxJQUFJLENBQUM7Z0JBQ2QsTUFBTSxDQUFDLElBQUksQ0FBQyw0Q0FBNEMsU0FBUyxDQUFDLGlCQUFpQixFQUFFLENBQUMsQ0FBQztZQUMzRixDQUFDO2lCQUFNLElBQUksU0FBUyxDQUFDLE1BQU0sS0FBSyxPQUFPLEVBQUUsQ0FBQztnQkFDdEMsTUFBTSxJQUFJLEtBQUssQ0FBQyxzQ0FBc0MsU0FBUyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBQUM7WUFDL0UsQ0FBQztpQkFBTSxDQUFDO2dCQUNKLE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDLENBQUM7Z0JBQzFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsV0FBVyxTQUFTLENBQUMsTUFBTSxhQUFhLFFBQVEsR0FBRyxJQUFJLE1BQU0sQ0FBQyxDQUFDO2dCQUMzRSxNQUFNLEtBQUssQ0FBQyxRQUFRLENBQUMsQ0FBQztnQkFDdEIsMkNBQTJDO2dCQUMzQyxZQUFZLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxZQUFZLEdBQUcsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO1lBQ3ZELENBQUM7UUFDTCxDQUFDO1FBQ0QsTUFBTSxDQUFDLElBQUksQ0FBQyxvQ0FBb0MsQ0FBQyxDQUFDO1FBQ2xELE1BQU0sVUFBVSxHQUFHLE1BQU0saUJBQWlCLENBQUMsT0FBTyxFQUFFLFdBQVcsRUFBRSxZQUFZLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFDeEYsRUFBRSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUM7UUFDckQsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsTUFBTSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1FBQy9DLE9BQU8sVUFBVSxDQUFDO0lBRXRCLENBQUM7SUFBQyxPQUFPLEdBQVEsRUFBRSxDQUFDO1FBQ2hCLE9BQU8sQ0FBQyxLQUFLLENBQUMsc0NBQXNDLEdBQUcsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDO1FBQ25FLE1BQU0sR0FBRyxDQUFDO0lBQ2QsQ0FBQztBQUNMLENBQUMsQ0FBQSJ9
\ No newline at end of file
diff --git a/packages/i18n/dist/zod_schema_cli.js b/packages/i18n/dist/zod_schema_cli.js
index 63344513..ed33dce9 100644
--- a/packages/i18n/dist/zod_schema_cli.js
+++ b/packages/i18n/dist/zod_schema_cli.js
@@ -6,7 +6,7 @@ export const TranslateOptionsSchema = z.object({
dry: z.boolean().default(false),
env_key: z.string().default('OSR-CONFIG'),
src: z.string().optional(),
- dst: z.string().default('${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'),
+ dst: z.string().default('${SRC_DIR}/${SRC_NAME}_${DST_LANG}${SRC_EXT}'),
formality: z.enum(formalityLevels).default('default'),
srcLang: z.string().default(''),
cache: z.boolean().default(false),
diff --git a/packages/i18n/package-lock.json b/packages/i18n/package-lock.json
index 6b5c349f..851e71a2 100644
--- a/packages/i18n/package-lock.json
+++ b/packages/i18n/package-lock.json
@@ -12,6 +12,7 @@
"@polymech/cache": "file:../cache",
"@polymech/commons": "file:../commons",
"@polymech/core": "file:../core",
+ "@polymech/deepl-mark": "file:../deepl-mark",
"@polymech/fs": "file:../fs",
"@polymech/log": "file:../log",
"@types/html-minifier-terser": "^7.0.2",
@@ -122,6 +123,41 @@
"typescript": "^5.7.3"
}
},
+ "../deepl-mark": {
+ "name": "@polymech/deepl-mark",
+ "version": "0.3.0",
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.8.2",
+ "acorn-jsx": "^5.3.2",
+ "astring": "^1.8.4",
+ "deepl-node": "^1.24.0",
+ "mdast-util-from-markdown": "^1.3.0",
+ "mdast-util-frontmatter": "^1.0.1",
+ "mdast-util-gfm-table": "^1.0.7",
+ "mdast-util-mdx": "^2.0.1",
+ "mdast-util-to-markdown": "^1.5.0",
+ "micromark-extension-frontmatter": "^1.0.0",
+ "micromark-extension-gfm-table": "^1.0.7",
+ "micromark-extension-mdxjs": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.1.0",
+ "micromark-util-symbol": "^1.0.1",
+ "micromark-util-types": "^1.0.2",
+ "prettier": "^2.8.3",
+ "yaml": "^2.2.1"
+ },
+ "devDependencies": {
+ "@types/estree": "^1.0.0",
+ "@types/mdast": "^3.0.10",
+ "@types/node": "^25.3.3",
+ "@types/prettier": "^2.7.2",
+ "@types/unist": "^2.0.6",
+ "esbuild": "^0.25.0",
+ "typescript": "^5.9.3",
+ "vitest": "^3.0.0"
+ }
+ },
"../fs": {
"name": "@polymech/fs",
"version": "0.13.41",
@@ -332,6 +368,10 @@
"resolved": "../core",
"link": true
},
+ "node_modules/@polymech/deepl-mark": {
+ "resolved": "../deepl-mark",
+ "link": true
+ },
"node_modules/@polymech/fs": {
"resolved": "../fs",
"link": true
diff --git a/packages/i18n/package.json b/packages/i18n/package.json
index 222c8a9a..f0b3cb42 100644
--- a/packages/i18n/package.json
+++ b/packages/i18n/package.json
@@ -43,6 +43,7 @@
"@polymech/cache": "file:../cache",
"@polymech/commons": "file:../commons",
"@polymech/core": "file:../core",
+ "@polymech/deepl-mark": "file:../deepl-mark",
"@polymech/fs": "file:../fs",
"@polymech/log": "file:../log",
"@types/html-minifier-terser": "^7.0.2",
@@ -75,6 +76,7 @@
},
"scripts": {
"test": "vitest run",
+ "test:document": "npm run test -- tests/document.e2e.test.ts",
"test-with-coverage": "vitest run --coverage",
"dev-test-watch": "vitest",
"lint": "tslint --project=./tsconfig.json",
@@ -102,4 +104,4 @@
"vitest": "^4.1.2",
"webpack-cli": "^7.0.2"
}
-}
+}
\ No newline at end of file
diff --git a/packages/i18n/salamand.json b/packages/i18n/salamand.json
index edcf8ebc..9d70de1e 100644
--- a/packages/i18n/salamand.json
+++ b/packages/i18n/salamand.json
@@ -1,8 +1,8 @@
{
"translate-es": {
- "name": "Translate to EU Languages",
+ "name": "Translate to Spanish - Internal",
"command": "pm-i18n",
- "args": "translate --alt=true --src=\"$(FullName)\" --dst=\"&{SRC_DIR}/&{SRC_NAME}_&{DST_LANG}.md\" --srcLang='en' --dstLang='es,de,it,fr'",
+ "args": "translate --alt=true --src=\"$(FullName)\" --dst=\"&{SRC_DIR}/&{SRC_NAME}_&{DST_LANG}.md\" --srcLang='en' --dstLang='es'",
"description": "Translate to EU"
}
-}
+}
\ No newline at end of file
diff --git a/packages/i18n/src/commands/glossary.ts b/packages/i18n/src/commands/glossary.ts
index 212f68a7..6bba5cb9 100644
--- a/packages/i18n/src/commands/glossary.ts
+++ b/packages/i18n/src/commands/glossary.ts
@@ -20,7 +20,7 @@ const defaultOptions = (yargs: CLI.Argv) => {
describe: 'Target file',
}).option('dst', {
describe: 'Path to the output file(s). Glob patters are supported',
- default: '${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'
+ default: '${SRC_DIR}/${SRC_NAME}_${DST_LANG}${SRC_EXT}'
}).option('srcLang', {
describe: 'Source language. Please run `osr-i18n info to see all supported languages`',
default: ''
diff --git a/packages/i18n/src/commands/translate.ts b/packages/i18n/src/commands/translate.ts
index 52f9888e..fab92cf6 100644
--- a/packages/i18n/src/commands/translate.ts
+++ b/packages/i18n/src/commands/translate.ts
@@ -22,7 +22,7 @@ export const options = (yargs: CLI.Argv) => {
describe: 'Path to the input file(s). Glob patters are supported',
}).option('dst', {
describe: 'Path to the output file(s). Glob patters are supported',
- default: '${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'
+ default: '${SRC_DIR}/${SRC_NAME}_${DST_LANG}${SRC_EXT}'
}).option('formality', {
describe: 'Formality: default|more|less',
default: 'default'
diff --git a/packages/i18n/src/lib/translate_document.ts b/packages/i18n/src/lib/translate_document.ts
index 7587c5ed..c4de90d7 100644
--- a/packages/i18n/src/lib/translate_document.ts
+++ b/packages/i18n/src/lib/translate_document.ts
@@ -6,6 +6,8 @@ import {
IDeepLOptions
} from './deepl.js'
import * as fs from 'fs'
+import * as path from 'path'
+import { logger } from '../index.js'
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
@@ -16,19 +18,25 @@ export const translateDocument = async (
) => {
const api_key = options.config?.deepl?.auth_key || options.api_key;
const is_free = options.config?.deepl?.free_api || false;
-
+
if (!api_key) {
throw new Error('DeepL auth_key is missing.');
}
-
+
if (!src) {
throw new Error('Source file missing for document translation.');
}
+
+ if (options.cache === false && fs.existsSync(dst)) {
+ logger.info(`Destination document ${dst} already exists. Skipping DeepL translation based on cache=false.`);
+ return fs.readFileSync(dst);
+ }
+
const targetLangMatch = (options.dstLang || '').toUpperCase();
if (!targetLangMatch) {
- throw new Error('Target language missing for document translation.');
+ throw new Error('Target language missing for document translation.');
}
-
+
// Structure DeepL Options
const deepLOptions: IDeepLOptions = {
free_api: is_free,
@@ -36,7 +44,7 @@ export const translateDocument = async (
target_lang: targetLangMatch as any,
text: ''
};
-
+
if (options.srcLang) {
deepLOptions.source_lang = options.srcLang.toUpperCase() as any;
}
@@ -45,39 +53,41 @@ export const translateDocument = async (
}
try {
- console.log(`Uploading document for translation: ${src}`);
+ logger.info(`Uploading document for translation: ${src}`);
const { document_id, document_key } = await upload_document(deepLOptions, src);
-
+
let isDone = false;
- let pollInterval = 3000;
-
+ let pollInterval = 1500;
+ const startTime = Date.now();
+ const timeoutMs = 300000; // 5 minutes
+
while (!isDone) {
- console.log(`Checking status for document_id: ${document_id}`);
+ if (Date.now() - startTime > timeoutMs) {
+ throw new Error(`Document translation timed out after ${timeoutMs / 60000} minutes.`);
+ }
+
+ logger.info(`Checking status for document_id: ${document_id}`);
const statusRes = await check_document_status(api_key, document_id, document_key, is_free);
-
+
if (statusRes.status === 'done') {
isDone = true;
- console.log(`Translation finished. Billed characters: ${statusRes.billed_characters}`);
+ logger.info(`Translation finished. Billed characters: ${statusRes.billed_characters}`);
} else if (statusRes.status === 'error') {
throw new Error(`DeepL Document Translation failed: ${statusRes.message}`);
} else {
- const remaining = statusRes.seconds_remaining || 5;
- const waitTime = Math.max(pollInterval, remaining * 1000);
- console.log(`Status: ${statusRes.status}, waiting ${waitTime / 1000}s...`);
+ const waitTime = Math.round(pollInterval);
+ logger.info(`Status: ${statusRes.status}, waiting ${waitTime / 1000}s...`);
await delay(waitTime);
- // Backoff slightly to ensure we don't spam if seconds_remaining is inaccurate
- pollInterval = Math.min(pollInterval * 1.5, 10000);
+ // Backoff slightly to ensure we don't spam
+ pollInterval = Math.min(pollInterval * 1.5, 10000);
}
}
-
- console.log(`Downloading translated document...`);
+ logger.info(`Downloading translated document...`);
const fileBuffer = await download_document(api_key, document_id, document_key, is_free);
-
+ fs.mkdirSync(path.dirname(dst), { recursive: true });
fs.writeFileSync(dst, Buffer.from(fileBuffer));
- console.log(`Saved translated document to ${dst}`);
-
return fileBuffer;
-
+
} catch (err: any) {
console.error(`Error during document translation: ${err.message}`);
throw err;
diff --git a/packages/i18n/src/zod_schema_cli.ts b/packages/i18n/src/zod_schema_cli.ts
index 7e71e2bb..7e4d098d 100644
--- a/packages/i18n/src/zod_schema_cli.ts
+++ b/packages/i18n/src/zod_schema_cli.ts
@@ -8,7 +8,7 @@ export const TranslateOptionsSchema = z.object({
dry: z.boolean().default(false),
env_key: z.string().default('OSR-CONFIG'),
src: z.string().optional(),
- dst: z.string().default('${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'),
+ dst: z.string().default('${SRC_DIR}/${SRC_NAME}_${DST_LANG}${SRC_EXT}'),
formality: z.enum(formalityLevels).default('default'),
srcLang: z.string().default(''),
cache: z.boolean().default(false),
diff --git a/packages/i18n/tests/document.e2e.test.ts b/packages/i18n/tests/document.e2e.test.ts
index cd7642bb..0ccd290e 100644
--- a/packages/i18n/tests/document.e2e.test.ts
+++ b/packages/i18n/tests/document.e2e.test.ts
@@ -12,27 +12,47 @@ describe('DeepL Document API Translation (Live)', () => {
it('should translate test.pdf natively as a document', async () => {
const srcPath = path.resolve(process.cwd(), 'tests/documents/test.pdf');
+ const dstPath = path.resolve(process.cwd(), 'tests/documents/test_de.pdf');
// Assert the test file exists before running
expect(fs.existsSync(srcPath)).toBe(true);
+ // Clean up any old output file
+ if (fs.existsSync(dstPath)) {
+ fs.unlinkSync(dstPath);
+ }
+
const { stdout, stderr } = await exec(`node ${CLI_PATH} translate --src="${srcPath}" --srcLang="en" --dstLang="de"`);
console.log(stdout, stderr);
// We verify the translation loop succeeds without errors.
expect(stderr).not.toMatch(/error/i);
- }, 60000); // 60s timeout for real API call
+
+ // Verify that the output document got downloaded correctly
+ expect(fs.existsSync(dstPath)).toBe(true);
+ expect(fs.statSync(dstPath).size).toBeGreaterThan(0);
+ }, 120000); // 120s timeout for real API call
it('should translate test.xlsx as a document specifically requesting engine=document', async () => {
const srcPath = path.resolve(process.cwd(), 'tests/documents/test.xlsx');
+ const dstPath = path.resolve(process.cwd(), 'tests/documents/test_de.xlsx');
// Assert the test file exists before running
expect(fs.existsSync(srcPath)).toBe(true);
+ // Clean up any old output file
+ if (fs.existsSync(dstPath)) {
+ fs.unlinkSync(dstPath);
+ }
+
const { stdout, stderr } = await exec(`node ${CLI_PATH} translate --src="${srcPath}" --srcLang="en" --dstLang="de" --engine="document"`);
console.log(stdout, stderr);
// We verify the translation loop succeeds without errors.
expect(stderr).not.toMatch(/error/i);
- }, 60000); // 60s timeout for real API call
+
+ // Verify that the output document got downloaded correctly
+ expect(fs.existsSync(dstPath)).toBe(true);
+ expect(fs.statSync(dstPath).size).toBeGreaterThan(0);
+ }, 120000); // 120s timeout for real API call
})
diff --git a/packages/i18n/tests/documents/test_de.pdf b/packages/i18n/tests/documents/test_de.pdf
new file mode 100644
index 00000000..3d6b66c3
Binary files /dev/null and b/packages/i18n/tests/documents/test_de.pdf differ
diff --git a/packages/i18n/tests/documents/test_de.xlsx b/packages/i18n/tests/documents/test_de.xlsx
new file mode 100644
index 00000000..026ea2ba
Binary files /dev/null and b/packages/i18n/tests/documents/test_de.xlsx differ
diff --git a/packages/kbot/dev-kbot.code-workspace b/packages/kbot/dev-kbot.code-workspace
index 0292ac82..f5042b10 100644
--- a/packages/kbot/dev-kbot.code-workspace
+++ b/packages/kbot/dev-kbot.code-workspace
@@ -5,6 +5,12 @@
},
{
"path": "../commons"
+ },
+ {
+ "path": "../i18n"
+ },
+ {
+ "path": "../deepl-mark"
}
],
"settings": {}